diff mbox

SPARC v9: __tsb_context_switch - demap old tsb_map_vaddr

Message ID 1286308676.11216.4.camel@hp
State Deferred
Delegated to: David Miller
Headers show

Commit Message

Kirill Tkhai Oct. 5, 2010, 7:57 p.m. UTC
SPARC v9: __tsb_context_switch - demap old tsb_map_vaddr
---
When TSB context switches in the function switch_mm() the following
situation could occur. We have old mapping between physical address
and tsb_map_vaddr in uTLB, and new mapping is written in fDTLB.
Because uDTLB has more priority than fDTLB, all transformations
occur through it, and TSB Pointer in tl0_damiss will be formed with
the wrong physical address. To prevent this, we need to flush old
tsb_map_vaddr (TSB_BASE) in TLB. Kernel version 2.6.35.7.


Signed-off-by: Tkhai Kirill <tkhai@yandex.ru>
---


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

Comments

David Miller Oct. 5, 2010, 8:38 p.m. UTC | #1
From: Kirill Tkhai <tkhai@yandex.ru>
Date: Tue, 05 Oct 2010 23:57:56 +0400

> When TSB context switches in the function switch_mm() the following
> situation could occur. We have old mapping between physical address
> and tsb_map_vaddr in uTLB, and new mapping is written in fDTLB.
> Because uDTLB has more priority than fDTLB, all transformations
> occur through it, and TSB Pointer in tl0_damiss will be formed with
> the wrong physical address. To prevent this, we need to flush old
> tsb_map_vaddr (TSB_BASE) in TLB. Kernel version 2.6.35.7.
> 
> 
> Signed-off-by: Tkhai Kirill <tkhai@yandex.ru>

By all pieces of documentation that exist, the uTLB only handles
instruction stream accesses.

Therefore, this patch should not be necessary.

Unless you can show me where in the UltraSPARC documentation it states
that the uTLB is used for data accesses, I am not applying this patch :)
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" 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

--- arch/sparc/kernel/tsb.S.orig 2010-10-05 19:46:55.272218523 +0400
+++ arch/sparc/kernel/tsb.S 2010-10-05 19:48:56.136235329 +0400
@@ -396,6 +396,9 @@  __tsb_context_switch:

 2:	ldx	[%o1 + TSB_CONFIG_MAP_VADDR], %o4
 	brz	%o4, 9f
+	or	%o4, 1 << 5, %o5
+	stxa	%g0, [%o5] ASI_DMMU_DEMAP
+	membar	#Sync
 	 ldx	[%o1 + TSB_CONFIG_MAP_PTE], %o5
 
 	sethi	%hi(sparc64_highest_unlocked_tlb_ent), %g2