[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 8/9] x86/amd: Introduce is_zen{1,2}_uarch() predicates


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 18 Sep 2023 13:07:20 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QlLy2xw/iIDJLB3hZJl5DpxPqrnxRAjvgfU0DQKpTdw=; b=lWEyzhphJ1fgkVcNmWulPf/+DorvlWPKVHnJI2k2rwNK3KsTBoTceBMqv0iQunuksEG71KjEfqZ2mXyrLJ69Oer9E+aD3qT5RGIikl2EoN6kfNjQLiIVyuKnQkf3Im8FxxrIt/ZLGrbU+6pfBEV4Az5VFcdAz+Hc4LJuHn6Tvc4OPucDwh2BsmlBdQBO3jt1qkDpNqDZibQ3ec1p92CqRfARv/sF9cQRZ0O4n/NsJJ1JOUFB1x7+WfN+2HMyUAOs2W2HYSssHKUDEXsL65/uKG/Gz8y4vYhTYYwFXwqNaSXfnCJmPLKCYHZiucK5PcEWzGdyD5C0GgWcjBBsPB13EA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fwzfry3lWq3DuT9zHOWjgiuEmppXADva8/AMoTcMkm5RKmgyRxBBNfgphYQfnfKm/p3fOl719cbv5RtS6Ubq1L9z5loA4Zrzrn41UB3tWzkKszWnltKxjzDHf5tOTs+dU4RbGfl14grBXmCL0BhBXikRnRRXzUqhZLU501SYZFsvJJW6ha4fa5r6r0HHGgk0jesun5gQHGG+k7cTECYvAeA2asNpxyKq9g4zUPDsFKWuee2JBMP5GoBTy2j2LCaeT9NBZFT5FxSu0V6kj7ypj3aD6g7UL7uXJaNOj1vqPJE3ROCJ4hIVT8cajuIS2hG8AIrSb+Wv3cn46AcMkays2A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 18 Sep 2023 11:07:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15.09.2023 17:00, Andrew Cooper wrote:
> --- a/xen/arch/x86/include/asm/amd.h
> +++ b/xen/arch/x86/include/asm/amd.h
> @@ -140,6 +140,17 @@
>                         AMD_MODEL_RANGE(0x11, 0x0, 0x0, 0xff, 0xf),   \
>                         AMD_MODEL_RANGE(0x12, 0x0, 0x0, 0xff, 0xf))
>  
> +/*
> + * The Zen1 and Zen2 microarchitectures are implemented by AMD (Fam17h) and
> + * Hygon (Fam18h) but without simple model number rules.  Instead, use STIBP
> + * as a heuristic that distinguishes the two.
> + *
> + * The caller is required to perform the appropriate vendor/family checks
> + * first.
> + */
> +#define is_zen1_uarch() (!boot_cpu_has(X86_FEATURE_AMD_STIBP))
> +#define is_zen2_uarch()   boot_cpu_has(X86_FEATURE_AMD_STIBP)
> +
>  struct cpuinfo_x86;
>  int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);

With one simply the opposite of the other, and with the requirement of a
family check up front, do we really need both? Personally I'd prefer if
we had just the latter. Yet in any event
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.