aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/include
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2020-03-17 11:11:56 +0000
committerMarc Zyngier <maz@kernel.org>2020-09-29 14:19:38 +0100
commitfd65a3b5f855c37167890d86e261a20bab1a14a4 (patch)
tree89e7b12f26ce872a9b104a5a27dbbac4cb01ddc4 /arch/arm64/include
parent42223fb100b43430daf0c396701cd75b2579ddb7 (diff)
downloadlinux-fd65a3b5f855c37167890d86e261a20bab1a14a4.tar.gz
KVM: arm64: Use event mask matching architecture revision
The PMU code suffers from a small defect where we assume that the event number provided by the guest is always 16 bit wide, even if the CPU only implements the ARMv8.0 architecture. This isn't really problematic in the sense that the event number ends up in a system register, cropping it to the right width, but still this needs fixing. In order to make it work, let's probe the version of the PMU that the guest is going to use. This is done by temporarily creating a kernel event and looking at the PMUVer field that has been saved at probe time in the associated arm_pmu structure. This in turn gets saved in the kvm structure, and subsequently used to compute the event mask that gets used throughout the PMU code. Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r--arch/arm64/include/asm/kvm_host.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
index e52c927aade5..33e0f0a64c42 100644
--- a/arch/arm64/include/asm/kvm_host.h
+++ b/arch/arm64/include/asm/kvm_host.h
@@ -110,6 +110,8 @@ struct kvm_arch {
* supported.
*/
bool return_nisv_io_abort_to_user;
+
+ unsigned int pmuver;
};
struct kvm_vcpu_fault_info {