diff options
author | Bibo Mao <maobibo@loongson.cn> | 2024-05-06 17:00:47 +0300 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2024-05-06 17:00:47 +0300 |
commit | e33bda7ee50c3c20d80f5ca6dc5ca2cd37863518 (patch) | |
tree | 20725db700c1e1bacaba03bfa564650ac5baca85 /arch/loongarch/include/asm/loongarch.h | |
parent | 73516e9da512adc63ba3859fbd82a21f6257348f (diff) | |
download | linux-e33bda7ee50c3c20d80f5ca6dc5ca2cd37863518.tar.xz |
LoongArch: KVM: Add PV IPI support on host side
On LoongArch system, IPI hw uses iocsr registers. There are one iocsr
register access on IPI sending, and two iocsr access on IPI receiving
for the IPI interrupt handler. In VM mode all iocsr accessing will cause
VM to trap into hypervisor. So with one IPI hw notification there will
be three times of trap.
In this patch PV IPI is added for VM, hypercall instruction is used for
IPI sender, and hypervisor will inject an SWI to the destination vcpu.
During the SWI interrupt handler, only CSR.ESTAT register is written to
clear irq. CSR.ESTAT register access will not trap into hypervisor, so
with PV IPI supported, there is one trap with IPI sender, and no trap
with IPI receiver, there is only one trap with IPI notification.
Also this patch adds IPI multicast support, the method is similar with
x86. With IPI multicast support, IPI notification can be sent to at
most 128 vcpus at one time. It greatly reduces the times of trapping
into hypervisor.
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/include/asm/loongarch.h')
-rw-r--r-- | arch/loongarch/include/asm/loongarch.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/loongarch/include/asm/loongarch.h b/arch/loongarch/include/asm/loongarch.h index dad6286d7738..eb09adda54b7 100644 --- a/arch/loongarch/include/asm/loongarch.h +++ b/arch/loongarch/include/asm/loongarch.h @@ -168,6 +168,7 @@ #define CPUCFG_KVM_SIG (CPUCFG_KVM_BASE + 0) #define KVM_SIGNATURE "KVM\0" #define CPUCFG_KVM_FEATURE (CPUCFG_KVM_BASE + 4) +#define KVM_FEATURE_IPI BIT(1) #ifndef __ASSEMBLY__ |