KVM: arm64: vcpu sysreg accessor rework
Status from this message: Applied to fixes, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest4 patches 11 repliesApplied
- v1 RFC4 patches 0 repliesSuperseded
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | KVM: arm64: Add assignment-specific sysreg accessorarch/ arch/ arch/ +9 more | +86 | 3 replies | |
| 2/4 | KVM: arm64: Add RMW specific sysreg accessorarch/ arch/ arch/ +3 more | +31 | 0 replies | |
| 3/4 | KVM: arm64: Don't use __vcpu_sys_reg() to get the address of a sysregarch/ arch/ | +3 | 0 replies | |
| 4/4 | KVM: arm64: Make __vcpu_sys_reg() a pure rvalue operandarch/ | +5 | 0 replies |
Reviews trailers per patch
None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Oliver Upton | Miguel Luis |
|---|---|---|
| Series | R-b | R-b |
| 1/4 | ||
| 2/4 | ||
| 3/4 | ||
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/4] KVM: arm64: vcpu sysreg accessor rework
This series tries to bring some sanity to the way the RESx masks are applied when accessing the in-memory view of the guest's system registers.
Currently, we have *one* accessor (__vcpu_sys_reg()) that can either be used as a rvalue or lvalue while that applies the RESx masks behind the scenes. This works fine when used as a rvalue.
However, when used as a lvalue, it does the wrong thing, as it only sanitises the value we're about to overwrite. This is pointless work and potentially hides bugs.
I propose that we move to a set of store-specific accessors (for assignments and RMW) instead of the lvalue hack, ensuring that the assigned value is the one that gets sanitised. This then allows the legacy accessor to be converted to rvalue-only.
Given the level of churn this introduces, I'd like this to land very early in the cycle. Either before 6.16-rc2, or early in 6.17.
* From v1 [1]
- rebased to kvmarm-fixes-6.16-1
[1] https://lore.kernel.org/all/[email protected]/
Marc Zyngier (4):
KVM: arm64: Add assignment-specific sysreg accessor
KVM: arm64: Add RMW specific sysreg accessor
KVM: arm64: Don't use __vcpu_sys_reg() to get the address of a sysreg
KVM: arm64: Make __vcpu_sys_reg() a pure rvalue operand
arch/arm64/include/asm/kvm_host.h | 31 +++++++++-- arch/arm64/kvm/arch_timer.c | 18 +++---- arch/arm64/kvm/debug.c | 4 +- arch/arm64/kvm/fpsimd.c | 4 +- arch/arm64/kvm/hyp/exception.c | 4 +- arch/arm64/kvm/hyp/include/hyp/switch.h | 4 +- arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h | 6 +-- arch/arm64/kvm/hyp/nvhe/hyp-main.c | 4 +- arch/arm64/kvm/hyp/vhe/switch.c | 4 +- arch/arm64/kvm/hyp/vhe/sysreg-sr.c | 48 ++++++++--------- arch/arm64/kvm/nested.c | 2 +- arch/arm64/kvm/pmu-emul.c | 24 ++++----- arch/arm64/kvm/sys_regs.c | 60 +++++++++++----------- arch/arm64/kvm/sys_regs.h | 4 +- arch/arm64/kvm/vgic/vgic-v3-nested.c | 10 ++-- 15 files changed, 125 insertions(+), 102 deletions(-)
Signature · 1 line
2.39.2