Yeah I see there is not flow to en_sysenter which doesn't pass this logic. Thanks -----Original Message----- From: Paolo Bonzini <pbonzini@xxxxxxxxxx> Sent: Tuesday, June 18, 2019 5:12 PM To: Saar Amar <Saar.Amar@xxxxxxxxxxxxx>; kvm@xxxxxxxxxxxxxxx Cc: Radim Krčmář <rkrcmar@xxxxxxxxxx> Subject: Re: KVM: x86: Fix emulation of sysenter On 18/06/19 15:19, Saar Amar wrote: > I found a bug in sysenter emulation. Patch attached both in plaintext > and as patch file. Do you have a testcase for this? RF is cleared for all instructions here: if (ctxt->rep_prefix && (ctxt->d & String)) ctxt->eflags |= X86_EFLAGS_RF; else ctxt->eflags &= ~X86_EFLAGS_RF; just before em_sysenter is called. Paolo