ACK/wcmnt: [precise] [PATCH] SRU: KVM: x86: emulate movdqa
Stefan Bader
stefan.bader at canonical.com
Mon Jun 16 15:10:47 UTC 2014
On 15.06.2014 13:54, Anton Nayshtut wrote:
> BugLink: https://bugs.launchpad.net/bugs/1330177
>
> (backported from commit 49597d8116ad70aabb598e606b218ddd9315b0af
> linux-stable)
>
> The commit 49597d8116ad70aabb598e606b218ddd9315b0af cherry-picked with
> small changes: Aligned and Unaligned macros removed.
>
> [SRU Justification]
>
> [Explanation]
> movdqa emulation is not supported in kernel 3.2, so the patch is only
> relevant for Precise 3.2 kernels.
>
> [Impact]
> Without movdqa emulation the MS SVVP "PCI Hardware Compliance Test for
> Systems" fails for Windows 2012 VM.
>
> This test fails and hangs the VM to the point that the VM becomes unusable.
>
> [Test Case]
> Windows 2012 Guest VMs running "PCI Hardware Compliance Test for
> Systems" SVVP test.
>
> Signed-off-by: Stefan Hajnoczi <stefanha at linux.vnet.ibm.com>
> Signed-off-by: Avi Kivity <avi at redhat.com>
> Signed-off-by: Marcelo Tosatti <mtosatti at redhat.com>
> (backported from commit 49597d8116ad70aabb598e606b218ddd9315b0af
> linux-stable)
> Signed-off-by: Anton Nayshtut <anton at swortex.com>
>
> Conflicts:
>
> arch/x86/kvm/emulate.c
> ---
> arch/x86/kvm/emulate.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index f5302da..bc3648f 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -2675,7 +2675,7 @@ static int em_rdtsc(struct x86_emulate_ctxt *ctxt)
>
> static int em_mov(struct x86_emulate_ctxt *ctxt)
> {
> - ctxt->dst.val = ctxt->src.val;
> + memcpy(ctxt->dst.valptr, ctxt->src.valptr, ctxt->op_bytes);
> return X86EMUL_CONTINUE;
> }
>
> @@ -2703,12 +2703,6 @@ static int em_mov_sreg_rm(struct x86_emulate_ctxt
> *ctxt)
> return load_segment_descriptor(ctxt, sel, ctxt->modrm_reg);
> }
>
> -static int em_movdqu(struct x86_emulate_ctxt *ctxt)
> -{
> - memcpy(&ctxt->dst.vec_val, &ctxt->src.vec_val, ctxt->op_bytes);
> - return X86EMUL_CONTINUE;
> -}
> -
> static int em_invlpg(struct x86_emulate_ctxt *ctxt)
> {
> int rc;
> @@ -3162,7 +3156,7 @@ static struct opcode group11[] = {
> };
>
> static struct gprefix pfx_0f_6f_0f_7f = {
> - N, N, N, I(Sse, em_movdqu),
> + N, I(Sse, em_mov), N, I(Sse, em_mov),
Compared this to the upstream commit and it looks to be the same. We may think
of cherry-picking this after also pulling
commit 1c11b37669a5209bd11fb857a103634afef971e8
which adds the alignment check and does a gp#0 when it is wrong. Both commits
came with 3.5.
Otherwise this patch adds a pointer for emulation of instructions with pfx_66
which is MOVe Double Quad Aligned. Just without enforcing the alignment. It is
missing for MOVDQU, too, right now.
> };
>
> static struct opcode opcode_table[256] = {
> --
> 1.7.9.5
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20140616/1e79e83d/attachment.sig>
More information about the kernel-team
mailing list