Skip to contentSkip to conversation

libxl: allow to enable/disable cpuid bits

PATCH Applied Christoph Egger 3 participants 6 messages Nov 1, 2011 – Nov 2, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: allow to enable/disable cpuid bits

Allow to enable/disable SVM specific cpuid bits in the guest config file via cpuid config option. Also allow to enable/disable the hypervisor cpuid bit in the guest config file. We need to disable the hypervisor cpuid bit to get Hyper-V going.

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
tools/libxl/libxl_cpuid.c +8 -0
diff -r 0d092359d86f tools/libxl/libxl_cpuid.c
@@ -92,6 +92,7 @@ int libxl_cpuid_parse_config(libxl_cpuid
         {"proccount",    0x00000001, NA, CPUID_REG_EBX, 16,  8},
         {"clflush",      0x00000001, NA, CPUID_REG_EBX,  8,  8},
         {"brandid",      0x00000001, NA, CPUID_REG_EBX,  0,  8},
+        {"raz",          0x00000001, NA, CPUID_REG_ECX, 31,  1},
         {"f16c",         0x00000001, NA, CPUID_REG_ECX, 29,  1},
         {"avx",          0x00000001, NA, CPUID_REG_ECX, 28,  1},
         {"osxsave",      0x00000001, NA, CPUID_REG_ECX, 27,  1},
@@ -178,6 +179,13 @@ int libxl_cpuid_parse_config(libxl_cpuid
         {"procpkg",      0x00000004,  0, CPUID_REG_EAX, 26,  6},
         {"apicidsize",   0x80000008, NA, CPUID_REG_ECX, 12,  4},
         {"nc",           0x80000008, NA, CPUID_REG_ECX,  0,  8},
+        {"svm_npt",      0x8000000a, NA, CPUID_REG_EDX,  0,  1},
+        {"svm_lbrv",     0x8000000a, NA, CPUID_REG_EDX,  1,  1},
+        {"svm_nrips",    0x8000000a, NA, CPUID_REG_EDX,  3,  1},
+        {"svm_tscrate",  0x8000000a, NA, CPUID_REG_EDX,  4,  1},
+        {"svm_vmcbclean",0x8000000a, NA, CPUID_REG_EDX,  5,  1},
+        {"svm_decode",   0x8000000a, NA, CPUID_REG_EDX,  7,  1},
+        {"svm_pausefilt",0x8000000a, NA, CPUID_REG_EDX, 10,  1},
 
         {NULL, 0, CPUID_REG_INV, 0, 0}
     };

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Christoph Egger writes ("[Xen-devel] [PATCH] libxl: allow to enable/disable cpuid bits"):

Quoted 6 lines

Allow to enable/disable SVM specific cpuid bits in the guest config file via cpuid config option. Also allow to enable/disable the hypervisor cpuid bit in the guest config file. We need to disable the hypervisor cpuid bit to get Hyper-V going.

The change itself looks plausible to me. However I don't know much about cpuid; can you get an ack from a hypervisor maintainer or an suitable expert ?

Thanks,
Ian.

#2 lore raw
Quoted 11 lines · Ian Jackson

Christoph Egger writes ("[Xen-devel] [PATCH] libxl: allow to enable/disable cpuid bits"):

Quoted 6 lines

Allow to enable/disable SVM specific cpuid bits in the guest config file via cpuid config option. Also allow to enable/disable the hypervisor cpuid bit in the guest config file. We need to disable the hypervisor cpuid bit to get Hyper-V going.

The change itself looks plausible to me. However I don't know much about cpuid; can you get an ack from a hypervisor maintainer or an suitable expert ?

Keir? Tim?

Christoph

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
#3 lore raw
Quoted 10 lines · Christoph Egger
Quoted 9 lines · Ian Jackson

Christoph Egger writes ("[Xen-devel] [PATCH] libxl: allow to enable/disable cpuid bits"):

Quoted 6 lines

Allow to enable/disable SVM specific cpuid bits in the guest config file via cpuid config option. Also allow to enable/disable the hypervisor cpuid bit in the guest config file. We need to disable the hypervisor cpuid bit to get Hyper-V going.

Quoted 5 lines
Quoted 3 lines

The change itself looks plausible to me. However I don't know much about cpuid; can you get an ack from a hypervisor maintainer or an suitable expert ?

Keir? Tim?

I think the hypervisor bit should be given a better name than 'raz' -- although it is read-as-zero on real hardware that doesn't distinguish it from other raz bits, or describe what it does.

'hypervisor' maybe, to match 'X86_FEATURE_HYPERVISOR' elsewhere in the Xen code?

With that change, Acked-by: Tim Deegan <[email protected]>

Cheers,

Tim.

#4 lore raw
Quoted 17 lines · Tim Deegan
Quoted 10 lines · Christoph Egger
Quoted 9 lines · Ian Jackson

Christoph Egger writes ("[Xen-devel] [PATCH] libxl: allow to enable/disable cpuid bits"):

Quoted 6 lines

Allow to enable/disable SVM specific cpuid bits in the guest config file via cpuid config option. Also allow to enable/disable the hypervisor cpuid bit in the guest config file. We need to disable the hypervisor cpuid bit to get Hyper-V going.

Quoted 5 lines
Quoted 3 lines

The change itself looks plausible to me. However I don't know much about cpuid; can you get an ack from a hypervisor maintainer or an suitable expert ?

Keir? Tim?

Quoted 8 lines

I think the hypervisor bit should be given a better name than 'raz' -- although it is read-as-zero on real hardware that doesn't distinguish it from other raz bits, or describe what it does.

'hypervisor' maybe, to match 'X86_FEATURE_HYPERVISOR' elsewhere in the Xen code?

With that change, Acked-by: Tim Deegan<[email protected]>

New version with that change attached.

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
tools/libxl/libxl_cpuid.c +8 -0
diff -r 0d092359d86f tools/libxl/libxl_cpuid.c
@@ -92,6 +92,7 @@ int libxl_cpuid_parse_config(libxl_cpuid
         {"proccount",    0x00000001, NA, CPUID_REG_EBX, 16,  8},
         {"clflush",      0x00000001, NA, CPUID_REG_EBX,  8,  8},
         {"brandid",      0x00000001, NA, CPUID_REG_EBX,  0,  8},
+        {"hypervisor",   0x00000001, NA, CPUID_REG_ECX, 31,  1},
         {"f16c",         0x00000001, NA, CPUID_REG_ECX, 29,  1},
         {"avx",          0x00000001, NA, CPUID_REG_ECX, 28,  1},
         {"osxsave",      0x00000001, NA, CPUID_REG_ECX, 27,  1},
@@ -178,6 +179,13 @@ int libxl_cpuid_parse_config(libxl_cpuid
         {"procpkg",      0x00000004,  0, CPUID_REG_EAX, 26,  6},
         {"apicidsize",   0x80000008, NA, CPUID_REG_ECX, 12,  4},
         {"nc",           0x80000008, NA, CPUID_REG_ECX,  0,  8},
+        {"svm_npt",      0x8000000a, NA, CPUID_REG_EDX,  0,  1},
+        {"svm_lbrv",     0x8000000a, NA, CPUID_REG_EDX,  1,  1},
+        {"svm_nrips",    0x8000000a, NA, CPUID_REG_EDX,  3,  1},
+        {"svm_tscrate",  0x8000000a, NA, CPUID_REG_EDX,  4,  1},
+        {"svm_vmcbclean",0x8000000a, NA, CPUID_REG_EDX,  5,  1},
+        {"svm_decode",   0x8000000a, NA, CPUID_REG_EDX,  7,  1},
+        {"svm_pausefilt",0x8000000a, NA, CPUID_REG_EDX, 10,  1},
 
         {NULL, 0, CPUID_REG_INV, 0, 0}
     };

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Applied
#5 lore raw

Christoph Egger writes ("Re: [Xen-devel] [PATCH] libxl: allow to enable/disable cpuid bits"):

Quoted 3 lines

New version with that change attached.

Applied, thanks to both of you.

Ian.