Thread (14 messages) 14 messages, 3 authors, 2015-12-24

Re: [PATCH v3 1/6] powerpc/mm: any thread in one core can be the first to setup TLB1

From: Scott Wood <hidden>
Date: 2015-12-04 19:48:33

On Fri, 2015-12-04 at 11:04 +0300, Denis Kirjanov wrote:
On 12/3/15, Scott Wood [off-list ref] wrote:
quoted
On Wed, 2015-12-02 at 15:12 +0300, Denis Kirjanov wrote:
quoted
On 11/20/15, Chenhui Zhao [off-list ref] wrote:
quoted
On e6500, in the case of cpu hotplug, either thread in one core
may be the first thread initilzing the TLB1. The subsequent threads
must not setup it again.

The code is derived from the comment of Scott Wood.

Signed-off-by: Chenhui Zhao <redacted>
---
 arch/powerpc/include/asm/cputhreads.h | 7 +++++++
 arch/powerpc/mm/tlb_nohash.c          | 4 +---
 2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/include/asm/cputhreads.h
b/arch/powerpc/include/asm/cputhreads.h
index ba42e46..b56cece 100644
--- a/arch/powerpc/include/asm/cputhreads.h
+++ b/arch/powerpc/include/asm/cputhreads.h
@@ -94,6 +94,13 @@ static inline int cpu_last_thread_sibling(int cpu)
 	return cpu | (threads_per_core - 1);
 }

+static inline u32 get_tensr(void)
+{
+	if (cpu_has_feature(CPU_FTR_SMT))
+		return mfspr(SPRN_TENSR);
+	else
+		return 1;
+}
If i get it right, SPRN_TENSR used in the code only if CONFIG_PPC64
is defined. Then we can make it noop on ppc32.
Please don't.  It accomplishes nothing other than adding an obstacle to
supporting this on ppc32.
The idea is make it noop since the function defined in header file and
some core parts include it like:

arch/powerpc/kernel/smp.c
arch/powerpc/kernel/setup-common.c
What does that have to do with making it a no-op on 32-bit?  I understand
ifdeffing on CONFIG_BOOKE due to the build issue, but not CONFIG_PPC64.

-Scott
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help