]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: arm64: Treat CTR_EL0 as a VM feature ID register
authorSebastian Ott <sebott@redhat.com>
Wed, 19 Jun 2024 17:40:33 +0000 (17:40 +0000)
committerOliver Upton <oliver.upton@linux.dev>
Thu, 20 Jun 2024 17:16:44 +0000 (17:16 +0000)
commit2843cae26644fbc922e93c7c4c279f70fb3275f1
tree8cdf0e2cbcfdcd0cda255ed25df5838b8783dced
parentf1ff3fc5209a1d63a4018bdb4231fbb073063c9a
KVM: arm64: Treat CTR_EL0 as a VM feature ID register

CTR_EL0 is currently handled as an invariant register, thus
guests will be presented with the host value of that register.

Add emulation for CTR_EL0 based on a per VM value. Userspace can
switch off DIC and IDC bits and reduce DminLine and IminLine sizes.
Naturally, ensure CTR_EL0 is trapped (HCR_EL2.TID2=1) any time that a
VM's CTR_EL0 differs from hardware.

Signed-off-by: Sebastian Ott <sebott@redhat.com>
Reviewed-by: Shaoqin Huang <shahuang@redhat.com>
Link: https://lore.kernel.org/r/20240619174036.483943-8-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/sys_regs.c