On Sat, 5 Sep 2020 at 20:22, 邓桥 <dengqiao.joey@xxxxxxxxxxxxx> wrote: > > This patch paravirtualize the IPI sending process in guest by exposing > posted interrupt capability to guest directly . Since there is no VM Exit > and VM Entry when sending IPI, the overhead is therefore reduced. > > The basic idea is that: > Exposing the PI_DESC and msr.icr to guest. When sending a IPI, set > the PIR of destination VCPU’s PI_DESC from guest directly and write > the ICR with notification vector and destination PCPU which are got > from hypervisor. > > This mechanism only handle the normal IPI. For SIPI/NMI/INIT, still > goes to legacy way but which write a new msr instead msr.icr. > > The cost is reduced from 7k cycles to 2k cycles, which is 1500 cycles > on the host. > > However it may increase the risk in the system since the guest could > decide to send IPI to any processor. > > This patch is based on Linux-5.0 and we can rebase it on latest tree if the idea > is accepted. We will introduce this idea at KVM Forum 2020. Hmm, this idea is not new, https://dl.acm.org/doi/abs/10.1145/3381052.3381317 Anyway, it is more suitable to be played in the private cloud for my security concern. Wanpeng