kernel_optimize_test/arch/arm64/kvm
Marc Zyngier d74d7865e2 KVM: arm64: Don't read a HW interrupt pending state in user context
commit 2cdea19a34c2340b3aa69508804efe4e3750fcec upstream.

Since 5bfa685e62e9 ("KVM: arm64: vgic: Read HW interrupt pending state
from the HW"), we're able to source the pending bit for an interrupt
that is stored either on the physical distributor or on a device.

However, this state is only available when the vcpu is loaded,
and is not intended to be accessed from userspace. Unfortunately,
the GICv2 emulation doesn't provide specific userspace accessors,
and we fallback with the ones that are intended for the guest,
with fatal consequences.

Add a new vgic_uaccess_read_pending() accessor for userspace
to use, build on top of the existing vgic_mmio_read_pending().

Reported-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Fixes: 5bfa685e62e9 ("KVM: arm64: vgic: Read HW interrupt pending state from the HW")
Link: https://lore.kernel.org/r/20220607131427.1164881-2-maz@kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-22 14:13:19 +02:00
..
hyp arm64: kvm: Fix copy-and-paste error in bhb templates for v5.10 stable 2022-03-19 13:44:46 +01:00
vgic KVM: arm64: Don't read a HW interrupt pending state in user context 2022-06-22 14:13:19 +02:00
aarch32.c KVM: arm64: Synchronize sysreg state on injecting an AArch32 exception 2020-06-10 16:04:08 +01:00
arch_timer.c KVM: arm64: timers: Move timer registers to the sys_regs file 2020-07-07 09:28:38 +01:00
arm.c KVM: arm64: Allow indirect vectors to be used without SPECTRE_V3A 2022-03-11 12:11:53 +01:00
debug.c KVM: arm64: Initialize VCPU mdcr_el2 before loading it 2021-05-14 09:50:33 +02:00
fpsimd.c KVM: arm64: Make struct kvm_regs userspace-only 2020-07-07 09:28:38 +01:00
guest.c KVM: arm64: Move SPSR_EL1 to the system register array 2020-07-07 09:28:38 +01:00
handle_exit.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
hypercalls.c KVM: arm64: Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated 2022-03-11 12:11:53 +01:00
inject_fault.c KVM: arm64: Fix inject_fault.c kernel-doc warnings 2020-09-18 16:17:22 +01:00
irq.h
Kconfig KVM: arm64: Replace CONFIG_KVM_INDIRECT_VECTORS with CONFIG_RANDOMIZE_BASE 2020-09-29 16:08:15 +01:00
Makefile KVM: arm64: nVHE: Migrate hyp-init to SMCCC 2020-09-15 18:39:04 +01:00
mmio.c KVM/arm64 updates for Linux 5.9: 2020-08-09 12:58:23 -04:00
mmu.c KVM: arm64: Fix exclusive limit for IPA size 2021-03-17 17:06:36 +01:00
perf.c KVM: arm64: Move virt/kvm/arm to arch/arm64 2020-05-16 15:03:59 +01:00
pmu-emul.c KVM: arm64: Don't zero the cycle count register when PMCR_EL0.P is set 2021-07-14 16:56:08 +02:00
pmu.c kvm: arm64: Set up hyp percpu data for nVHE 2020-09-30 08:37:14 +01:00
psci.c KVM: arm64: Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated 2022-03-11 12:11:53 +01:00
pvtime.c arm64/x86: KVM: Introduce steal-time cap 2020-08-21 14:05:19 +01:00
regmap.c KVM: arm64: Move SPSR_EL1 to the system register array 2020-07-07 09:28:38 +01:00
reset.c KVM: arm64: Fix read-side race on updates to vcpu reset state 2021-09-22 12:28:03 +02:00
sys_regs.c arm64: add ID_AA64ISAR2_EL1 sys register 2022-03-11 12:11:51 +01:00
sys_regs.h KVM: arm64: Check RAZ visibility in ID register accessors 2020-11-06 16:00:29 +00:00
trace_arm.h KVM: arm64: Fix address truncation in traces 2020-09-04 10:53:48 +01:00
trace_handle_exit.h KVM: arm64: Fix address truncation in traces 2020-09-04 10:53:48 +01:00
trace.h KVM: arm64: Move virt/kvm/arm to arch/arm64 2020-05-16 15:03:59 +01:00
va_layout.c KVM: arm64: Make nVHE ASLR conditional on RANDOMIZE_BASE 2020-07-28 10:41:11 +01:00
vgic-sys-reg-v3.c KVM: arm64: Move virt/kvm/arm to arch/arm64 2020-05-16 15:03:59 +01:00