From: Zachary Amsden <zamsden@redhat.com>
To: linux-kernel@vger.kernel.org, kvm <kvm@vger.kernel.org>,
Avi Kivity <avi@redhat.com>, Joerg Roedel <joerg.roedel@amd.com>,
Sheng Yang <sheng@linux.intel.com>
Subject: [PATCH] Fix SVM longmode guests
Date: Wed, 26 May 2010 15:09:43 -1000 [thread overview]
Message-ID: <4BFDC657.4040902@redhat.com> (raw)
[-- 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)
next reply other threads:[~2010-05-27 1:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-27 1:09 Zachary Amsden [this message]
2010-05-27 9:31 ` [PATCH] Fix SVM longmode guests Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BFDC657.4040902@redhat.com \
--to=zamsden@redhat.com \
--cc=avi@redhat.com \
--cc=joerg.roedel@amd.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sheng@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).