Skip to contentSkip to conversation

x86/emul: Don't opencode CR0_TS in CLTS handling

PATCH In review Andrew Cooper 2 participants 2 messages Dec 19, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/emul: Don't opencode CR0_TS in CLTS handling

Also replace implicit 0 checks with X86EMUL_OKAY

---
CC: Jan Beulich <[email protected]>

---
 xen/arch/x86/x86_emulate/x86_emulate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xen/arch/x86/x86_emulate/x86_emulate.c +2 -2
index f69dece..f8188ee 100644
@@ -4684,8 +4684,8 @@ x86_emulate(
     case X86EMUL_OPC(0x0f, 0x06): /* clts */
         generate_exception_if(!mode_ring0(), EXC_GP, 0);
         fail_if((ops->read_cr == NULL) || (ops->write_cr == NULL));
-        if ( (rc = ops->read_cr(0, &dst.val, ctxt)) ||
-             (rc = ops->write_cr(0, dst.val&~8, ctxt)) )
+        if ( (rc = ops->read_cr(0, &dst.val, ctxt)) != X86EMUL_OKAY ||
+             (rc = ops->write_cr(0, dst.val & ~CR0_TS, ctxt)) != X86EMUL_OKAY )
             goto done;
         break;
 
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel