diff mbox

[15/20] MIPS: If KVM is enabled then use the KVM specific routine to flush the TLBs on a ASID wrap

Message ID 333219EB-AEDE-47AE-BD69-2B69BBECD188@kymasys.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sanjay Lal Oct. 31, 2012, 3:20 p.m. UTC
Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
---
 arch/mips/include/asm/mmu_context.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Sergei Shtylyov Nov. 1, 2012, 12:08 p.m. UTC | #1
Hello.

On 31-10-2012 19:20, Sanjay Lal wrote:

> Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
> ---
>   arch/mips/include/asm/mmu_context.h | 6 ++++++
>   1 file changed, 6 insertions(+)

> diff --git a/arch/mips/include/asm/mmu_context.h b/arch/mips/include/asm/mmu_context.h
> index 9b02cfb..9c7024c 100644
> --- a/arch/mips/include/asm/mmu_context.h
> +++ b/arch/mips/include/asm/mmu_context.h
> @@ -112,15 +112,21 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
>   static inline void
>   get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
>   {
> +    extern void kvm_local_flush_tlb_all(void);
>   	unsigned long asid = asid_cache(cpu);
>
>   	if (! ((asid += ASID_INC) & ASID_MASK) ) {
>   		if (cpu_has_vtag_icache)
>   			flush_icache_all();
> +#ifdef CONFIG_VIRTUALIZATION
> +        kvm_local_flush_tlb_all();      /* start new asid cycle */

    Please use tabs to indent the code, not spaces.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/mips/include/asm/mmu_context.h b/arch/mips/include/asm/mmu_context.h
index 9b02cfb..9c7024c 100644
--- a/arch/mips/include/asm/mmu_context.h
+++ b/arch/mips/include/asm/mmu_context.h
@@ -112,15 +112,21 @@  static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
 static inline void
 get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
 {
+    extern void kvm_local_flush_tlb_all(void);
 	unsigned long asid = asid_cache(cpu);
 
 	if (! ((asid += ASID_INC) & ASID_MASK) ) {
 		if (cpu_has_vtag_icache)
 			flush_icache_all();
+#ifdef CONFIG_VIRTUALIZATION
+        kvm_local_flush_tlb_all();      /* start new asid cycle */
+#else
 		local_flush_tlb_all();	/* start new asid cycle */
+#endif
 		if (!asid)		/* fix version if needed */
 			asid = ASID_FIRST_VERSION;
 	}
+
 	cpu_context(cpu, mm) = asid_cache(cpu) = asid;
 }