* [PATCH] Fix SVM longmode guests
@ 2010-05-27 1:09 Zachary Amsden
2010-05-27 9:31 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Zachary Amsden @ 2010-05-27 1:09 UTC (permalink / raw)
To: linux-kernel, kvm, Avi Kivity, Joerg Roedel, Sheng Yang
[-- Attachment #1: Type: text/plain, Size: 166 bytes --]
In recent testing, I discovered guests failed to boot on my AMD box.
Bisecting revealed an EFER related change caused the problem; here is
the fix.
Cheers,
Zach
[-- Attachment #2: svm-lm-efer-fix.patch --]
[-- Type: text/plain, Size: 838 bytes --]
Fix 64-bit guests on SVM.
Must set VCPU register to be the guest notion of EFER even if that
setting is not valid on hardware. This was masked by the set in
set_efer until 7657fd5ace88e8092f5f3a84117e093d7b893f26 broke that.
Fix is simply to set the VCPU register before stripping bits.
Signed-off-by: Zachary Amsden <zamsden@redhat.com>
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 100bd4b..a05b63f 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -285,11 +285,11 @@ static inline void flush_guest_tlb(struct kvm_vcpu *vcpu)
static void svm_set_efer(struct kvm_vcpu *vcpu, u64 efer)
{
+ vcpu->arch.efer = efer;
if (!npt_enabled && !(efer & EFER_LMA))
efer &= ~EFER_LME;
to_svm(vcpu)->vmcb->save.efer = efer | EFER_SVME;
- vcpu->arch.efer = efer;
}
static int is_external_interrupt(u32 info)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-27 9:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-27 1:09 [PATCH] Fix SVM longmode guests Zachary Amsden
2010-05-27 9:31 ` Avi Kivity
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).