From: Jason Wang <jasowang@xxxxxxxxxx> We used to have PV version of send_IPI_mask and send_IPI_mask_allbutself. This patch implements PV send_IPI method to reduce the number of vmexits. Signed-off-by: Jason Wang <jasowang@xxxxxxxxxx> Tested-by: Cindy Lu <lulu@xxxxxxxxxx> --- arch/x86/kernel/kvm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 921c1c783bc1..b920cfd10441 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -557,6 +557,11 @@ static void __send_ipi_mask(const struct cpumask *mask, int vector) local_irq_restore(flags); } +static void kvm_send_ipi(int cpu, int vector) +{ + __send_ipi_mask(cpumask_of(cpu), vector); +} + static void kvm_send_ipi_mask(const struct cpumask *mask, int vector) { __send_ipi_mask(mask, vector); @@ -628,6 +633,7 @@ late_initcall(setup_efi_kvm_sev_migration); */ static __init void kvm_setup_pv_ipi(void) { + apic_update_callback(send_IPI, kvm_send_ipi); apic_update_callback(send_IPI_mask, kvm_send_ipi_mask); apic_update_callback(send_IPI_mask_allbutself, kvm_send_ipi_mask_allbutself); pr_info("setup PV IPIs\n"); -- 2.45.0