]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86: Add AMD's CpuidUserDis bit definitions
authorAlejandro Vallejo <alejandro.vallejo@cloud.com>
Thu, 11 May 2023 11:12:46 +0000 (13:12 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 11 May 2023 11:12:46 +0000 (13:12 +0200)
AMD reports support for CpuidUserDis in CPUID and provides the toggle in HWCR.
This patch adds the positions of both of those bits to both xen and tools.

No functional change.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
tools/libs/light/libxl_cpuid.c
tools/misc/xen-cpuid.c
xen/arch/x86/include/asm/msr-index.h
xen/include/public/arch-x86/cpufeatureset.h

index 5f0bf938104715b4e7c99bdfe563aceaf344f695..cca0f19d93ac6dc9a29c2a436926b80a16fd991f 100644 (file)
@@ -317,6 +317,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str)
 
         {"lfence+",      0x80000021, NA, CPUID_REG_EAX,  2,  1},
         {"nscb",         0x80000021, NA, CPUID_REG_EAX,  6,  1},
+        {"cpuid-user-dis", 0x80000021, NA, CPUID_REG_EAX, 17, 1},
 
         {"maxhvleaf",    0x40000000, NA, CPUID_REG_EAX,  0,  8},
 
index d7efc59d31831d21336852103262a851cc7a49db..8ec143ebc854218fbf3dee6f956262b866bbedb4 100644 (file)
@@ -199,6 +199,8 @@ static const char *const str_e21a[32] =
 {
     [ 2] = "lfence+",
     [ 6] = "nscb",
+
+    /* 16 */                [17] = "cpuid-user-dis",
 };
 
 static const char *const str_7b1[32] =
index fa771ed0b50f3c9e6666b06e8a25e14f94840db6..082fb2e0d9ae0b8321a20beea575870cacefe952 100644 (file)
 
 #define MSR_K8_HWCR                    0xc0010015
 #define K8_HWCR_TSC_FREQ_SEL           (1ULL << 24)
+#define K8_HWCR_CPUID_USER_DIS         (1ULL << 35)
 
 #define MSR_K7_FID_VID_CTL             0xc0010041
 #define MSR_K7_FID_VID_STATUS          0xc0010042
index 12e3dc80c634343032e283cede7c1b9630c81d90..8de73aebc3e0bda1214efd307f9f6437438317a8 100644 (file)
@@ -287,6 +287,7 @@ XEN_CPUFEATURE(AVX_IFMA,     10*32+23) /*A  AVX-IFMA Instructions */
 /* AMD-defined CPU features, CPUID level 0x80000021.eax, word 11 */
 XEN_CPUFEATURE(LFENCE_DISPATCH,    11*32+ 2) /*A  LFENCE always serializing */
 XEN_CPUFEATURE(NSCB,               11*32+ 6) /*A  Null Selector Clears Base (and limit too) */
+XEN_CPUFEATURE(CPUID_USER_DIS,     11*32+17) /*   CPUID disable for CPL > 0 software */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:1.ebx, word 12 */
 XEN_CPUFEATURE(INTEL_PPIN,         12*32+ 0) /*   Protected Processor Inventory Number */