lkml.org 
[lkml]   [2022]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] KVM: x86: Mark transfer type as X86_TRANSFER_RET when loading CS in iret emulation
On Thu, Oct 13, 2022, Hou Wenlong wrote:
> On Thu, Oct 13, 2022 at 12:34:57AM +0800, Sean Christopherson wrote:
> > diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> > index 3b27622d4642..fe735e18c419 100644
> > --- a/arch/x86/kvm/emulate.c
> > +++ b/arch/x86/kvm/emulate.c
> > @@ -1641,6 +1641,14 @@ static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
> > goto exception;
> > break;
> > case VCPU_SREG_CS:
> > + /*
> > + * KVM uses "none" when loading CS as part of emulating Real
> > + * Mode exceptions and IRET (handled above). In all other
> > + * cases, loading CS without a control transfer is a KVM bug.
> > + */
> > + if (WARN_ON_ONCE(transfer == X86_TRANSFER_NONE))
> > + goto exception;
> > +
> > if (!(seg_desc.type & 8))
> > goto exception;
> >
> Do I need to prepare this patch or you will add this directly?

No preference. Feel free to post a patch, if not I'll get to it soon-ish.

\
 
 \ /
  Last update: 2022-10-14 06:17    [W:2.634 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site