Message ID | 20210831042742.8399-2-po-hsu.lin@canonical.com |
---|---|
State | New |
Headers | show |
Series | kvm: Add emulation for movups/movupd | expand |
On Tue, Aug 31, 2021 at 12:27:42PM +0800, Po-Hsu Lin wrote: > From: Stefan Fritsch <sf@sfritsch.de> > > BugLink: https://bugs.launchpad.net/bugs/1932966 > > This is very similar to the aligned versions movaps/movapd. > > We have seen the corresponding emulation failures with openbsd as guest > and with Windows 10 with intel HD graphics pass through. > > Signed-off-by: Christian Ehrhardt <christian_ehrhardt@genua.de> > Signed-off-by: Stefan Fritsch <sf@sfritsch.de> > Reviewed-by: Radim Krčmář <rkrcmar@redhat.com> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> > (cherry picked from commit 29916968c48691c94be466a0b47cc9adcea9cb8d) > Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com> Hey, PHLin. Nice catch! Thanks! Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com> > --- > arch/x86/kvm/emulate.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c > index c679f17..10bd3a8 100644 > --- a/arch/x86/kvm/emulate.c > +++ b/arch/x86/kvm/emulate.c > @@ -4497,6 +4497,10 @@ static const struct gprefix pfx_0f_2b = { > ID(0, &instr_dual_0f_2b), ID(0, &instr_dual_0f_2b), N, N, > }; > > +static const struct gprefix pfx_0f_10_0f_11 = { > + I(Unaligned, em_mov), I(Unaligned, em_mov), N, N, > +}; > + > static const struct gprefix pfx_0f_28_0f_29 = { > I(Aligned, em_mov), I(Aligned, em_mov), N, N, > }; > @@ -4708,7 +4712,9 @@ static const struct opcode twobyte_table[256] = { > DI(ImplicitOps | Priv, invd), DI(ImplicitOps | Priv, wbinvd), N, N, > N, D(ImplicitOps | ModRM | SrcMem | NoAccess), N, N, > /* 0x10 - 0x1F */ > - N, N, N, N, N, N, N, N, > + GP(ModRM | DstReg | SrcMem | Mov | Sse, &pfx_0f_10_0f_11), > + GP(ModRM | DstMem | SrcReg | Mov | Sse, &pfx_0f_10_0f_11), > + N, N, N, N, N, N, > D(ImplicitOps | ModRM | SrcMem | NoAccess), > N, N, N, N, N, N, D(ImplicitOps | ModRM | SrcMem | NoAccess), > /* 0x20 - 0x2F */ > -- > 2.7.4 > > > -- > kernel-team mailing list > kernel-team@lists.ubuntu.com > https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index c679f17..10bd3a8 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -4497,6 +4497,10 @@ static const struct gprefix pfx_0f_2b = { ID(0, &instr_dual_0f_2b), ID(0, &instr_dual_0f_2b), N, N, }; +static const struct gprefix pfx_0f_10_0f_11 = { + I(Unaligned, em_mov), I(Unaligned, em_mov), N, N, +}; + static const struct gprefix pfx_0f_28_0f_29 = { I(Aligned, em_mov), I(Aligned, em_mov), N, N, }; @@ -4708,7 +4712,9 @@ static const struct opcode twobyte_table[256] = { DI(ImplicitOps | Priv, invd), DI(ImplicitOps | Priv, wbinvd), N, N, N, D(ImplicitOps | ModRM | SrcMem | NoAccess), N, N, /* 0x10 - 0x1F */ - N, N, N, N, N, N, N, N, + GP(ModRM | DstReg | SrcMem | Mov | Sse, &pfx_0f_10_0f_11), + GP(ModRM | DstMem | SrcReg | Mov | Sse, &pfx_0f_10_0f_11), + N, N, N, N, N, N, D(ImplicitOps | ModRM | SrcMem | NoAccess), N, N, N, N, N, N, D(ImplicitOps | ModRM | SrcMem | NoAccess), /* 0x20 - 0x2F */