aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/lib/aarch64/processor.c
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2021-12-27 12:48:08 +0000
committerMarc Zyngier <maz@kernel.org>2021-12-28 11:04:20 +0000
commite7f58a6bd28bfd2e4f60312abf48f07de2c4121c (patch)
tree81865fb3a2992cd1e1435ed830152afd2ff22b73 /tools/testing/selftests/kvm/lib/aarch64/processor.c
parentKVM: selftests: arm64: Rework TCR_EL1 configuration (diff)
downloadlinux-dev-e7f58a6bd28bfd2e4f60312abf48f07de2c4121c.tar.xz
linux-dev-e7f58a6bd28bfd2e4f60312abf48f07de2c4121c.zip
KVM: selftests: arm64: Add support for VM_MODE_P36V48_{4K,64K}
Some of the arm64 systems out there have an IPA space that is positively tiny. Nonetheless, they make great KVM hosts. Add support for 36bit IPA support with 4kB pages, which makes some of the fruity machines happy. Whilst we're at it, add support for 64kB pages as well, though these boxes have no support for it. Reviewed-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20211227124809.1335409-6-maz@kernel.org
Diffstat (limited to 'tools/testing/selftests/kvm/lib/aarch64/processor.c')
-rw-r--r--tools/testing/selftests/kvm/lib/aarch64/processor.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/lib/aarch64/processor.c b/tools/testing/selftests/kvm/lib/aarch64/processor.c
index d005543aa3e2..70395c777ea4 100644
--- a/tools/testing/selftests/kvm/lib/aarch64/processor.c
+++ b/tools/testing/selftests/kvm/lib/aarch64/processor.c
@@ -249,10 +249,12 @@ void aarch64_vcpu_setup(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_vcpu_init
case VM_MODE_P52V48_64K:
case VM_MODE_P48V48_64K:
case VM_MODE_P40V48_64K:
+ case VM_MODE_P36V48_64K:
tcr_el1 |= 1ul << 14; /* TG0 = 64KB */
break;
case VM_MODE_P48V48_4K:
case VM_MODE_P40V48_4K:
+ case VM_MODE_P36V48_4K:
tcr_el1 |= 0ul << 14; /* TG0 = 4KB */
break;
default:
@@ -272,6 +274,10 @@ void aarch64_vcpu_setup(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_vcpu_init
case VM_MODE_P40V48_64K:
tcr_el1 |= 2ul << 32; /* IPS = 40 bits */
break;
+ case VM_MODE_P36V48_4K:
+ case VM_MODE_P36V48_64K:
+ tcr_el1 |= 1ul << 32; /* IPS = 36 bits */
+ break;
default:
TEST_FAIL("Unknown guest mode, mode: 0x%x", vm->mode);
}