From: Paolo Bonzini Date: Sun, 31 Oct 2021 06:28:48 +0000 (-0400) Subject: Merge tag 'kvmarm-5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmar... X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4e3386843325299df13069a1c94e27237b12be51;p=linux.git Merge tag 'kvmarm-5.16' of git://git./linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 updates for Linux 5.16 - More progress on the protected VM front, now with the full fixed feature set as well as the limitation of some hypercalls after initialisation. - Cleanup of the RAZ/WI sysreg handling, which was pointlessly complicated - Fixes for the vgic placement in the IPA space, together with a bunch of selftests - More memcg accounting of the memory allocated on behalf of a guest - Timer and vgic selftests - Workarounds for the Apple M1 broken vgic implementation - KConfig cleanups - New kvmarm.mode=none option, for those who really dislike us --- 4e3386843325299df13069a1c94e27237b12be51 diff --cc arch/arm64/kvm/arm.c index 7838e9fb693ed,24a1e86d7128c..f5490afe1ebfb --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@@ -291,12 -291,22 +291,14 @@@ long kvm_arch_dev_ioctl(struct file *fi struct kvm *kvm_arch_alloc_vm(void) { + size_t sz = sizeof(struct kvm); + if (!has_vhe()) - return kzalloc(sizeof(struct kvm), GFP_KERNEL); + return kzalloc(sz, GFP_KERNEL_ACCOUNT); - return vzalloc(sizeof(struct kvm)); + return __vmalloc(sz, GFP_KERNEL_ACCOUNT | __GFP_HIGHMEM | __GFP_ZERO); } -void kvm_arch_free_vm(struct kvm *kvm) -{ - if (!has_vhe()) - kfree(kvm); - else - vfree(kvm); -} - int kvm_arch_vcpu_precreate(struct kvm *kvm, unsigned int id) { if (irqchip_in_kernel(kvm) && vgic_initialized(kvm)) diff --cc tools/testing/selftests/kvm/Makefile index fd20f271aac01,36ccd2925c8f0..c23e89dea0b66 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@@ -86,8 -85,8 +86,9 @@@ TEST_GEN_PROGS_x86_64 += rseq_tes TEST_GEN_PROGS_x86_64 += set_memory_region_test TEST_GEN_PROGS_x86_64 += steal_time TEST_GEN_PROGS_x86_64 += kvm_binary_stats_test +TEST_GEN_PROGS_x86_64 += system_counter_offset_test + TEST_GEN_PROGS_aarch64 += aarch64/arch_timer TEST_GEN_PROGS_aarch64 += aarch64/debug-exceptions TEST_GEN_PROGS_aarch64 += aarch64/get-reg-list TEST_GEN_PROGS_aarch64 += aarch64/psci_cpu_on_test