kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] kvm: x86: revert mask out xsaves
@ 2014-12-02  6:14 Wanpeng Li
  2014-12-02  6:14 ` [PATCH v2 2/2] kvm: vmx: enable intel xsaves for guest Wanpeng Li
  2014-12-02  8:55 ` [PATCH v2 1/2] kvm: x86: revert mask out xsaves Paolo Bonzini
  0 siblings, 2 replies; 7+ messages in thread
From: Wanpeng Li @ 2014-12-02  6:14 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: kvm, linux-kernel, Wanpeng Li

xsaves will be exported to guest in the next patch, so revert the
mask out xsaves patch.

Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
---
 arch/x86/kvm/cpuid.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index a4f5ac4..7af07571 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -320,10 +320,6 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 		F(ADX) | F(SMAP) | F(AVX512F) | F(AVX512PF) | F(AVX512ER) |
 		F(AVX512CD);
 
-	/* cpuid 0xD.1.eax */
-	const u32 kvm_supported_word10_x86_features =
-		F(XSAVEOPT) | F(XSAVEC) | F(XGETBV1);
-
 	/* all calls to cpuid_count() should be made on the same cpu */
 	get_cpu();
 
@@ -460,8 +456,6 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 		entry->eax &= supported;
 		entry->edx &= supported >> 32;
 		entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
-		if (!supported)
-			break;
 
 		for (idx = 1, i = 1; idx < 64; ++idx) {
 			u64 mask = ((u64)1 << idx);
@@ -469,9 +463,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 				goto out;
 
 			do_cpuid_1_ent(&entry[i], function, idx);
-			if (idx == 1)
-				entry[i].eax &= kvm_supported_word10_x86_features;
-			else if (entry[i].eax == 0 || !(supported & mask))
+			if (entry[i].eax == 0 || !(supported & mask))
 				continue;
 			entry[i].flags |=
 			       KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-12-03  0:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-02  6:14 [PATCH v2 1/2] kvm: x86: revert mask out xsaves Wanpeng Li
2014-12-02  6:14 ` [PATCH v2 2/2] kvm: vmx: enable intel xsaves for guest Wanpeng Li
2014-12-02  8:51   ` Paolo Bonzini
2014-12-02  8:38     ` Wanpeng Li
2014-12-02  8:55 ` [PATCH v2 1/2] kvm: x86: revert mask out xsaves Paolo Bonzini
2014-12-02  8:41   ` Wanpeng Li
2014-12-03  0:50   ` Wanpeng Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).