Skip to contentSkip to conversation

x86/svm: Replace opencoded 1GB superpage check

PATCH In review Andrew Cooper 2 participants 2 messages Jan 3, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/svm: Replace opencoded 1GB superpage check

No functional change.

---
CC: Jan Beulich <[email protected]>
CC: Boris Ostrovsky <[email protected]>
CC: Suravee Suthikulpanit <[email protected]>

---
 xen/arch/x86/hvm/svm/svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/hvm/svm/svm.c +1 -1
index 89daa39..04a7b60 100644
@@ -1473,7 +1473,7 @@ const struct hvm_function_table * __init start_svm(void)
 
     svm_function_table.hap_supported = !!cpu_has_svm_npt;
     svm_function_table.hap_capabilities = HVM_HAP_SUPERPAGE_2MB |
-        ((cpuid_edx(0x80000001) & 0x04000000) ? HVM_HAP_SUPERPAGE_1GB : 0);
+        (cpu_has_page1gb ? HVM_HAP_SUPERPAGE_1GB : 0);
 
     return &svm_function_table;
 }
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Andrew Cooper

No functional change.

---
CC: Jan Beulich <[email protected]>
CC: Boris Ostrovsky <[email protected]>
CC: Suravee Suthikulpanit <[email protected]>

Quoted 9 lines
---
 xen/arch/x86/hvm/svm/svm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/hvm/svm/svm.c +0 -0
index 89daa39..04a7b60 100644

xen/arch/x86/hvm/svm/svm.c const struct hvm_function_table * __init start_svm(void) · line 1479

Quoted 8 lines
xen/arch/x86/hvm/svm/svm.c +1 -1
@@ -1473,7 +1473,7 @@ const struct hvm_function_table * __init start_svm(void)
 
     svm_function_table.hap_supported = !!cpu_has_svm_npt;
     svm_function_table.hap_capabilities = HVM_HAP_SUPERPAGE_2MB |
-        ((cpuid_edx(0x80000001) & 0x04000000) ? HVM_HAP_SUPERPAGE_1GB : 0);
+        (cpu_has_page1gb ? HVM_HAP_SUPERPAGE_1GB : 0);
 
     return &svm_function_table;
 }

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel