From: Oliver Upton <oliver.upton@linux.dev>
To: kvmarm@lists.linux.dev
Cc: Marc Zyngier <maz@kernel.org>, Joey Gouly <joey.gouly@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Sebastian Ott <sebott@redhat.com>,
Oliver Upton <oliver.upton@linux.dev>
Subject: [PATCH v4 0/5] KVM: arm64: Writable MIDR/REVIDR (and associated baggage)
Date: Mon, 24 Feb 2025 16:53:56 -0800 [thread overview]
Message-ID: <20250225005401.679536-1-oliver.upton@linux.dev> (raw)
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/20250218163443.32836-1-sebott@redhat.com/
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
--
2.39.5
next reply other threads:[~2025-02-25 0:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 0:53 Oliver Upton [this message]
2025-02-25 0:53 ` [PATCH v4 1/5] KVM: arm64: Set HCR_EL2.TID1 unconditionally Oliver Upton
2025-02-25 11:09 ` Marc Zyngier
2025-02-25 0:53 ` [PATCH v4 2/5] KVM: arm64: Maintain per-VM copy of implementation ID regs Oliver Upton
2025-02-25 0:53 ` [PATCH v4 3/5] KVM: arm64: Load VPIDR_EL2 with the VM's MIDR_EL1 value Oliver Upton
2025-02-25 0:54 ` [PATCH v4 4/5] KVM: arm64: Allow userspace to change the implementation ID registers Oliver Upton
2025-02-25 11:19 ` Marc Zyngier
2025-02-25 0:54 ` [PATCH v4 5/5] KVM: selftests: arm64: Test writes to MIDR,REVIDR,AIDR Oliver Upton
2025-02-27 20:39 ` Mark Brown
2025-02-28 9:47 ` Sebastian Ott
2025-02-28 13:21 ` Sebastian Ott
2025-02-25 13:54 ` [PATCH v4 0/5] KVM: arm64: Writable MIDR/REVIDR (and associated baggage) Marc Zyngier
2025-02-26 9:49 ` Oliver Upton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250225005401.679536-1-oliver.upton@linux.dev \
--to=oliver.upton@linux.dev \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=sebott@redhat.com \
--cc=suzuki.poulose@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox