lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <MWHPR11MB1968E398CFFACE3B2D95A760E3100@MWHPR11MB1968.namprd11.prod.outlook.com>
Date:   Mon, 2 Nov 2020 05:42:07 +0000
From:   "Qi, Yadong" <yadong.qi@...el.com>
To:     Paolo Bonzini <pbonzini@...hat.com>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "x86@...nel.org" <x86@...nel.org>
CC:     "Christopherson, Sean J" <sean.j.christopherson@...el.com>,
        "vkuznets@...hat.com" <vkuznets@...hat.com>,
        "wanpengli@...cent.com" <wanpengli@...cent.com>,
        "jmattson@...gle.com" <jmattson@...gle.com>,
        "joro@...tes.org" <joro@...tes.org>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "bp@...en8.de" <bp@...en8.de>, "hpa@...or.com" <hpa@...or.com>,
        "liran.alon@...cle.com" <liran.alon@...cle.com>,
        "nikita.leshchenko@...cle.com" <nikita.leshchenko@...cle.com>,
        "Gao, Chao" <chao.gao@...el.com>,
        "Tian, Kevin" <kevin.tian@...el.com>,
        "Chen, Luhai" <luhai.chen@...el.com>,
        "Zhu, Bing" <bing.zhu@...el.com>,
        "Wang, Kai Z" <kai.z.wang@...el.com>
Subject: RE: [PATCH] KVM: x86: emulate wait-for-SIPI and SIPI-VMExit


> -----Original Message-----
> From: Paolo Bonzini <pbonzini@...hat.com>
> Sent: Tuesday, September 22, 2020 5:10 PM
> To: Qi, Yadong <yadong.qi@...el.com>; kvm@...r.kernel.org; linux-
> kernel@...r.kernel.org; x86@...nel.org
> Cc: Christopherson, Sean J <sean.j.christopherson@...el.com>;
> vkuznets@...hat.com; wanpengli@...cent.com; jmattson@...gle.com;
> joro@...tes.org; tglx@...utronix.de; mingo@...hat.com; bp@...en8.de;
> hpa@...or.com; liran.alon@...cle.com; nikita.leshchenko@...cle.com; Gao,
> Chao <chao.gao@...el.com>; Tian, Kevin <kevin.tian@...el.com>; Chen, Luhai
> <luhai.chen@...el.com>; Zhu, Bing <bing.zhu@...el.com>; Wang, Kai Z
> <kai.z.wang@...el.com>
> Subject: Re: [PATCH] KVM: x86: emulate wait-for-SIPI and SIPI-VMExit
> 
> On 22/09/20 07:23, yadong.qi@...el.com wrote:
> > From: Yadong Qi <yadong.qi@...el.com>
> >
> > Background: We have a lightweight HV, it needs INIT-VMExit and
> > SIPI-VMExit to wake-up APs for guests since it do not monitor the
> > Local APIC. But currently virtual wait-for-SIPI(WFS) state is not
> > supported in nVMX, so when running on top of KVM, the L1 HV cannot
> > receive the INIT-VMExit and SIPI-VMExit which cause the L2 guest
> > cannot wake up the APs.
> >
> > According to Intel SDM Chapter 25.2 Other Causes of VM Exits, SIPIs
> > cause VM exits when a logical processor is in wait-for-SIPI state.
> >
> > In this patch:
> >     1. introduce SIPI exit reason,
> >     2. introduce wait-for-SIPI state for nVMX,
> >     3. advertise wait-for-SIPI support to guest.
> >
> > When L1 hypervisor is not monitoring Local APIC, L0 need to emulate
> > INIT-VMExit and SIPI-VMExit to L1 to emulate INIT-SIPI-SIPI for L2. L2
> > LAPIC write would be traped by L0 Hypervisor(KVM), L0 should emulate
> > the INIT/SIPI vmexit to L1 hypervisor to set proper state for L2's
> > vcpu state.
> >
> > Handle procdure:
> > Source vCPU:
> >     L2 write LAPIC.ICR(INIT).
> >     L0 trap LAPIC.ICR write(INIT): inject a latched INIT event to target
> >        vCPU.
> > Target vCPU:
> >     L0 emulate an INIT VMExit to L1 if is guest mode.
> >     L1 set guest VMCS, guest_activity_state=WAIT_SIPI, vmresume.
> >     L0 set vcpu.mp_state to INIT_RECEIVED if (vmcs12.guest_activity_state
> >        == WAIT_SIPI).
> >
> > Source vCPU:
> >     L2 write LAPIC.ICR(SIPI).
> >     L0 trap LAPIC.ICR write(INIT): inject a latched SIPI event to traget
> >        vCPU.
> > Target vCPU:
> >     L0 emulate an SIPI VMExit to L1 if (vcpu.mp_state == INIT_RECEIVED).
> >     L1 set CS:IP, guest_activity_state=ACTIVE, vmresume.
> >     L0 resume to L2.
> >     L2 start-up.
> 
> Again, this looks good but it needs testcases.
> 

Hi, Paolo

I saw you queued the testcase patch: https://patchwork.kernel.org/project/kvm/patch/20201013052845.249113-1-yadong.qi@intel.com/
Will you also queue this patch? Or there are some additional comments of this patch? 

Best Regard
Yadong


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ