From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752285AbbIXIXy (ORCPT ); Thu, 24 Sep 2015 04:23:54 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:52317 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751246AbbIXIXv (ORCPT ); Thu, 24 Sep 2015 04:23:51 -0400 Subject: Re: [PATCH 2/2] MIPS: initialise MAARs on secondary CPUs To: Paul Burton , References: <1442948929-15862-1-git-send-email-paul.burton@imgtec.com> <1442948929-15862-3-git-send-email-paul.burton@imgtec.com> CC: Rusty Russell , "Steven J. Hill" , Andrew Bresticker , "Bjorn Helgaas" , David Hildenbrand , , Aaro Koskinen , "James Hogan" , Ingo Molnar , Ralf Baechle , Alex Smith From: Markos Chandras X-Enigmail-Draft-Status: N1110 Message-ID: <5603B315.4050008@imgtec.com> Date: Thu, 24 Sep 2015 09:23:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1442948929-15862-3-git-send-email-paul.burton@imgtec.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.154.88] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/22/2015 08:08 PM, Paul Burton wrote: > MAARs should be initialised on each CPU (or rather, core) in the system > in order to achieve consistent behaviour & performance. Previously they > have only been initialised on the boot CPU which leads to performance > problems if tasks are later scheduled on a secondary CPU, particularly > if those tasks make use of unaligned vector accesses where some CPUs > don't handle any cases in hardware for non-speculative memory regions. > Fix this by recording the MAAR configuration from the boot CPU and > applying it to secondary CPUs as part of their bringup. > > Reported-by: Doug Gilmore > Signed-off-by: Paul Burton > --- > > arch/mips/include/asm/maar.h | 9 +++++++++ > arch/mips/kernel/smp.c | 2 ++ > arch/mips/mm/init.c | 28 +++++++++++++++++++++++++--- > 3 files changed, 36 insertions(+), 3 deletions(-) > > diff --git a/arch/mips/include/asm/maar.h b/arch/mips/include/asm/maar.h > index b02891f..21d9607 100644 > --- a/arch/mips/include/asm/maar.h > +++ b/arch/mips/include/asm/maar.h > @@ -66,6 +66,15 @@ static inline void write_maar_pair(unsigned idx, phys_addr_t lower, > } > > /** > + * maar_init() - initialise MAARs > + * > + * Performs initialisation of MAARs for the current CPU, making use of the > + * platforms implementation of platform_maar_init where necessary and > + * duplicating the setup it provides on secondary CPUs. > + */ > +extern void maar_init(void); > + > +/** > * struct maar_config - MAAR configuration data > * @lower: The lowest address that the MAAR pair will affect. Must be > * aligned to a 2^16 byte boundary. > diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c > index a31896c..bd4385a 100644 > --- a/arch/mips/kernel/smp.c > +++ b/arch/mips/kernel/smp.c > @@ -42,6 +42,7 @@ > #include > #include > #include > +#include > > cpumask_t cpu_callin_map; /* Bitmask of started secondaries */ > > @@ -157,6 +158,7 @@ asmlinkage void start_secondary(void) > mips_clockevent_init(); > mp_ops->init_secondary(); > cpu_report(); > + maar_init(); > Hi, This breaks the ip27_defconfig in both upstream-sfr and linux-next arch/mips/built-in.o: In function `start_secondary': (.text+0x123e4): undefined reference to `maar_init' Makefile:944: recipe for target 'vmlinux' failed -- markos