Skip to content

KVM: arm64: Writable MIDR/REVIDR (and associated baggage)

Oliver Upton kvmarm stable 1 version Applied

Status from this message: Applied to next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest5 patches 7 repliesApplied

Changes in v4 from the cover letter

- Trap SMIDR_EL1 accesses so they actually UNDEF
- Snapshot MIDR, REVIDR, and AIDR from the boot CPU
- Require buy-in from userspace to make ID registers writable

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/5KVM: arm64: Set HCR_EL2.TID1 unconditionallyarch/arm64/include/asm/kvm_arm.h arch/arm64/kvm/sys_regs.c+94 -851 reply
2/5KVM: arm64: Maintain per-VM copy of implementation ID regsarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/sys_regs.c+31 -210 replies
3/5KVM: arm64: Load VPIDR_EL2 with the VM's MIDR_EL1 valuearch/arm64/kvm/hyp/include/hyp/sysreg-sr.h arch/arm64/kvm/hyp/nvhe/sysreg-sr.c arch/arm64/kvm/hyp/vhe/sysreg-sr.c+20 -200 replies
4/5KVM: arm64: Allow userspace to change the implementation ID registersDocumentation/virt/kvm/api.rst arch/arm64/include/asm/kvm_host.h arch/arm64/kvm/arm.c +3 more+77 -61 reply
5/5KVM: selftests: arm64: Test writes to MIDR,REVIDR,AIDRtools/testing/selftests/kvm/arm64/set_id_regs.c+30 -73 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/5] KVM: arm64: Writable MIDR/REVIDR (and associated baggage)

This is hopefully the last take on the writable MIDR/REVIDR/AIDR series.

I've restructured things in order to work around the existing shortcomings, have a stable-worthy backport for SMIDR_EL1, and avoid breaking ABI.

I personally hate using a capability for this, but given the subtlety of the issue (and our habit of breaking save/restore) it is probably best to put userspace in the driver's seat.

v3: https://lore.kernel.org/kvmarm/[email protected]/

v3 -> v4:
- Trap SMIDR_EL1 accesses so they actually UNDEF
- Snapshot MIDR, REVIDR, and AIDR from the boot CPU
- Require buy-in from userspace to make ID registers writable

Oliver Upton (2):
KVM: arm64: Set HCR_EL2.TID1 unconditionally
KVM: arm64: Load VPIDR_EL2 with the VM's MIDR_EL1 value

Sebastian Ott (3):
KVM: arm64: Maintain per-VM copy of implementation ID regs
KVM: arm64: Allow userspace to change the implementation ID registers
KVM: selftests: arm64: Test writes to MIDR,REVIDR,AIDR

 Documentation/virt/kvm/api.rst                |  18 ++
 arch/arm64/include/asm/kvm_arm.h              |   4 +-
 arch/arm64/include/asm/kvm_host.h             |  11 +
 arch/arm64/kvm/arm.c                          |   9 +
 arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h    |  14 +-
 arch/arm64/kvm/hyp/nvhe/sysreg-sr.c           |   4 +-
 arch/arm64/kvm/hyp/vhe/sysreg-sr.c            |  28 +--
 arch/arm64/kvm/sys_regs.c                     | 219 +++++++++++-------
 include/uapi/linux/kvm.h                      |   1 +
 .../testing/selftests/kvm/arm64/set_id_regs.c |  37 ++-
 10 files changed, 229 insertions(+), 116 deletions(-)

base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b

Signature · 1 line
2.39.5