diff mbox

[2/3] arm64: Add HYP interface to flush VM Stage 1/2 TLB entires

Message ID 1412908447-28247-3-git-send-email-m.smarduch@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mario Smarduch Oct. 10, 2014, 2:34 a.m. UTC
This patch adds HYP VM TLB FLush function.

Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
---
 arch/arm64/kvm/hyp.S | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

Christoffer Dall Nov. 7, 2014, 8:20 p.m. UTC | #1
On Thu, Oct 09, 2014 at 07:34:06PM -0700, Mario Smarduch wrote:
> This patch adds HYP VM TLB FLush function.
> 
> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
> ---
>  arch/arm64/kvm/hyp.S | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S
> index b0d1512..117a91c 100644
> --- a/arch/arm64/kvm/hyp.S
> +++ b/arch/arm64/kvm/hyp.S
> @@ -645,6 +645,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
> + * @struc kvm *kvm - pointer to kvm structure

struct

> + *
> + * 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
> -- 
> 1.9.1
> 
Looks good to me:

Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Mario Smarduch Nov. 7, 2014, 8:50 p.m. UTC | #2
On 11/07/2014 12:20 PM, Christoffer Dall wrote:
> On Thu, Oct 09, 2014 at 07:34:06PM -0700, Mario Smarduch wrote:
>> This patch adds HYP VM TLB FLush function.
>>
>> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
>> ---
>>  arch/arm64/kvm/hyp.S | 22 ++++++++++++++++++++++
>>  1 file changed, 22 insertions(+)
>>
>> diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S
>> index b0d1512..117a91c 100644
>> --- a/arch/arm64/kvm/hyp.S
>> +++ b/arch/arm64/kvm/hyp.S
>> @@ -645,6 +645,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
>> + * @struc kvm *kvm - pointer to kvm structure
> 
> struct

Got it.
> 
>> + *
>> + * 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
>> -- 
>> 1.9.1
>>
> Looks good to me:
> 
> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
>
diff mbox

Patch

diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S
index b0d1512..117a91c 100644
--- a/arch/arm64/kvm/hyp.S
+++ b/arch/arm64/kvm/hyp.S
@@ -645,6 +645,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
+ * @struc 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