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

Re: [PATCH v2 3/3] x86: Add support for CpuidUserDis


  • To: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 11 May 2023 13:05:42 +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=1l1Gp6Ou/lbjv/gS/K182mAIX8nNebhtPOUDNl97VMQ=; b=OPioyROvLAXnojglmgeTruCZIEMRqy2vn58NRODaQlco9/hCuMYIL6BMlKsKt0IuoAw347cP3lsJU3IDwL2oO/y2kw22jpPb6HbHGC2DbBQjrKUl2stQZWmqezfTrEVmwzEpDrMWRu9PQipgRBppqdBZXuworLqNzo7bH112B1eQ2z1BdOucij1Za5s6hy1VgSVajTxtGU/5wWHSSY74eCQpf1F+QLp+rBqt33nJ5ZNGWoa3MP68ynfJB6LRiA++3HQx1hdrg6k8r1GwdcnzWtNFeEEpdbn4ZjxteCi4Q8GSsMMJKRR5pt8tMdkXdIaNoqCjS6I+ftg/WC1cW9BvLg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NOj+6N4i9HF2G0xj47tRe8a2qzLq/qYHGgw5xeU+6pjuHOQRK9msuTOaL56pmVuaj5olY872olcLMrCcrI4Y0gGpCcRbKJROtiuY4UJkOVxKTwUx9MhykdyIOWGPLJQqLIKlu2zuyeQML16tOj53MFiKVuVx6bKmaw5EBwtcENY7M36XNrRnvsxR6jS2FikD/Oc+On9CyPiSuaPS7pMl1y9AEIeEEYIn//Q0ogiOk1MVA/dBZA39Lkrk6oRdptvYA2Mt9rJ41JtdpDNDeyncZKyswGtPnPnJW7Ljs9Vcw/F50BFaoolD2kPItutc7TL+Kaf4hjO9/immed/liiU/Ew==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 11 May 2023 11:06:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 09.05.2023 18:43, Alejandro Vallejo wrote:
> Because CpuIdUserDis is reported in CPUID itself, the extended leaf
> containing that bit must be retrieved before calling c_early_init()
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>

Looks largely okay when taken together with patch 2, but ...

> --- a/xen/arch/x86/cpu/amd.c
> +++ b/xen/arch/x86/cpu/amd.c
> @@ -279,8 +279,12 @@ static void __init noinline amd_init_levelling(void)
>        * that can only be present when Xen is itself virtualized (because
>        * it can be emulated)
>        */
> -     if (cpu_has_hypervisor && probe_cpuid_faulting())
> +     if ((cpu_has_hypervisor && probe_cpuid_faulting()) ||
> +         boot_cpu_has(X86_FEATURE_CPUID_USER_DIS)) {

... imo the probe_cpuid_faulting() call would better be avoided when
the CPUID bit is set.

> +             expected_levelling_cap |= LCAP_faulting;
> +             levelling_caps |=  LCAP_faulting;

Further the movement of these two lines from ...

> @@ -144,8 +145,6 @@ bool __init probe_cpuid_faulting(void)
>               return false;
>       }
>  
> -     expected_levelling_cap |= LCAP_faulting;
> -     levelling_caps |=  LCAP_faulting;
>       setup_force_cpu_cap(X86_FEATURE_CPUID_FAULTING);

... here (and also to intel.c) should imo be part of patch 2. While
moving them, I think you also want to deal with the stray double
blank.

Jan



 


Rackspace

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