From: Alexander Graf <agraf@suse.de>
To: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
guillaume.thouvenin@ext.bull.net
Subject: x86 emulator broken (vmload)
Date: Thu, 18 Dec 2008 13:14:37 +0100 [thread overview]
Message-ID: <494A3EAD.2030902@suse.de> (raw)
While creating some userspace patches for the nested SVM implementation,
I stumbled across an emulation problem in the x86 emulator that was not
there some weeks ago.
Basically I'm running into an endless loop at:
NSVM: emulating at 0xe0e4077d -> 0
which is the "VMLOAD" instruction.
The endless loop is caused by this code:
while(true) {
int er;
er = emulate_instruction(&svm->vcpu, kvm_run, 0, 0, 0);
nsvm_printk("NSVM: emulating at 0x%lx -> %d\n",
svm->vcpu.arch.regs[VCPU_REGS_RIP], er);
/* So we can now emulate the SVM instructions that most
probably
occur at the end of the codepath */
if (er != EMULATE_DONE) {
while (true)
if (nested_svm_emulate(svm, kvm_run) ==
EMULATE_FAIL)
break;
break;
}
}
While I have to admit that the while(true) is potentially a bad idea and
I should limit that to like 100 instructions (patch floating around
locally), emulate_instruction always returns EMULATE_DONE, even on the
vmload instruction (which is clearly wrong).
Does anyone have ideas on this?
Alex
next reply other threads:[~2008-12-18 12:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-18 12:14 Alexander Graf [this message]
2008-12-23 17:52 ` x86 emulator broken (vmload) 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=494A3EAD.2030902@suse.de \
--to=agraf@suse.de \
--cc=guillaume.thouvenin@ext.bull.net \
--cc=kvm@vger.kernel.org \
/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