[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220408034058.GG2864606@ls.amr.corp.intel.com>
Date: Thu, 7 Apr 2022 20:40:58 -0700
From: Isaku Yamahata <isaku.yamahata@...il.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: Xiaoyao Li <xiaoyao.li@...el.com>, isaku.yamahata@...el.com,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
isaku.yamahata@...il.com, Jim Mattson <jmattson@...gle.com>,
erdemaktas@...gle.com, Connor Kuehl <ckuehl@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Tom Lendacky <thomas.lendacky@....com>
Subject: Re: [RFC PATCH v5 101/104] KVM: TDX: Silently ignore INIT/SIPI
On Thu, Apr 07, 2022 at 02:12:28PM +0200,
Paolo Bonzini <pbonzini@...hat.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@...el.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@...il.com>
Powered by blists - more mailing lists