lkml.org 
[lkml]   [2022]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v5 101/104] KVM: TDX: Silently ignore INIT/SIPI
On Thu, Apr 07, 2022 at 02:12:28PM +0200,
Paolo Bonzini <pbonzini@redhat.com> wrote:

> On 4/7/22 13:09, Xiaoyao Li wrote:
> > On 4/5/2022 11:48 PM, Paolo Bonzini wrote:
> > > On 3/4/22 20:49, isaku.yamahata@intel.com wrote:
> > > > +        if (kvm_init_sipi_unsupported(vcpu->kvm))
> > > > +            /*
> > > > +             * TDX doesn't support INIT.  Ignore INIT event.  In the
> > > > +             * case of SIPI, the callback of
> > > > +             * vcpu_deliver_sipi_vector ignores it.
> > > > +             */
> > > >               vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
> > > > -        else
> > > > -            vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED;
> > > > +        else {
> > > > +            kvm_vcpu_reset(vcpu, true);
> > > > +            if (kvm_vcpu_is_bsp(apic->vcpu))
> > > > +                vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
> > > > +            else
> > > > +                vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED;
> > > > +        }
> > >
> > > Should you check vcpu->arch.guest_state_protected instead of
> > > special-casing TDX?
> >
> > We cannot use vcpu->arch.guest_state_protected because TDX supports
> > debug TD, of which the states are not protected.
> >
> > At least we need another flag, I think.
>
> Let's add .deliver_init to the kvm_x86_ops then.

Will do.
--
Isaku Yamahata <isaku.yamahata@gmail.com>

\
 
 \ /
  Last update: 2022-04-08 05:43    [W:0.319 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site