OSDN Git Service

KVM: arm64: timers: Move the timer IRQs into arch_timer_vm_data
authorMarc Zyngier <maz@kernel.org>
Thu, 30 Mar 2023 17:47:51 +0000 (18:47 +0100)
committerMarc Zyngier <maz@kernel.org>
Thu, 30 Mar 2023 18:01:10 +0000 (19:01 +0100)
commit8a5eb2d210807e7dbe9ece7075533014cf4b9c27
tree00a50fc7113a9b6c3c7fd38a3028376e2a156c2d
parent33c549460ef9119eb115484e81f54521122341db
KVM: arm64: timers: Move the timer IRQs into arch_timer_vm_data

Having the timer IRQs duplicated into each vcpu isn't great, and
becomes absolutely awful with NV. So let's move these into
the per-VM arch_timer_vm_data structure.

This simplifies a lot of code, but requires us to introduce a
mutex so that we can reason about userspace trying to change
an interrupt number while another vcpu is running, something
that wasn't really well handled so far.

Reviewed-by: Colton Lewis <coltonlewis@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230330174800.2677007-12-maz@kernel.org
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/arch_timer.c
arch/arm64/kvm/arm.c
include/kvm/arm_arch_timer.h