mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86emul: support non-SIMD MOVRS
As we ignore cachability aspects of insns, they're treated like simple MOVs. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
644ea6f845
commit
59b18eb757
7 files changed
+48
-2
No files matched your search
@@ -841,6 +841,9 @@ static const struct {
|
||||
{ { 0x80 }, { 2, 2 }, T, R, pfx_66 }, /* invept */
|
||||
{ { 0x81 }, { 2, 2 }, T, R, pfx_66 }, /* invvpid */
|
||||
{ { 0x82 }, { 2, 2 }, T, R, pfx_66 }, /* invpcid */
|
||||
{ { 0x8a }, { 2, 2 }, T, R, pfx_no }, /* movrsb */
|
||||
{ { 0x8b }, { 2, 2 }, T, R, pfx_no }, /* movrs{d,q} */
|
||||
{ { 0x8b }, { 2, 2 }, T, R, pfx_66 }, /* movrsw */
|
||||
{ { 0xc8 }, { 2, 2 }, T, R, pfx_no }, /* sha1nexte */
|
||||
{ { 0xc9 }, { 2, 2 }, T, R, pfx_no }, /* sha1msg1 */
|
||||
{ { 0xca }, { 2, 2 }, T, R, pfx_no }, /* sha1msg2 */
|
||||
|
||||
@@ -1704,6 +1704,29 @@ int main(int argc, char **argv)
|
||||
}
|
||||
else
|
||||
printf("skipped\n");
|
||||
|
||||
{
|
||||
/* For the non-SIMD forms the emulator doesn't itself use MOVRS. */
|
||||
bool movrs = cpu_policy.feat.movrs;
|
||||
|
||||
cpu_policy.feat.movrs = true;
|
||||
|
||||
printf("%-40s", "Testing movrs 6(%rdi),%si...");
|
||||
instr[0] = 0x66; instr[1] = 0x0f; instr[2] = 0x38;
|
||||
instr[3] = 0x8b; instr[4] = 0x77; instr[5] = 0x06;
|
||||
regs.rip = (unsigned long)&instr[0];
|
||||
regs.rsi = 0x8888777766665555UL;
|
||||
regs.rdi = (unsigned long)res;
|
||||
res[1] = 0x88777788U;
|
||||
rc = x86_emulate(&ctxt, &emulops);
|
||||
if ( (rc != X86EMUL_OKAY) ||
|
||||
(regs.rip != (unsigned long)&instr[6]) ||
|
||||
(regs.rsi != 0x8888777766668877UL) )
|
||||
goto fail;
|
||||
printf("okay\n");
|
||||
|
||||
cpu_policy.feat.movrs = movrs;
|
||||
}
|
||||
#endif /* x86-64 */
|
||||
|
||||
printf("%-40s", "Testing shld $1,%ecx,(%edx)...");
|
||||
|
||||