All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/emul: Assert the STI shadow when POPF sets the interrupt flag
@ 2018-11-06 14:09 Andrew Cooper
  2018-11-06 14:56 ` Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cooper @ 2018-11-06 14:09 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Wei Liu, Jan Beulich

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index e69dfdd..e93532d 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -4061,6 +4061,12 @@ x86_emulate(
             }
         }
         dst.val &= EFLAGS_MODIFIABLE;
+
+        /* When IF transitions from 0 to 1, assert the STI shadow. */
+        if ( !(_regs.eflags & X86_EFLAGS_IF) &&
+             ((dst.val & ~mask) & X86_EFLAGS_IF) )
+            ctxt->retire.sti = true;
+
         _regs.eflags &= mask;
         _regs.eflags |= (dst.val & ~mask) | X86_EFLAGS_MBS;
         break;
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/emul: Assert the STI shadow when POPF sets the interrupt flag
  2018-11-06 14:09 [PATCH] x86/emul: Assert the STI shadow when POPF sets the interrupt flag Andrew Cooper
@ 2018-11-06 14:56 ` Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2018-11-06 14:56 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Wei Liu, Xen-devel

>>> On 06.11.18 at 15:09, <andrew.cooper3@citrix.com> wrote:
> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -4061,6 +4061,12 @@ x86_emulate(
>              }
>          }
>          dst.val &= EFLAGS_MODIFIABLE;
> +
> +        /* When IF transitions from 0 to 1, assert the STI shadow. */
> +        if ( !(_regs.eflags & X86_EFLAGS_IF) &&
> +             ((dst.val & ~mask) & X86_EFLAGS_IF) )
> +            ctxt->retire.sti = true;

I'm entirely unaware that POPF behaves the same way as STI in this
regard. Therefore: Are you sure? Can you point me to where this is
spelled out?

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-06 14:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-06 14:09 [PATCH] x86/emul: Assert the STI shadow when POPF sets the interrupt flag Andrew Cooper
2018-11-06 14:56 ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.