From: Markos Chandras <Markos.Chandras@imgtec.com>
To: Paul Burton <paul.burton@imgtec.com>, <linux-mips@linux-mips.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
"Steven J. Hill" <Steven.Hill@imgtec.com>,
Andrew Bresticker <abrestic@chromium.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
David Hildenbrand <dahi@linux.vnet.ibm.com>,
<linux-kernel@vger.kernel.org>,
Aaro Koskinen <aaro.koskinen@iki.fi>,
"James Hogan" <james.hogan@imgtec.com>,
Ingo Molnar <mingo@kernel.org>,
Ralf Baechle <ralf@linux-mips.org>,
Alex Smith <alex.smith@imgtec.com>
Subject: Re: [PATCH 2/2] MIPS: initialise MAARs on secondary CPUs
Date: Thu, 24 Sep 2015 09:23:49 +0100 [thread overview]
Message-ID: <5603B315.4050008@imgtec.com> (raw)
In-Reply-To: <1442948929-15862-3-git-send-email-paul.burton@imgtec.com>
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 <doug.gilmore@imgtec.com>
> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
> ---
>
> 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 <asm/mmu_context.h>
> #include <asm/time.h>
> #include <asm/setup.h>
> +#include <asm/maar.h>
>
> 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
WARNING: multiple messages have this Message-ID (diff)
From: Markos Chandras <Markos.Chandras@imgtec.com>
To: Paul Burton <paul.burton@imgtec.com>, linux-mips@linux-mips.org
Cc: Rusty Russell <rusty@rustcorp.com.au>,
"Steven J. Hill" <Steven.Hill@imgtec.com>,
Andrew Bresticker <abrestic@chromium.org>,
Bjorn Helgaas <bhelgaas@google.com>,
David Hildenbrand <dahi@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org,
Aaro Koskinen <aaro.koskinen@iki.fi>,
James Hogan <james.hogan@imgtec.com>,
Ingo Molnar <mingo@kernel.org>,
Ralf Baechle <ralf@linux-mips.org>,
Alex Smith <alex.smith@imgtec.com>
Subject: Re: [PATCH 2/2] MIPS: initialise MAARs on secondary CPUs
Date: Thu, 24 Sep 2015 09:23:49 +0100 [thread overview]
Message-ID: <5603B315.4050008@imgtec.com> (raw)
Message-ID: <20150924082349.V8HS2PQi-m5sonrfddh0JPY0h1RwB72Xm-TNP3zIboI@z> (raw)
In-Reply-To: <1442948929-15862-3-git-send-email-paul.burton@imgtec.com>
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 <doug.gilmore@imgtec.com>
> Signed-off-by: Paul Burton <paul.burton@imgtec.com>
> ---
>
> 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 <asm/mmu_context.h>
> #include <asm/time.h>
> #include <asm/setup.h>
> +#include <asm/maar.h>
>
> 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
next prev parent reply other threads:[~2015-09-24 8:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 19:08 [PATCH 0/2] MAAR SMP fix Paul Burton
2015-09-22 19:08 ` Paul Burton
2015-09-22 19:08 ` [PATCH 1/2] MIPS: print MAAR configuration during boot Paul Burton
2015-09-22 19:08 ` Paul Burton
2015-09-22 19:08 ` [PATCH 2/2] MIPS: initialise MAARs on secondary CPUs Paul Burton
2015-09-22 19:08 ` Paul Burton
2015-09-24 8:23 ` Markos Chandras [this message]
2015-09-24 8:23 ` Markos Chandras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5603B315.4050008@imgtec.com \
--to=markos.chandras@imgtec.com \
--cc=Steven.Hill@imgtec.com \
--cc=aaro.koskinen@iki.fi \
--cc=abrestic@chromium.org \
--cc=alex.smith@imgtec.com \
--cc=bhelgaas@google.com \
--cc=dahi@linux.vnet.ibm.com \
--cc=james.hogan@imgtec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=mingo@kernel.org \
--cc=paul.burton@imgtec.com \
--cc=ralf@linux-mips.org \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox