From: Avi Kivity <avi@qumranet.com>
To: Mohammed Gamal <m.gamal005@gmail.com>
Cc: kvm@vger.kernel.org, riel@surriel.com
Subject: Re: [PATCH] x86 emulator: Update EIP even with instructions with no writeback
Date: Sun, 06 Jul 2008 10:51:37 +0300 [thread overview]
Message-ID: <48707989.1050003@qumranet.com> (raw)
In-Reply-To: <20080705191421.GA28785@mohd-laptop>
Mohammed Gamal wrote:
> This patch resolves the problem encountered with HLT emulation with FreeDOS's HIMEM XMS Driver.
>
> HLT is the only instruction that goes to the done label unconditionally,
> causing the EIP value not to be updated which leads to the guest looping
> forever on the same instruction.
>
> Signed-off-by: Mohammed Gamal <m.gamal005@gmail.com>
>
> ---
>
> arch/x86/kvm/x86_emulate.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
> index dd4efe1..04d7f02 100644
> --- a/arch/x86/kvm/x86_emulate.c
> +++ b/arch/x86/kvm/x86_emulate.c
> @@ -1769,13 +1769,15 @@ writeback:
>
> /* Commit shadow register state. */
> memcpy(ctxt->vcpu->arch.regs, c->regs, sizeof c->regs);
> - kvm_rip_write(ctxt->vcpu, c->eip);
>
> done:
> if (rc == X86EMUL_UNHANDLEABLE) {
> c->eip = saved_eip;
> return -1;
> }
> + else
> + kvm_rip_write(ctxt->vcpu, c->eip);
> +
> return 0;
Why not change hlt to writeback like all other instructions?
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2008-07-06 7:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-05 19:14 [PATCH] x86 emulator: Update EIP even with instructions with no writeback Mohammed Gamal
2008-07-06 7:51 ` Avi Kivity [this message]
2008-07-06 13:26 ` Mohammed Gamal
2008-07-06 13:34 ` Avi Kivity
2008-07-06 13:45 ` Mohammed Gamal
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=48707989.1050003@qumranet.com \
--to=avi@qumranet.com \
--cc=kvm@vger.kernel.org \
--cc=m.gamal005@gmail.com \
--cc=riel@surriel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.