public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] kvm/x86: fix XSAVE bit scanning
@ 2011-03-30 13:01 Andre Przywara
  2011-03-30 13:01 ` [PATCH 2/2] kvm/x86: remove unneeded substitute search for missing CPUID entries Andre Przywara
  0 siblings, 1 reply; 11+ messages in thread
From: Andre Przywara @ 2011-03-30 13:01 UTC (permalink / raw)
  To: avi; +Cc: kvm, Andre Przywara, stable

When KVM scans the 0xD CPUID leaf for propagating the XSAVE save area
leaves, it assumes that the leaves are contigious and stops at the
first zero one. On AMD hardware there is a gap, though, as LWP uses
leaf 62 to announce it's state save area.
So lets iterate through all 64 possible leaves and simply skip zero
ones to also cover later features.

CC: <stable@kernel.org> [2.6.38]
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
---
 arch/x86/kvm/x86.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index bfd7763..6e86cec 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2395,9 +2395,9 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 		int i;
 
 		entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
-		for (i = 1; *nent < maxnent; ++i) {
-			if (entry[i - 1].eax == 0 && i != 2)
-				break;
+		for (i = 1; *nent < maxnent && i < 64; ++i) {
+			if (entry[i].eax == 0)
+				continue;
 			do_cpuid_1_ent(&entry[i], function, i);
 			entry[i].flags |=
 			       KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
-- 
1.6.4



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

end of thread, other threads:[~2011-04-03 12:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-30 13:01 [PATCH 1/2] kvm/x86: fix XSAVE bit scanning Andre Przywara
2011-03-30 13:01 ` [PATCH 2/2] kvm/x86: remove unneeded substitute search for missing CPUID entries Andre Przywara
2011-03-30 13:26   ` Avi Kivity
2011-03-30 13:33     ` Avi Kivity
2011-03-31 10:12     ` Andre Przywara
2011-03-31 10:32       ` Avi Kivity
2011-03-31 13:13         ` [PATCH 2/2] kvm/x86: move and fix substitue " Andre Przywara
2011-03-31 13:17           ` Avi Kivity
2011-03-31 14:50             ` Andre Przywara
2011-03-31 14:58             ` [PATCH 2/2 v3] " Andre Przywara
2011-04-03 12:32               ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox