linux/arch/arm64/kvm
Reiji Watanabe ea9ca904d2 KVM: arm64: PMU: Allow userspace to limit PMCR_EL0.N for the guest
KVM does not yet support userspace modifying PMCR_EL0.N (With
the previous patch, KVM ignores what is written by userspace).
Add support userspace limiting PMCR_EL0.N.

Disallow userspace to set PMCR_EL0.N to a value that is greater
than the host value as KVM doesn't support more event counters
than what the host HW implements. Also, make this register
immutable after the VM has started running. To maintain the
existing expectations, instead of returning an error, KVM
returns a success for these two cases.

Finally, ignore writes to read-only bits that are cleared on
vCPU reset, and RES{0,1} bits (including writable bits that
KVM doesn't support yet), as those bits shouldn't be modified
(at least with the current KVM).

Co-developed-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Raghavendra Rao Ananta <rananta@google.com>
Link: https://lore.kernel.org/r/20231020214053.2144305-8-rananta@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
2023-10-24 22:59:30 +00:00
..
hyp KVM: arm64: nvhe: Ignore SVE hint in SMCCC function ID 2023-09-12 13:07:37 +01:00
vgic KVM: arm64: Remove unused declarations 2023-08-15 20:27:32 +01:00
.gitignore
arch_timer.c KVM: arm64: timers: Use CNTHCTL_EL2 when setting non-CNTKCTL_EL1 bits 2023-07-11 19:28:30 +00:00
arm.c KVM: arm64: Sanitize PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR} before first run 2023-10-24 22:59:30 +00:00
debug.c arm64/sysreg: Rename TRBIDR_EL1 fields per auto-gen tools format 2023-06-14 14:37:33 +01:00
emulate-nested.c KVM: arm64: nv: Add trap description for SPSR_EL2 and ELR_EL2 2023-08-23 20:03:25 +01:00
fpsimd.c KVM: arm64: Rework CPTR_EL2 programming for HVHE configuration 2023-06-12 23:17:24 +00:00
guest.c KVM: arm64: Always return generic v8 as the preferred target 2023-07-11 09:40:52 +01:00
handle_exit.c KVM: arm64: nv: Expand ERET trap forwarding to handle FGT 2023-08-17 10:00:27 +01:00
hypercalls.c s390: 2023-05-01 12:06:20 -07:00
inject_fault.c KVM: arm64: Fix repeated words in comments 2023-04-21 13:46:04 +01:00
Kconfig Merge branch kvm-arm64/tlbi-range into kvmarm-master/next 2023-08-28 09:29:02 +01:00
Makefile KVM: arm64: nv: Filter out unsupported features from ID regs 2023-02-11 10:13:30 +00:00
mmio.c KVM: arm64: Generalise VM features into a set of flags 2022-03-18 14:02:33 +00:00
mmu.c KVM: arm64: Properly return allocated EL2 VA from hyp_alloc_private_va_range() 2023-09-12 12:58:25 +01:00
nested.c KVM: arm64: nv: Add support for HCRX_EL2 2023-08-17 10:00:28 +01:00
pkvm.c KVM: arm64: Handle kvm_arm_init failure correctly in finalize_pkvm 2023-07-11 19:30:14 +00:00
pmu-emul.c KVM: arm64: Sanitize PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR} before first run 2023-10-24 22:59:30 +00:00
pmu.c KVM: arm64: pmu: Resync EL0 state on counter rotation 2023-08-22 13:35:51 +01:00
psci.c Merge branch kvm-arm64/smccc-filtering into kvmarm-master/next 2023-04-21 09:44:32 +01:00
pvtime.c KVM: MMU: Make the definition of 'INVALID_GPA' common 2023-01-19 21:48:38 +00:00
reset.c KVM: arm64: Delete pointless switch statement in kvm_reset_vcpu() 2023-07-11 09:40:52 +01:00
stacktrace.c arm64: stacktrace: track hyp stacks in unwinder's address space 2022-09-09 12:30:08 +01:00
sys_regs.c KVM: arm64: PMU: Allow userspace to limit PMCR_EL0.N for the guest 2023-10-24 22:59:30 +00:00
sys_regs.h KVM: arm64: Save ID registers' sanitized value per guest 2023-06-15 12:55:08 +00:00
trace_arm.h KVM: arm64: nv: Add trap forwarding infrastructure 2023-08-17 10:00:27 +01:00
trace_handle_exit.h
trace.h
trng.c
va_layout.c arm64: alternatives: kvm: prepare for cap changes 2022-09-16 17:15:02 +01:00
vgic-sys-reg-v3.c KVM: arm64: vgic-v3: Convert userspace accessors over to FIELD_GET/FIELD_PREP 2022-07-17 11:55:33 +01:00
vmid.c KVM: arm64: Use the bitmap API to allocate bitmaps 2023-04-20 09:10:28 +01:00