linux/arch/arm64
Marc Zyngier b321c31c9b KVM: arm64: vgic-v4: Make the doorbell request robust w.r.t preemption
Xiang reports that VMs occasionally fail to boot on GICv4.1 systems when
running a preemptible kernel, as it is possible that a vCPU is blocked
without requesting a doorbell interrupt.

The issue is that any preemption that occurs between vgic_v4_put() and
schedule() on the block path will mark the vPE as nonresident and *not*
request a doorbell irq. This occurs because when the vcpu thread is
resumed on its way to block, vcpu_load() will make the vPE resident
again. Once the vcpu actually blocks, we don't request a doorbell
anymore, and the vcpu won't be woken up on interrupt delivery.

Fix it by tracking that we're entering WFI, and key the doorbell
request on that flag. This allows us not to make the vPE resident
when going through a preempt/schedule cycle, meaning we don't lose
any state.

Cc: stable@vger.kernel.org
Fixes: 8e01d9a396 ("KVM: arm64: vgic-v4: Move the GICv4 residency flow to be driven by vcpu_load/put")
Reported-by: Xiang Chen <chenxiang66@hisilicon.com>
Suggested-by: Zenghui Yu <yuzenghui@huawei.com>
Tested-by: Xiang Chen <chenxiang66@hisilicon.com>
Co-developed-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Acked-by: Zenghui Yu <yuzenghui@huawei.com>
Link: https://lore.kernel.org/r/20230713070657.3873244-1-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
2023-07-13 22:23:34 +00:00
..
boot ARM: New SoC support for 6.5 2023-06-29 15:11:17 -07:00
configs ARM: SoC defconfig changes for 6.5 2023-06-29 15:26:45 -07:00
crypto crypto: arm64/sha256-glue - Include module.h 2023-05-19 20:56:59 +08:00
hyperv arm64/hyperv: Use CPUHP_AP_HYPERV_ONLINE state to fix CPU online sequencing 2023-06-17 23:09:47 +00:00
include KVM: arm64: vgic-v4: Make the doorbell request robust w.r.t preemption 2023-07-13 22:23:34 +00:00
kernel Tracing fixes for 6.5: 2023-07-06 19:07:15 -07:00
kvm KVM: arm64: vgic-v4: Make the doorbell request robust w.r.t preemption 2023-07-13 22:23:34 +00:00
lib arm64: xor-neon: mark xor_arm64_neon_*() static 2023-05-25 17:44:01 +01:00
mm arch/arm64/mm/fault: Fix undeclared variable error in do_page_fault() 2023-07-03 19:04:32 -07:00
net bpf, arm64: Support struct arguments in the BPF trampoline 2023-05-15 21:17:22 +02:00
tools ARM64: 2023-07-03 15:32:22 -07:00
xen
Kbuild
Kconfig ARM64: 2023-07-03 15:32:22 -07:00
Kconfig.debug
Kconfig.platforms STM32 STM32MP25 for v6.5, round 1 2023-06-20 22:28:44 +02:00
Makefile arm64 updates for 6.3: 2023-02-21 15:27:48 -08:00