* [PATCH v2] ARM: NOMMU: Setup VBAR/Hivecs for secondaries cores
@ 2017-12-19 14:38 Vladimir Murzin
2017-12-21 4:23 ` afzal mohammed
0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Murzin @ 2017-12-19 14:38 UTC (permalink / raw)
To: linux-arm-kernel
With switch to dynamic exception base address setting, VBAR/Hivecs
set only for boot CPU, but secondaries stay unaware of that. That
might lead to weird effects when trying up to bring up secondaries.
Fixes: ad475117d201 ("ARM: 8649/2: nommu: remove Hivecs configuration is asm")
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
arch/arm/include/asm/memory.h | 1 +
arch/arm/kernel/smp.c | 3 +++
arch/arm/mm/nommu.c | 4 ++--
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 1f54e4e..4966677 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -88,6 +88,7 @@
#else /* CONFIG_MMU */
#ifndef __ASSEMBLY__
+extern unsigned long setup_vectors_base(void);
extern unsigned long vectors_base;
#define VECTORS_BASE vectors_base
#endif
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index b4fbf00..2da0879 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -379,6 +379,9 @@ asmlinkage void secondary_start_kernel(void)
cpu_init();
+#ifndef CONFIG_MMU
+ setup_vectors_base();
+#endif
pr_debug("CPU%u: Booted secondary processor\n", cpu);
preempt_disable();
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c
index 885b106..c8beaab 100644
--- a/arch/arm/mm/nommu.c
+++ b/arch/arm/mm/nommu.c
@@ -31,7 +31,7 @@ struct mpu_rgn_info mpu_rgn_info;
#ifdef CONFIG_CPU_CP15
#ifdef CONFIG_CPU_HIGH_VECTOR
-static unsigned long __init setup_vectors_base(void)
+unsigned long setup_vectors_base(void)
{
unsigned long reg = get_cr();
@@ -58,7 +58,7 @@ static inline bool security_extensions_enabled(void)
return 0;
}
-static unsigned long __init setup_vectors_base(void)
+unsigned long setup_vectors_base(void)
{
unsigned long base = 0, reg = get_cr();
--
2.0.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2] ARM: NOMMU: Setup VBAR/Hivecs for secondaries cores
2017-12-19 14:38 [PATCH v2] ARM: NOMMU: Setup VBAR/Hivecs for secondaries cores Vladimir Murzin
@ 2017-12-21 4:23 ` afzal mohammed
2017-12-21 9:34 ` Vladimir Murzin
0 siblings, 1 reply; 3+ messages in thread
From: afzal mohammed @ 2017-12-21 4:23 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Tue, Dec 19, 2017 at 02:38:13PM +0000, Vladimir Murzin wrote:
> With switch to dynamic exception base address setting, VBAR/Hivecs
> set only for boot CPU, but secondaries stay unaware of that. That
> might lead to weird effects when trying up to bring up secondaries.
>
> Fixes: ad475117d201 ("ARM: 8649/2: nommu: remove Hivecs configuration is asm")
> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
> +#ifndef CONFIG_MMU
> + setup_vectors_base();
> +#endif
i would have preferred instead,
if (!IS_ENABLED(CONFIG_MMU))
setup_vectors_base();
either way,
Acked-by: afzal mohammed <afzal.mohd.ma@gmail.com>
afzal
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] ARM: NOMMU: Setup VBAR/Hivecs for secondaries cores
2017-12-21 4:23 ` afzal mohammed
@ 2017-12-21 9:34 ` Vladimir Murzin
0 siblings, 0 replies; 3+ messages in thread
From: Vladimir Murzin @ 2017-12-21 9:34 UTC (permalink / raw)
To: linux-arm-kernel
On 21/12/17 04:23, afzal mohammed wrote:
> Hi,
>
> On Tue, Dec 19, 2017 at 02:38:13PM +0000, Vladimir Murzin wrote:
>> With switch to dynamic exception base address setting, VBAR/Hivecs
>> set only for boot CPU, but secondaries stay unaware of that. That
>> might lead to weird effects when trying up to bring up secondaries.
>>
>> Fixes: ad475117d201 ("ARM: 8649/2: nommu: remove Hivecs configuration is asm")
>> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
>
>> +#ifndef CONFIG_MMU
>> + setup_vectors_base();
>> +#endif
>
> i would have preferred instead,
>
> if (!IS_ENABLED(CONFIG_MMU))
> setup_vectors_base();
I agree that IS_ENABLED() macro is a nice feature, especially for block of
code, but not here, IMO. First, I wanted to keep consistent with a existing
style in smp.c; the second, I find it easier to read if_not_defined rather
than if_not_is_enabled.
@Russell, do you have any preference?
>
> either way,
>
> Acked-by: afzal mohammed <afzal.mohd.ma@gmail.com>
Thanks!
Vladimir
>
> afzal
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-21 9:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-19 14:38 [PATCH v2] ARM: NOMMU: Setup VBAR/Hivecs for secondaries cores Vladimir Murzin
2017-12-21 4:23 ` afzal mohammed
2017-12-21 9:34 ` Vladimir Murzin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).