[PATCH v3 0/3] Fine grain sysregs allowed to trap for nested virtualization

From: Miguel Luis
Date: Wed Oct 11 2023 - 14:02:24 EST


The current HCR_EL2 description defines ranges of system register encodings in
which accesses should trap for NV. These ranges include encodings which aren't
defined in the reference manual. In order avoid this, let's rather implement a
more fine grained approach excluding those undefined.

Changes v2 -> v3
patch 1:
Fix BRBCR_EL12. (Eric)
Add Eric's R-b. Thanks!
patch 2:
New patch to add missing _EL2 encodings for patch 3.
patch 3:
Previously patch 2 in v2.
Add Fixes tag. (Eric)
Merge contiguous ranges and exclude undefined encodings. (Eric)

v1 -> v2
patch 1:
fix indentation
patch 2:
improve commit message (Marc)
fix indentation (Marc)
follow kernel comment format (Marc)
describe LRs in ranges (Marc)
include AMEVCNTVOFF0<n>_EL2 and AMEVCNTVOFF1<n>_EL2
patch 3:
drop. Excluded IMPDEF range is trapped by HCR_EL2.TIDCP

v2: https://lore.kernel.org/kvmarm/20230925162057.27548-1-miguel.luis@xxxxxxxxxx/
v1: https://lore.kernel.org/kvmarm/20230913185209.32282-1-miguel.luis@xxxxxxxxxx/

Miguel Luis (3):
arm64: Add missing _EL12 encodings
arm64: Add missing _EL2 encodings
arm64/kvm: Fine grain _EL2 system registers list that affect nested
virtualization

arch/arm64/include/asm/sysreg.h | 48 ++++++++++++++++++
arch/arm64/kvm/emulate-nested.c | 88 ++++++++++++++++++++++++++++++---
2 files changed, 130 insertions(+), 6 deletions(-)

--
2.39.2