Patch "arm/arm64: KVM: Introduce stage2_unmap_vm" has been added to the 3.14-stable tree
Subsystems (4)
This is a note to let you know that I've just added the patch titled
arm/arm64: KVM: Introduce stage2_unmap_vm
to the 3.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
arm-arm64-kvm-introduce-stage2_unmap_vm.patch
and it can be found in the queue-3.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
957db105c99792ae8ef61ffc9ae77d910f6471daMon Sep 17 00:00:00 2001
From: Christoffer Dall <[email protected]>
Date: Thu, 27 Nov 2014 10:35:03 +0100
Subject: arm/arm64: KVM: Introduce stage2_unmap_vm
From: Christoffer Dall <[email protected]>
commit 957db105c99792ae8ef61ffc9ae77d910f6471da upstream.
Introduce a new function to unmap user RAM regions in the stage2 page tables. This is needed on reboot (or when the guest turns off the MMU) to ensure we fault in pages again and make the dcache, RAM, and icache coherent.
Using unmap_stage2_range for the whole guest physical range does not work, because that unmaps IO regions (such as the GIC) which will not be recreated or in the best case faulted in on a page-by-page basis.
Call this function on secondary and subsequent calls to the KVM_ARM_VCPU_INIT ioctl so that a reset VCPU will detect the guest Stage-1 MMU is off when faulting in pages and make the caches coherent.
--- arch/arm/include/asm/kvm_mmu.h | 1 arch/arm/kvm/arm.c | 7 ++++ arch/arm/kvm/mmu.c | 65 +++++++++++++++++++++++++++++++++++++++ arch/arm64/include/asm/kvm_mmu.h | 1 4 files changed, 74 insertions(+)
arch/arm/include/asm/kvm_mmu.h +1 -0
@@ -47,6 +47,7 @@ int create_hyp_io_mappings(void *from, vvoid free_boot_hyp_pgd (void );void free_hyp_pgds (void ); +void stage2_unmap_vm (struct kvm *kvm);int kvm_alloc_stage2_pgd (struct kvm *kvm);void kvm_free_stage2_pgd (struct kvm *kvm); int kvm_phys_addr_ioremap(struct kvm *kvm, phys_addr_t guest_ipa,
arch/arm/kvm/arm.c +7 -0
@@ -675,6 +675,13 @@ static int kvm_arch_vcpu_ioctl_vcpu_initif (ret)return ret; +/* +* Ensure a rebooted VM will fault in RAM pages and detect if the +* guest MMU is turned off and flush the caches as needed. +*/ +if (vcpu->arch.has_run_once) +stage2_unmap_vm (vcpu->kvm); +vcpu_reset_hcr (vcpu);/*
arch/arm/kvm/mmu.c +65 -0
71 lines not on this page · raw message
arch/arm64/include/asm/kvm_mmu.h +1 -0
@@ -74,6 +74,7 @@ int create_hyp_io_mappings(void *from, vvoid free_boot_hyp_pgd (void );void free_hyp_pgds (void ); +void stage2_unmap_vm (struct kvm *kvm);int kvm_alloc_stage2_pgd (struct kvm *kvm);void kvm_free_stage2_pgd (struct kvm *kvm); int kvm_phys_addr_ioremap(struct kvm *kvm, phys_addr_t guest_ipa,
Patches currently in stable-queue which might be from [email protected] are
queue-3.14/arm-arm64-kvm-ensure-memslots-are-within-kvm_phys_size.patch queue-3.14/arm-arm64-kvm-don-t-clear-the-vcpu_power_off-flag.patch queue-3.14/arm-arm64-kvm-correct-kvm_arm_vcpu_init-power-off-option.patch queue-3.14/arm-arm64-kvm-don-t-allow-creating-vcpus-after-vgic_initialized.patch queue-3.14/arm-arm64-kvm-fix-potential-null-dereference-in.patch queue-3.14/arm64-kvm-fix-unmapping-with-48-bit-vas.patch queue-3.14/arm-arm64-kvm-fix-set_clear_sgi_pend_reg-offset.patch queue-3.14/arm-kvm-strict_mm_typechecks-fix-for-user_mem_abort.patch queue-3.14/arm-arm64-kvm-fix-use-of-wnr-bit-in-kvm_is_write_fault.patch queue-3.14/arm-kvm-fix-cpu-hotplug.patch queue-3.14/arm-arm64-kvm-fix-vttbr_baddr_mask-and-pgd-alloc.patch queue-3.14/arm-arm64-kvm-introduce-stage2_unmap_vm.patch queue-3.14/arm-arm64-kvm-vgic-fix-error-code-in-kvm_vgic_create.patch queue-3.14/kvm-arm-vgic-plug-irq-injection-race.patch queue-3.14/arm-arm64-kvm-reset-the-hcr-on-each-vcpu-when-resetting-the.patch