[PATCH v2 2/2] kvm: x86: Clear {ebx,ecx,edx} from CPUID leaf 9

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

 



According to volume 2 of the SDM, output registers %ebx, %ecx, and
%edx of CPUID leaf 9 (the direct cache access information leaf) are
reserved.  Since we have no way of knowing what these fields will be
used for, they should not be whitelisted.

Fixes: 24c82e576b78 ("KVM: Sanitize cpuid")
Suggested-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx>
Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx>
---
 arch/x86/kvm/cpuid.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 183f40cd3362..d9b6d90fd062 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -510,6 +510,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 		break;
 	}
 	case 9:
+		entry->ebx = entry->ecx = entry->edx = 0;
 		break;
 	case 0xa: { /* Architectural Performance Monitoring */
 		struct x86_pmu_capability cap;
-- 
2.20.1.791.gb4d0f1c61a-goog




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux