virt inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ID7MBH ------------------------------------------------------------------------ If an environment has IPIV enabled and a VM also has IPIV enabled, when this VM is migrated to a host environment where IPIV is not enabled, the host will continuously print "vSGI trap! IPIV disabled!" This is because the destination host enabled the VM's IPIV without checking for IPIV support. Fixes: b599aaac9ec7 ("KVM: arm64: fix live migration bug of IPIv") Signed-off-by: Jinqian Yang <yangjinqian1@huawei.com> --- arch/arm64/kvm/vgic/vgic-its.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/vgic/vgic-its.c b/arch/arm64/kvm/vgic/vgic-its.c index f888b099cefc..fdeb22083196 100644 --- a/arch/arm64/kvm/vgic/vgic-its.c +++ b/arch/arm64/kvm/vgic/vgic-its.c @@ -22,6 +22,7 @@ #include "vgic.h" #include "vgic-mmio.h" +#include "hisilicon/hisi_virt.h" static int vgic_its_save_tables_v0(struct vgic_its *its); static int vgic_its_restore_tables_v0(struct vgic_its *its); @@ -563,7 +564,8 @@ static int vgic_mmio_uaccess_write_its_iidr(struct kvm *kvm, return -EINVAL; #ifdef CONFIG_ARM64_HISI_IPIV - if (val & (1UL << HISI_GUEST_ENABLE_IPIV_SHIFT)) + if (hisi_ipiv_supported_per_vm(kvm) && + val & (1UL << HISI_GUEST_ENABLE_IPIV_SHIFT)) kvm->arch.vgic.its_vm.enable_ipiv_from_guest = true; #endif -- 2.33.0