public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Cc: kvm@vger.kernel.org, Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Subject: Re: [PATCH] KVM: x86: emulate movdqa
Date: Sun, 25 Mar 2012 14:05:06 +0200	[thread overview]
Message-ID: <4F6F09F2.4020400@redhat.com> (raw)
In-Reply-To: <1332441077-12921-1-git-send-email-stefanha@linux.vnet.ibm.com>

On 03/22/2012 08:31 PM, Stefan Hajnoczi wrote:
> An Ubuntu 9.10 Karmic Koala guest is unable to boot or install due to
> missing movdqa emulation:
>
> kvm_exit: reason EXCEPTION_NMI rip 0x7fef3e025a7b info 7fef3e799000 80000b0e
> kvm_page_fault: address 7fef3e799000 error_code f
> kvm_emulate_insn: 0:7fef3e025a7b: 66 0f 7f 07 (prot64)
>
> movdqa %xmm0,(%rdi)
>
> This patch adds movdqa to the emulator but does not implement #GP when
> the memory operand is unaligned to 16 bytes.  Alignment checking is
> performed in guest mode, so it works most of the time except for corner
> cases where the emulator sees the instruction but the guest never
> executed it (guest code modified by another vcpu while the emulator is
> executing).
>
> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
> ---
> This is the patch I tested against the movdqa kvm-unit-test that I submitted.
> It still doesn't include #GP on unaligned memory.  I'm not sure of the
> appropriate place in the emulator where the alignment check should be added.
> Perhaps __linearize()?

__linearize() is too deep, we've lost track of our 'struct operand' and
whether we need to check or not.

On the other hand, all other places don't have any knowledge of the
segment base.

Perhaps we should linearize into a new field of struct operand, instead
of on the fly.

Patch itself is fine, will soon see mmx movq to complement it.

-- 
error compiling committee.c: too many arguments to function


      reply	other threads:[~2012-03-25 12:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 18:31 [PATCH] KVM: x86: emulate movdqa Stefan Hajnoczi
2012-03-25 12:05 ` Avi Kivity [this message]

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=4F6F09F2.4020400@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=stefanha@linux.vnet.ibm.com \
    --cc=yoshikawa.takuya@oss.ntt.co.jp \
    /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