Another Errata 430973 Update
Subsystems (3)
cover Another Errata 430973 Update
Hi,
This patchset is a followup to e748994 and a6d74678, that unconditionally enable the errata 430973 workaround for Cortex A8 CPUs.
The first patch removes the CONFIG_ARM_ERRATA_430973 guard in the Nokia N900's IBE code, since all sold N900s are affected by the bug (AFAIK).
The next two patches update the errata's Kconfig entry, so that it's no longer shown for multiplatform kernels and informs about the bootloader method.
-- Sebastian
Sebastian Reichel (3):
ARM: OMAP2+: N900: always enable IBE bit
ARM: update errata 430973 documentation
ARM: errata 430973: move !ARCH_MULTIPLATFORM to Kconfig
arch/arm/Kconfig | 5 +++++ arch/arm/mach-omap2/board-rx51.c | 2 -- arch/arm/mach-omap2/pdata-quirks.c | 11 ++--------- arch/arm/mm/proc-v7.S | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-)
Signature · 1 line
2.1.4
PATCH 1/3 ARM: OMAP2+: N900: always enable IBE bit
The kernel's workaround for Errata 430973 consists of a BTAC/BTB flush at context switch. This requires the IBE bit being set, which should normally be done by the bootloader.
Since the Nokia N900's bootloader is not easily replaceable, a pdata quirk enables the IBE bit for the Nokia N900. Until e748994f5cc5, the flush at context switch required CONFIG_ARM_ERRATA_430973, so the same check has been used for setting the IBE bit.
Since all sold N900s are assumed to be affected, the guard can be removed now, so that the IBE bit is always set.
--- arch/arm/mach-omap2/board-rx51.c | 2 -- arch/arm/mach-omap2/pdata-quirks.c | 11 ++--------- 2 files changed, 2 insertions(+), 11 deletions(-)
arch/arm/mach-omap2/board-rx51.c +0 -2
@@ -108,11 +108,9 @@ static void __init rx51_init(void)rx51_peripherals_init ();if (omap_type () ==OMAP2_DEVICE_TYPE_SEC ) { -#ifdef CONFIG_ARM_ERRATA_430973 pr_info ("RX-51: Enabling ARM errata 430973 workaround\n" );/* set IBE to 1 */ rx51_secure_update_aux_cr (BIT (6 ),0 ); -#endif }/* Ensure SDRC pins are mux'd for self-refresh */
arch/arm/mach-omap2/pdata-quirks.c +2 -9
@@ -249,18 +249,11 @@ static void __init nokia_n900_legacy_init(void)hsmmc2_internal_input_clk ();if (omap_type () ==OMAP2_DEVICE_TYPE_SEC ) { -if (IS_ENABLED (CONFIG_ARM_ERRATA_430973 )) { -pr_info ("RX-51: Enabling ARM errata 430973 workaround\n" ); -/* set IBE to 1 */ -rx51_secure_update_aux_cr (BIT (6 ),0 ); - }else { -pr_warn ("RX-51: Not enabling ARM errata 430973 workaround\n" ); -pr_warn ("Thumb binaries may crash randomly without this workaround\n" ); - } +pr_info ("RX-51: Enabling ARM errata 430973 workaround\n" ); +rx51_secure_update_aux_cr (BIT (6 ),0 );/* set IBE to 1 */ pr_info ("RX-51: Registring OMAP3 HWRNG device\n" );platform_device_register (&omap3_rom_rng_device); - } }
Signature · 1 line
2.1.4
PATCH 2/3 ARM: update errata 430973 documentation
In reply to Sebastian ReichelThe Errata 430973 workaround config option only enables the IBE bit, which should be done by the bootloader if possible.
--- arch/arm/Kconfig | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/Kconfig +4 -0
@@ -1078,6 +1078,10 @@ config ARM_ERRATA_430973 and also flushes the branch target cache at every context switch. Note that setting specific bits in the ACTLR register may not be available in non-secure mode. + Instead of enabling this option, it is recommended to enable the + workaround by setting the IBE bit from the bootloader, since the + BTB/BTAC operations are always executed for context switches on + Cortex-A8. config ARM_ERRATA_458693 bool "ARM errata: Processor deadlock when a false hazard is created"
Signature · 1 line
2.1.4
PATCH 3/3 ARM: errata 430973: move !ARCH_MULTIPLATFORM to Kconfig
In reply to Sebastian ReichelHaving the !ARCH_MULTIPLATFORM dependency in the Kconfig file results in one option less to think about when configuring the kernel.
--- arch/arm/Kconfig | 1 + arch/arm/mm/proc-v7.S | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
arch/arm/Kconfig +1 -0
@@ -1066,6 +1066,7 @@ config ARM_ERRATA_411920 config ARM_ERRATA_430973 bool "ARM errata: Stale prediction on replaced interworking branch" depends on CPU_V7 + depends on !ARCH_MULTIPLATFORM help This option enables the workaround for the 430973 Cortex-A8 r1p* erratum. If a code sequence containing an ARM/Thumb
arch/arm/mm/proc-v7.S +1 -1
@@ -294,7 +294,7 @@ __v7_ca17mp_setup: * r9: MIDR */ __ca8_errata: -#if defined(CONFIG_ARM_ERRATA_430973) && !defined(CONFIG_ARCH_MULTIPLATFORM) +#ifdef CONFIG_ARM_ERRATA_430973 teq r3, #0x00100000 @ only present in r1p* mrceq p15, 0, r0, c1, c0, 1 @ read aux control register orreq r0, r0, #(1 << 6) @ set IBE to 1
Signature · 1 line
2.1.4
Re: [PATCH 1/3] ARM: OMAP2+: N900: always enable IBE bit
In reply to Sebastian ReichelQuoted 4 lines · Sebastian Reichel
The kernel's workaround for Errata 430973 consists of a BTAC/BTB flush at context switch. This requires the IBE bit being set, which should normally be done by the bootloader.
Quoted 8 lines
Since the Nokia N900's bootloader is not easily replaceable, a pdata quirk enables the IBE bit for the Nokia N900. Until
e748994f5cc5, the flush at context switch requiredCONFIG_ARM_ERRATA_430973, so the same check has been used for setting the IBE bit.Since all sold N900s are assumed to be affected, the guard can be removed now, so that the IBE bit is always set.
OK makes sense to me. It's best that you upload these into Russell's patch tracking system after waiting for some more comments. Please feel free to add for the whole series:
Re: [PATCH 3/3] ARM: errata 430973: move !ARCH_MULTIPLATFORM to Kconfig
In reply to Sebastian Reichelarch/arm/mm/proc-v7.S __v7_ca17mp_setup: · line 300
Quoted 8 lines · Sebastian Reichel
Having the !ARCH_MULTIPLATFORM dependency in the
Kconfigfile results in one option less to think about when configuring the kernel.arch/arm/mm/proc-v7.S +1
-1-#if defined(CONFIG_ARM_ERRATA_430973) && !defined(CONFIG_ARCH_MULTIPLATFORM) +#ifdef CONFIG_ARM_ERRATA_430973 teq r3, #0x00100000 @ only present in r1p* mrceq p15, 0, r0, c1, c0, 1 @ read aux control register orreq r0, r0, #(1 << 6) @ set IBE to 1
NAK. Please read the mailing list history, I'm not repeating myself again on this. Thanks.
Signature · 2 lines
FTTC broadband for 0.8mile line: [email protected] down 400kbps up according to speedtest.net.
Re: [PATCH 3/3] ARM: errata 430973: move !ARCH_MULTIPLATFORM to Kconfig
Hi Russel,
Quoted 4 lines · Russell King - ARM Linux
Quoted 2 lines · Sebastian Reichel
Having the !ARCH_MULTIPLATFORM dependency in the
Kconfigfile results in one option less to think about when configuring the kernel.
Quoted 8 lines
arch/arm/mm/proc-v7.S __v7_ca17mp_setup: · line 300
Quoted 5 lines
arch/arm/mm/proc-v7.S +1
-1-#if defined(CONFIG_ARM_ERRATA_430973) && !defined(CONFIG_ARCH_MULTIPLATFORM) +#ifdef CONFIG_ARM_ERRATA_430973 teq r3, #0x00100000 @ only present in r1p* mrceq p15, 0, r0, c1, c0, 1 @ read aux control register orreq r0, r0, #(1 << 6) @ set IBE to 1NAK. Please read the mailing list history, I'm not repeating myself again on this. Thanks.
It's a bit hard to search the mailing list history without a bit more information.
I guess you prefer to just add the !ARCH_MULTIPLATFORM dependency to the Kconfig entry without removing the additional check in the code?
-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150724/98dc4c4b/attachment.sig>
Re: [PATCH 3/3] ARM: errata 430973: move !ARCH_MULTIPLATFORM to Kconfig
Quoted 16 lines · Sebastian Reichel
Hi Russel,
Quoted 4 lines · Russell King - ARM Linux
Quoted 2 lines · Sebastian Reichel
Having the !ARCH_MULTIPLATFORM dependency in the
Kconfigfile results in one option less to think about when configuring the kernel.Quoted 8 lines
arch/arm/mm/proc-v7.S __v7_ca17mp_setup: · line 300
Quoted 5 lines
arch/arm/mm/proc-v7.S +1
-1-#if defined(CONFIG_ARM_ERRATA_430973) && !defined(CONFIG_ARCH_MULTIPLATFORM) +#ifdef CONFIG_ARM_ERRATA_430973 teq r3, #0x00100000 @ only present in r1p* mrceq p15, 0, r0, c1, c0, 1 @ read aux control register orreq r0, r0, #(1 << 6) @ set IBE to 1NAK. Please read the mailing list history, I'm not repeating myself again on this. Thanks.
Quoted 2 lines
It's a bit hard to search the mailing list history without a bit more information.
You were Cc'd on the previous round of review...
Quoted 2 lines
I guess you prefer to just add the !ARCH_MULTIPLATFORM dependency to the
Kconfigentry without removing the additional check in the code?
I was referring to the above change.
However, having discussed with Will Deacon and checked the manuals, I think the change is okay after all: the auxillary control register is banked on secure parts, and the bit we'll be trying to change will be read-only in non-secure mode - and importantly won't fault.
So, the change is fine, thanks.
Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up according to speedtest.net.
Re: [PATCH 3/3] ARM: errata 430973: move !ARCH_MULTIPLATFORM to Kconfig
Hi,
Quoted 15 lines · Russell King - ARM Linux
Quoted 14 lines · Sebastian Reichel
Quoted 12 lines · Russell King - ARM Linux
arch/arm/mm/proc-v7.S __v7_ca17mp_setup: · line 300
Quoted 8 lines · Sebastian Reichel
Having the !ARCH_MULTIPLATFORM dependency in the
Kconfigfile results in one option less to think about when configuring the kernel.arch/arm/mm/proc-v7.S +1
-1-#if defined(CONFIG_ARM_ERRATA_430973) && !defined(CONFIG_ARCH_MULTIPLATFORM) +#ifdef CONFIG_ARM_ERRATA_430973 teq r3, #0x00100000 @ only present in r1p* mrceq p15, 0, r0, c1, c0, 1 @ read aux control register orreq r0, r0, #(1 << 6) @ set IBE to 1NAK. Please read the mailing list history, I'm not repeating myself again on this. Thanks.
Quoted 4 lines
Quoted 2 lines
It's a bit hard to search the mailing list history without a bit more information.
You were Cc'd on the previous round of review...
But that discussion was about removing the check alltogether iirc. This patch does not remove the !ARCH_MULTIPLATFORM check. It just *moves* it from the sourcecode to the errata's Kconfig entry.
The intention was to hide the Kconfig option on multiplatform kernels, since it's completely useless there after the N900 boardcode has been changed (PATCH 1/3).
Quoted 11 lines
Quoted 2 lines
I guess you prefer to just add the !ARCH_MULTIPLATFORM dependency to the
Kconfigentry without removing the additional check in the code?I was referring to the above change.
However, having discussed with Will Deacon and checked the manuals, I think the change is okay after all: the auxillary control register is banked on secure parts, and the bit we'll be trying to change will be read-only in non-secure mode - and importantly won't fault.
So, the change is fine, thanks.
I think you missed the part adding the !ARCH_MULTIPLATFORM dependency in Kconfig for ARM_ERRATA_430973. I only removed the check in the sourcecode, since it is no longer required with the dependency being in Kconfig.
So I guess there are 3 options now:
1. Add !ARCH_MULTIPLATFORM dependency to Kconfig, keep extra check in the sourcecode
2. Add !ARCH_MULTIPLATFORM dependency to Kconfig, remove extra check in the sourcecode
3. Remove !ARCH_MULTIPLATFORM dependency alltogether
I will send an appropriate patch, if you tell me your preferred option.
-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150727/a8b16f11/attachment.sig>
Re: [PATCH 3/3] ARM: errata 430973: move !ARCH_MULTIPLATFORM to Kconfig
Quoted 57 lines · Sebastian Reichel
Hi,
Quoted 16 lines · Russell King - ARM Linux
Quoted 14 lines · Sebastian Reichel
Quoted 12 lines · Russell King - ARM Linux
Quoted 9 lines · Sebastian Reichel
Having the !ARCH_MULTIPLATFORM dependency in the
Kconfigfile results in one option less to think about when configuring the kernel.-#if
defined(CONFIG_ARM_ERRATA_430973)&&
!defined(CONFIG_ARCH_MULTIPLATFORM) +#ifdefCONFIG_ARM_ERRATA_430973teq r3, #0x00100000 @ only
present in r1p* mrceq p15, 0, r0, c1, c0, 1 @ read aux
control register orreq r0, r0, #(1 << 6) @ set IBE to 1Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
NAK. Please read the mailing list history, I'm not repeating myself again on this. Thanks.
It's a bit hard to search the mailing list history without a bit more information.
You were Cc'd on the previous round of review...
But that discussion was about removing the check alltogether iirc.
This patch does not remove the !ARCH_MULTIPLATFORM check. It just *moves* it from the sourcecode to the errata'sKconfigentry.The intention was to hide the
Kconfigoption on multiplatform kernels, since it's completely useless there after the N900 boardcode has been changed (PATCH 1/3).Quoted 6 lines
Quoted 3 lines
I guess you prefer to just add the !ARCH_MULTIPLATFORM dependency to the
Kconfigentry without removing the additional check in the code?I was referring to the above change.
Quoted 7 lines
However, having discussed with Will Deacon and checked the manuals, I think the change is okay after all: the auxillary control register is banked on secure parts, and the bit we'll be trying to change will be read-only in non-secure mode - and importantly won't fault.
So, the change is fine, thanks.
I think you missed the part adding the !ARCH_MULTIPLATFORM dependency in
KconfigforARM_ERRATA_430973. I only removed the check in the sourcecode, since it is no longer required with the dependency being inKconfig.So I guess there are 3 options now:
Quoted 7 lines
1. Add !ARCH_MULTIPLATFORM dependency to
Kconfig, keep extra check in the sourcecode 2. Add !ARCH_MULTIPLATFORM dependency toKconfig, remove extra check in the sourcecode 3. Remove !ARCH_MULTIPLATFORM dependency alltogetherI will send an appropriate patch, if you tell me your preferred option.
This isn't the only place ARM_ERRATA_430973 is used, and if you make it configurable on !ARCH_MULTIPLATFORM then it makes it impossible to use a ARCH_MULTIPLATFORM kernel on something that is an Cortex-A8.
See arch/arm/mm/proc-v7-2level.S
Signature · 2 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius
Re: [PATCH 3/3] ARM: errata 430973: move !ARCH_MULTIPLATFORM to Kconfig
Quoted 6 lines · Ben Dooks
This isn't the only place
ARM_ERRATA_430973is used, and if you make it configurable on !ARCH_MULTIPLATFORM then it makes it impossible to use aARCH_MULTIPLATFORMkernel on something that is an Cortex-A8.See
arch/arm/mm/proc-v7-2level.S
That has been fixed so that the BTAC/BTB always gets flushed on each context switch for all Cortex-A8 CPUs, but none of the other v7 CPUs.
Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up according to speedtest.net.
Re: [PATCH 3/3] ARM: errata 430973: move !ARCH_MULTIPLATFORM to Kconfig
In reply to Ben DooksHi Ben,
Quoted 12 lines · Ben Dooks
Quoted 12 lines
I think you missed the part adding the !ARCH_MULTIPLATFORM dependency in
KconfigforARM_ERRATA_430973. I only removed the check in the sourcecode, since it is no longer required with the dependency being inKconfig.So I guess there are 3 options now:
1. Add !ARCH_MULTIPLATFORM dependency to
Kconfig, keep extra check in the sourcecode 2. Add !ARCH_MULTIPLATFORM dependency toKconfig, remove extra check in the sourcecode 3. Remove !ARCH_MULTIPLATFORM dependency alltogether
Quoted 4 lines
Quoted 2 lines
I will send an appropriate patch, if you tell me your preferred option.
This isn't the only place
ARM_ERRATA_430973is used, [...]
The dependency on ARM_ERRATA_430973 has been removed from arch/arm/mm/proc-v7-2level.S in 4.1 (commit id e748994), so that it always flushes. The only additional places are in the Nokia N900 boardcode and the N900 pdata-quirk, which are removed in PATCH 1/3.
So actually it is the only place.
-- Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150727/7c76e4e5/attachment.sig>
Re: [PATCH 1/3] ARM: OMAP2+: N900: always enable IBE bit
In reply to Sebastian ReichelHi!
Quoted 4 lines
The kernel's workaround for Errata 430973 consists of a BTAC/BTB flush at context switch. This requires the IBE bit being set, which should normally be done by the bootloader.
Quoted 8 lines
Since the Nokia N900's bootloader is not easily replaceable, a pdata quirk enables the IBE bit for the Nokia N900. Until
e748994f5cc5, the flush at context switch requiredCONFIG_ARM_ERRATA_430973, so the same check has been used for setting the IBE bit.Since all sold N900s are assumed to be affected, the guard can be removed now, so that the IBE bit is always set.
Is the qemu affected?
Does qemu have enough secure support not to fail on this?
Best regards,
Pavel
Quoted 56 lines
Signed-off-by Sebastian Reichel <[email protected]>--- arch/arm/mach-omap2/board-rx51.c | 2 -- arch/arm/mach-omap2/pdata-quirks.c | 11 ++--------- 2 files changed, 2 insertions(+), 11 deletions(-)arch/arm/mach-omap2/board-rx51.c +0
-2@@ -108,11 +108,9 @@ static void __init rx51_init(void)rx51_peripherals_init ();if (omap_type () ==OMAP2_DEVICE_TYPE_SEC ) { -#ifdef CONFIG_ARM_ERRATA_430973 pr_info ("RX-51: Enabling ARM errata 430973 workaround\n" );/* set IBE to 1 */ rx51_secure_update_aux_cr (BIT (6 ),0 ); -#endif }/* Ensure SDRC pins are mux'd for self-refresh */ arch/arm/mach-omap2/pdata-quirks.c +2
-9@@ -249,18 +249,11 @@ static void __init nokia_n900_legacy_init(void)hsmmc2_internal_input_clk ();if (omap_type () ==OMAP2_DEVICE_TYPE_SEC ) { -if (IS_ENABLED (CONFIG_ARM_ERRATA_430973 )) { -pr_info ("RX-51: Enabling ARM errata 430973 workaround\n" ); -/* set IBE to 1 */ -rx51_secure_update_aux_cr (BIT (6 ),0 ); - }else { -pr_warn ("RX-51: Not enabling ARM errata 430973 workaround\n" ); -pr_warn ("Thumb binaries may crash randomly without this workaround\n" ); - } +pr_info ("RX-51: Enabling ARM errata 430973 workaround\n" ); +rx51_secure_update_aux_cr (BIT (6 ),0 );/* set IBE to 1 */ pr_info ("RX-51: Registring OMAP3 HWRNG device\n" );platform_device_register (&omap3_rom_rng_device); - } }Signature · 7 lines
2.1.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html