* [PATCH] arm32: simplify ARM_MMU_KEEP usage
@ 2024-10-07 13:11 Rolf Eike Beer
2024-12-18 12:13 ` Rolf Eike Beer
0 siblings, 1 reply; 4+ messages in thread
From: Rolf Eike Beer @ 2024-10-07 13:11 UTC (permalink / raw)
To: Russell King, Arnd Bergmann, Yuntao Liu, Linus Walleij
Cc: linux-arm-kernel, linux-kernel
All current users need to add a KEEP() around the argument so the value is
actually kept, which doesn't feel very natural and is prone to upcoming bugs as
the name suggests that this macro alone already keeps things. Move that directly
into the definition.
Signed-off-by: Rolf Eike Beer <eb@emlix.com>
---
I'm unsure if ARM_MMU_DISCARD() needs the same treatment for the non-MMU case.
I suspect noone has tried dead code elimination for non-MMU?
arch/arm/include/asm/vmlinux.lds.h | 2 +-
arch/arm/kernel/vmlinux-xip.lds.S | 2 +-
arch/arm/kernel/vmlinux.lds.S | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/include/asm/vmlinux.lds.h b/arch/arm/include/asm/vmlinux.lds.h
index d60f6e83a9f7..89697f204715 100644
--- a/arch/arm/include/asm/vmlinux.lds.h
+++ b/arch/arm/include/asm/vmlinux.lds.h
@@ -19,7 +19,7 @@
#endif
#ifdef CONFIG_MMU
-#define ARM_MMU_KEEP(x) x
+#define ARM_MMU_KEEP(x) KEEP(x)
#define ARM_MMU_DISCARD(x)
#else
#define ARM_MMU_KEEP(x)
diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S
index 5eddb75a7174..f2e8d4fac068 100644
--- a/arch/arm/kernel/vmlinux-xip.lds.S
+++ b/arch/arm/kernel/vmlinux-xip.lds.S
@@ -63,7 +63,7 @@ SECTIONS
. = ALIGN(4);
__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
__start___ex_table = .;
- ARM_MMU_KEEP(KEEP(*(__ex_table)))
+ ARM_MMU_KEEP(*(__ex_table))
__stop___ex_table = .;
}
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index de373c6c2ae8..d592a203f9c6 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -74,7 +74,7 @@ SECTIONS
. = ALIGN(4);
__ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
__start___ex_table = .;
- ARM_MMU_KEEP(KEEP(*(__ex_table)))
+ ARM_MMU_KEEP(*(__ex_table))
__stop___ex_table = .;
}
--
2.46.1
--
Rolf Eike Beer
emlix GmbH
Headquarters: Berliner Str. 12, 37073 Göttingen, Germany
Phone +49 (0)551 30664-0, e-mail info@emlix.com
District Court of Göttingen, Registry Number HR B 3160
Managing Directors: Heike Jordan, Dr. Uwe Kracke
VAT ID No. DE 205 198 055
Office Berlin: Panoramastr. 1, 10178 Berlin, Germany
Office Bonn: Bachstr. 6, 53115 Bonn, Germany
http://www.emlix.com
emlix - your embedded Linux partner
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] arm32: simplify ARM_MMU_KEEP usage
2024-10-07 13:11 [PATCH] arm32: simplify ARM_MMU_KEEP usage Rolf Eike Beer
@ 2024-12-18 12:13 ` Rolf Eike Beer
2024-12-24 19:25 ` Linus Walleij
0 siblings, 1 reply; 4+ messages in thread
From: Rolf Eike Beer @ 2024-12-18 12:13 UTC (permalink / raw)
To: Russell King, Arnd Bergmann, Yuntao Liu, Linus Walleij
Cc: linux-arm-kernel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2538 bytes --]
On Montag, 7. Oktober 2024 15:11:40 Mitteleuropäische Normalzeit Rolf Eike
Beer wrote:
> All current users need to add a KEEP() around the argument so the value is
> actually kept, which doesn't feel very natural and is prone to upcoming bugs
> as the name suggests that this macro alone already keeps things. Move that
> directly into the definition.
>
> Signed-off-by: Rolf Eike Beer <eb@emlix.com>
> ---
Ping?
> I'm unsure if ARM_MMU_DISCARD() needs the same treatment for the non-MMU
> case. I suspect noone has tried dead code elimination for non-MMU?
>
> arch/arm/include/asm/vmlinux.lds.h | 2 +-
> arch/arm/kernel/vmlinux-xip.lds.S | 2 +-
> arch/arm/kernel/vmlinux.lds.S | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/include/asm/vmlinux.lds.h
> b/arch/arm/include/asm/vmlinux.lds.h index d60f6e83a9f7..89697f204715
> 100644
> --- a/arch/arm/include/asm/vmlinux.lds.h
> +++ b/arch/arm/include/asm/vmlinux.lds.h
> @@ -19,7 +19,7 @@
> #endif
>
> #ifdef CONFIG_MMU
> -#define ARM_MMU_KEEP(x) x
> +#define ARM_MMU_KEEP(x) KEEP(x)
> #define ARM_MMU_DISCARD(x)
> #else
> #define ARM_MMU_KEEP(x)
> diff --git a/arch/arm/kernel/vmlinux-xip.lds.S
> b/arch/arm/kernel/vmlinux-xip.lds.S index 5eddb75a7174..f2e8d4fac068 100644
> --- a/arch/arm/kernel/vmlinux-xip.lds.S
> +++ b/arch/arm/kernel/vmlinux-xip.lds.S
> @@ -63,7 +63,7 @@ SECTIONS
> . = ALIGN(4);
> __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
> __start___ex_table = .;
> - ARM_MMU_KEEP(KEEP(*(__ex_table)))
> + ARM_MMU_KEEP(*(__ex_table))
> __stop___ex_table = .;
> }
>
> diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
> index de373c6c2ae8..d592a203f9c6 100644
> --- a/arch/arm/kernel/vmlinux.lds.S
> +++ b/arch/arm/kernel/vmlinux.lds.S
> @@ -74,7 +74,7 @@ SECTIONS
> . = ALIGN(4);
> __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
> __start___ex_table = .;
> - ARM_MMU_KEEP(KEEP(*(__ex_table)))
> + ARM_MMU_KEEP(*(__ex_table))
> __stop___ex_table = .;
> }
--
Rolf Eike Beer
emlix GmbH
Headquarters: Berliner Str. 12, 37073 Göttingen, Germany
Phone +49 (0)551 30664-0, e-mail info@emlix.com
District Court of Göttingen, Registry Number HR B 3160
Managing Directors: Heike Jordan, Dr. Uwe Kracke
VAT ID No. DE 205 198 055
Office Berlin: Panoramastr. 1, 10178 Berlin, Germany
Office Bonn: Bachstr. 6, 53115 Bonn, Germany
http://www.emlix.com
emlix - your embedded Linux partner
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 313 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] arm32: simplify ARM_MMU_KEEP usage
2024-12-18 12:13 ` Rolf Eike Beer
@ 2024-12-24 19:25 ` Linus Walleij
2025-03-11 10:17 ` Rolf Eike Beer
0 siblings, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2024-12-24 19:25 UTC (permalink / raw)
To: Rolf Eike Beer
Cc: Russell King, Arnd Bergmann, Yuntao Liu, linux-arm-kernel,
linux-kernel
On Wed, Dec 18, 2024 at 1:13 PM Rolf Eike Beer <eb@emlix.com> wrote:
> On Montag, 7. Oktober 2024 15:11:40 Mitteleuropäische Normalzeit Rolf Eike
> Beer wrote:
> > All current users need to add a KEEP() around the argument so the value is
> > actually kept, which doesn't feel very natural and is prone to upcoming bugs
> > as the name suggests that this macro alone already keeps things. Move that
> > directly into the definition.
> >
> > Signed-off-by: Rolf Eike Beer <eb@emlix.com>
> > ---
>
> Ping?
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Please put the patch into Russell's patch tracker so he can apply it.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] arm32: simplify ARM_MMU_KEEP usage
2024-12-24 19:25 ` Linus Walleij
@ 2025-03-11 10:17 ` Rolf Eike Beer
0 siblings, 0 replies; 4+ messages in thread
From: Rolf Eike Beer @ 2025-03-11 10:17 UTC (permalink / raw)
To: Linus Walleij
Cc: Russell King, Arnd Bergmann, Yuntao Liu, linux-arm-kernel,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1499 bytes --]
On Dienstag, 24. Dezember 2024 20:25:19 Mitteleuropäische Normalzeit Linus
Walleij wrote:
> On Wed, Dec 18, 2024 at 1:13 PM Rolf Eike Beer <eb@emlix.com> wrote:
> > On Montag, 7. Oktober 2024 15:11:40 Mitteleuropäische Normalzeit Rolf Eike
> >
> > Beer wrote:
> > > All current users need to add a KEEP() around the argument so the value
> > > is
> > > actually kept, which doesn't feel very natural and is prone to upcoming
> > > bugs as the name suggests that this macro alone already keeps things.
> > > Move that directly into the definition.
> > >
> > > Signed-off-by: Rolf Eike Beer <eb@emlix.com>
> > > ---
> >
> > Ping?
>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> Please put the patch into Russell's patch tracker so he can apply it.
Ping?
It's available in the tracker here:
https://www.armlinux.org.uk/developer/patches/viewpatch.php?id=9439/1
--
Rolf Eike Beer
We are nominated for the embedded award Visit us at the embedded
world 2025 March 11th to 13th, 2025 | Nuremberg Find us in hall 4 at
booth 336
emlix GmbH
Headquarters: Berliner Str. 12, 37073 Göttingen, Germany
Phone +49 (0)551 30664-0, e-mail info@emlix.com
District Court of Göttingen, Registry Number HR B 3160
Managing Directors: Heike Jordan, Dr. Uwe Kracke
VAT ID No. DE 205 198 055
Office Berlin: Panoramastr. 1, 10178 Berlin, Germany
Office Bonn: Bachstr. 6, 53115 Bonn, Germany
http://www.emlix.com
emlix - your embedded Linux partner
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 313 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-03-11 10:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-07 13:11 [PATCH] arm32: simplify ARM_MMU_KEEP usage Rolf Eike Beer
2024-12-18 12:13 ` Rolf Eike Beer
2024-12-24 19:25 ` Linus Walleij
2025-03-11 10:17 ` Rolf Eike Beer
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).