summaryrefslogtreecommitdiffstats
path: root/arch/arm64
diff options
context:
space:
mode:
authorMario Smarduch <m.smarduch@samsung.com>2015-01-16 00:59:00 +0100
committerChristoffer Dall <christoffer.dall@linaro.org>2015-01-16 14:42:49 +0100
commit9836c6b9fff8cbc43e8bb0098e901fe84ceb0810 (patch)
treec9ce2380a6f64a9a4b5b5c69c89800eab8557f78 /arch/arm64
parentKVM: arm64: ARMv8 header changes for page logging (diff)
downloadlinux-9836c6b9fff8cbc43e8bb0098e901fe84ceb0810.tar.xz
linux-9836c6b9fff8cbc43e8bb0098e901fe84ceb0810.zip
KVM: arm64: Add HYP interface to flush VM Stage 1/2 TLB entries
This patch adds support for arm64 hyp interface to flush all TLBs associated with VMID. Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/kvm/hyp.S22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S
index fbe909fb0a1a..d9c43447eb04 100644
--- a/arch/arm64/kvm/hyp.S
+++ b/arch/arm64/kvm/hyp.S
@@ -1030,6 +1030,28 @@ ENTRY(__kvm_tlb_flush_vmid_ipa)
ret
ENDPROC(__kvm_tlb_flush_vmid_ipa)
+/**
+ * void __kvm_tlb_flush_vmid(struct kvm *kvm) - Flush per-VMID TLBs
+ * @struct kvm *kvm - pointer to kvm structure
+ *
+ * Invalidates all Stage 1 and 2 TLB entries for current VMID.
+ */
+ENTRY(__kvm_tlb_flush_vmid)
+ dsb ishst
+
+ kern_hyp_va x0
+ ldr x2, [x0, #KVM_VTTBR]
+ msr vttbr_el2, x2
+ isb
+
+ tlbi vmalls12e1is
+ dsb ish
+ isb
+
+ msr vttbr_el2, xzr
+ ret
+ENDPROC(__kvm_tlb_flush_vmid)
+
ENTRY(__kvm_flush_vm_context)
dsb ishst
tlbi alle1is