linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] generic command line v6
@ 2023-11-10  1:38 Daniel Walker
  2023-11-10  1:38 ` [PATCH 8/8] CMDLINE: arm64: convert to generic builtin command line Daniel Walker
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Daniel Walker @ 2023-11-10  1:38 UTC (permalink / raw)
  To: Will Deacon, Christophe Leroy, Rob Herring, Daniel Gimpelevich,
	Andrew Morton, Pratyush Brahma, Tomas Mudrunka, Sean Anderson,
	x86, linux-mips, linuxppc-dev, H. Peter Anvin, Nathan Chancellor,
	Nick Desaulniers, Nicolas Schier, linux-arm-kernel, linux-kernel,
	devicetree, linux-kbuild
  Cc: linux-efi

This release is an up-rev of the v5 patches. No additional features have
been added. Some changes were mode to function names and some changes to
Kconfig dependencies. Also updated the config conversion for mips.

There are a number of people who have expressed interest in these
patches either by asking for them to be merge or testing them. If
people are so inclined please continue to request them to be merge
or to ask the status of the next release. It's helpful to motivate me to
release them again and for the maintainers to see the interest
generated.

These patches have been used by Cisco Systems, Inc. on millions of
released products to great effect. Hopefully they can be used by the
entire Linux eco system.

My apologies on the length between releases. I will try to release more
often.


Daniel Walker (8):
  CMDLINE: add generic builtin command line
  scripts: insert-sys-cert: add command line insert capability
  scripts: insert-sys-cert: change name to insert-symbol
  CMDLINE: mips: convert to generic builtin command line
  drivers: firmware: efi: libstub: enable generic commandline
  CMDLINE: x86: convert to generic builtin command line
  of: replace command line handling
  CMDLINE: arm64: convert to generic builtin command line

 arch/arm64/Kconfig                            |  33 +--
 arch/arm64/include/asm/setup.h                |   4 +
 arch/arm64/include/uapi/asm/setup.h           |   2 +
 arch/arm64/kernel/idreg-override.c            |   9 +-
 arch/arm64/kernel/pi/kaslr_early.c            |  14 +-
 arch/mips/Kconfig                             |   4 +-
 arch/mips/Kconfig.debug                       |  44 ----
 arch/mips/configs/ar7_defconfig               |  12 +-
 arch/mips/configs/bcm47xx_defconfig           |  10 +-
 arch/mips/configs/bcm63xx_defconfig           |  21 +-
 arch/mips/configs/bmips_be_defconfig          |  17 +-
 arch/mips/configs/bmips_stb_defconfig         | 139 ++++------
 arch/mips/configs/ci20_defconfig              |   8 +-
 arch/mips/configs/cu1000-neo_defconfig        |  19 +-
 arch/mips/configs/cu1830-neo_defconfig        |  19 +-
 arch/mips/configs/generic_defconfig           |  15 +-
 arch/mips/configs/gpr_defconfig               |  33 +--
 arch/mips/configs/loongson3_defconfig         |  29 +--
 arch/mips/include/asm/setup.h                 |   2 +
 arch/mips/kernel/relocate.c                   |  17 +-
 arch/mips/kernel/setup.c                      |  36 +--
 arch/mips/pic32/pic32mzda/early_console.c     |   2 +-
 arch/mips/pic32/pic32mzda/init.c              |   3 +-
 arch/x86/Kconfig                              |  44 +---
 arch/x86/kernel/setup.c                       |  18 +-
 .../firmware/efi/libstub/efi-stub-helper.c    |  29 +++
 drivers/firmware/efi/libstub/efi-stub.c       |   9 +
 drivers/firmware/efi/libstub/efistub.h        |   1 +
 drivers/firmware/efi/libstub/x86-stub.c       |  14 +-
 drivers/of/fdt.c                              |  22 +-
 include/linux/cmdline.h                       | 137 ++++++++++
 init/Kconfig                                  |  79 ++++++
 lib/Kconfig                                   |   4 +
 lib/Makefile                                  |   3 +
 lib/generic_cmdline.S                         |  53 ++++
 lib/test_cmdline1.c                           | 139 ++++++++++
 scripts/Makefile                              |   2 +-
 .../{insert-sys-cert.c => insert-symbol.c}    | 243 ++++++++++++------
 38 files changed, 807 insertions(+), 482 deletions(-)
 create mode 100644 include/linux/cmdline.h
 create mode 100644 lib/generic_cmdline.S
 create mode 100644 lib/test_cmdline1.c
 rename scripts/{insert-sys-cert.c => insert-symbol.c} (72%)

-- 
2.39.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 8/8] CMDLINE: arm64: convert to generic builtin command line
  2023-11-10  1:38 [PATCH 0/8] generic command line v6 Daniel Walker
@ 2023-11-10  1:38 ` Daniel Walker
  2023-11-23  6:39   ` Christophe Leroy
  2023-11-10  1:51 ` [PATCH 0/8] generic command line v6 Andrew Morton
  2023-11-23  6:23 ` Christophe Leroy
  2 siblings, 1 reply; 7+ messages in thread
From: Daniel Walker @ 2023-11-10  1:38 UTC (permalink / raw)
  To: Will Deacon, Christophe Leroy, Rob Herring, Daniel Gimpelevich,
	Andrew Morton, Pratyush Brahma, Tomas Mudrunka, Sean Anderson,
	x86, linux-mips, linuxppc-dev, Catalin Marinas
  Cc: xe-linux-external, linux-arm-kernel, linux-kernel

This removes arm64 from the device tree handling of the
command line arguments.

The boot_command_line variable is populated inside the earliest
user of the command line, which is in idreg-override.c.

The device tree should not be needed to do any further handling
of the boot command line options.

Cc: xe-linux-external@cisco.com
Signed-off-by: Daniel Walker <danielwa@cisco.com>
---
 arch/arm64/Kconfig                  | 33 +----------------------------
 arch/arm64/include/asm/setup.h      |  4 ++++
 arch/arm64/include/uapi/asm/setup.h |  2 ++
 arch/arm64/kernel/idreg-override.c  |  9 ++++----
 arch/arm64/kernel/pi/kaslr_early.c  | 14 ++++++------
 5 files changed, 19 insertions(+), 43 deletions(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 78f20e632712..d3b7fd1080d0 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -131,6 +131,7 @@ config ARM64
 	select GENERIC_ALLOCATOR
 	select GENERIC_ARCH_TOPOLOGY
 	select GENERIC_CLOCKEVENTS_BROADCAST
+	select GENERIC_CMDLINE
 	select GENERIC_CPU_AUTOPROBE
 	select GENERIC_CPU_VULNERABILITIES
 	select GENERIC_EARLY_IOREMAP
@@ -2217,38 +2218,6 @@ config ARM64_ACPI_PARKING_PROTOCOL
 	  protocol even if the corresponding data is present in the ACPI
 	  MADT table.
 
-config CMDLINE
-	string "Default kernel command string"
-	default ""
-	help
-	  Provide a set of default command-line options at build time by
-	  entering them here. As a minimum, you should specify the the
-	  root device (e.g. root=/dev/nfs).
-
-choice
-	prompt "Kernel command line type" if CMDLINE != ""
-	default CMDLINE_FROM_BOOTLOADER
-	help
-	  Choose how the kernel will handle the provided default kernel
-	  command line string.
-
-config CMDLINE_FROM_BOOTLOADER
-	bool "Use bootloader kernel arguments if available"
-	help
-	  Uses the command-line options passed by the boot loader. If
-	  the boot loader doesn't provide any, the default kernel command
-	  string provided in CMDLINE will be used.
-
-config CMDLINE_FORCE
-	bool "Always use the default kernel command string"
-	help
-	  Always use the default kernel command string, even if the boot
-	  loader passes other arguments to the kernel.
-	  This is useful if you cannot or don't want to change the
-	  command-line options your boot loader passes to the kernel.
-
-endchoice
-
 config EFI_STUB
 	bool
 
diff --git a/arch/arm64/include/asm/setup.h b/arch/arm64/include/asm/setup.h
index f4af547ef54c..5a8037262cbb 100644
--- a/arch/arm64/include/asm/setup.h
+++ b/arch/arm64/include/asm/setup.h
@@ -3,10 +3,13 @@
 #ifndef __ARM64_ASM_SETUP_H
 #define __ARM64_ASM_SETUP_H
 
+#ifndef __ASSEMBLY__
 #include <linux/string.h>
+#endif
 
 #include <uapi/asm/setup.h>
 
+#ifndef __ASSEMBLY__
 void *get_early_fdt_ptr(void);
 void early_fdt_map(u64 dt_phys);
 
@@ -30,5 +33,6 @@ static inline bool arch_parse_debug_rodata(char *arg)
 	return false;
 }
 #define arch_parse_debug_rodata arch_parse_debug_rodata
+#endif /* __ASSEMBLY__ */
 
 #endif
diff --git a/arch/arm64/include/uapi/asm/setup.h b/arch/arm64/include/uapi/asm/setup.h
index 5d703888f351..f5fc5b806369 100644
--- a/arch/arm64/include/uapi/asm/setup.h
+++ b/arch/arm64/include/uapi/asm/setup.h
@@ -20,7 +20,9 @@
 #ifndef __ASM_SETUP_H
 #define __ASM_SETUP_H
 
+#ifndef __ASSEMBLY__
 #include <linux/types.h>
+#endif
 
 #define COMMAND_LINE_SIZE	2048
 
diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c
index 3addc09f8746..6334a9228909 100644
--- a/arch/arm64/kernel/idreg-override.c
+++ b/arch/arm64/kernel/idreg-override.c
@@ -9,6 +9,7 @@
 #include <linux/ctype.h>
 #include <linux/kernel.h>
 #include <linux/libfdt.h>
+#include <linux/cmdline.h>
 
 #include <asm/cacheflush.h>
 #include <asm/cpufeature.h>
@@ -304,11 +305,11 @@ static __init void parse_cmdline(void)
 {
 	const u8 *prop = get_bootargs_cmdline();
 
-	if (IS_ENABLED(CONFIG_CMDLINE_FORCE) || !prop)
-		__parse_cmdline(CONFIG_CMDLINE, true);
+	strscpy(boot_command_line, prop, COMMAND_LINE_SIZE);
+	cmdline_add_builtin(boot_command_line);
+
+	__parse_cmdline(boot_command_line, true);
 
-	if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && prop)
-		__parse_cmdline(prop, true);
 }
 
 /* Keep checkers quiet */
diff --git a/arch/arm64/kernel/pi/kaslr_early.c b/arch/arm64/kernel/pi/kaslr_early.c
index 17bff6e399e4..1e00bc01fa7a 100644
--- a/arch/arm64/kernel/pi/kaslr_early.c
+++ b/arch/arm64/kernel/pi/kaslr_early.c
@@ -11,6 +11,7 @@
 #include <linux/types.h>
 #include <linux/sizes.h>
 #include <linux/string.h>
+#include <linux/cmdline.h>
 
 #include <asm/archrandom.h>
 #include <asm/memory.h>
@@ -42,7 +43,7 @@ static bool cmdline_contains_nokaslr(const u8 *cmdline)
 
 static bool is_kaslr_disabled_cmdline(void *fdt)
 {
-	if (!IS_ENABLED(CONFIG_CMDLINE_FORCE)) {
+	if (!IS_ENABLED(CONFIG_CMDLINE_OVERRIDE)) {
 		int node;
 		const u8 *prop;
 
@@ -54,16 +55,15 @@ static bool is_kaslr_disabled_cmdline(void *fdt)
 		if (!prop)
 			goto out;
 
+		if (cmdline_contains_nokaslr(CMDLINE_STATIC_APPEND))
+			return true;
 		if (cmdline_contains_nokaslr(prop))
 			return true;
-
-		if (IS_ENABLED(CONFIG_CMDLINE_EXTEND))
-			goto out;
-
-		return false;
+		if (cmdline_contains_nokaslr(CMDLINE_STATIC_PREPEND))
+			return true;
 	}
 out:
-	return cmdline_contains_nokaslr(CONFIG_CMDLINE);
+	return cmdline_contains_nokaslr(cmdline_get_static_builtin());
 }
 
 static u64 get_kaslr_seed(void *fdt)
-- 
2.39.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/8] generic command line v6
  2023-11-10  1:38 [PATCH 0/8] generic command line v6 Daniel Walker
  2023-11-10  1:38 ` [PATCH 8/8] CMDLINE: arm64: convert to generic builtin command line Daniel Walker
@ 2023-11-10  1:51 ` Andrew Morton
  2023-11-10  2:22   ` Daniel Walker (danielwa)
  2023-11-23  6:23 ` Christophe Leroy
  2 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2023-11-10  1:51 UTC (permalink / raw)
  To: Daniel Walker
  Cc: Will Deacon, Christophe Leroy, Rob Herring, Daniel Gimpelevich,
	Pratyush Brahma, Tomas Mudrunka, Sean Anderson, x86, linux-mips,
	linuxppc-dev, H. Peter Anvin, Nathan Chancellor, Nick Desaulniers,
	Nicolas Schier, linux-arm-kernel, linux-kernel, devicetree,
	linux-kbuild, linux-efi

On Thu,  9 Nov 2023 17:38:04 -0800 Daniel Walker <danielwa@cisco.com> wrote:

> This release is an up-rev of the v5 patches. No additional features have
> been added. Some changes were mode to function names and some changes to
> Kconfig dependencies. Also updated the config conversion for mips.
> 
> There are a number of people who have expressed interest in these
> patches either by asking for them to be merge or testing them. If
> people are so inclined please continue to request them to be merge
> or to ask the status of the next release. It's helpful to motivate me to
> release them again and for the maintainers to see the interest
> generated.
> 
> These patches have been used by Cisco Systems, Inc. on millions of
> released products to great effect. Hopefully they can be used by the
> entire Linux eco system.
> 

fyi, none of the above is suitable for a [0/N] changelog - it's all
transitory stuff which tells readers nothing much about what the
patchset does.

And that info is sorely missed.  I can see that it's a code cleanup,
but I'm sure Cisco wouldn't expend resources to maintain such a thing. 
There's something else here.

In [1/8] I see "Even with mips and powerpc enhancement the needs of
Cisco are not met on these platforms" and "This unified implementation
offers the same functionality needed by Cisco on all platform which we
enable it on".

Well OK, what are these needs?   What functionality changes does this
patchset offer which Cisco finds useful?  IOW, what were the
requirements?  What's wrong with the old code and how does this
patchset fix/enhance that?


I see the patchset updates nothing under Documentation/.  Should it do
so?  Could it do so?


I don't know what is the expected merge patch for this work.  I can
grab them if no other maintainer is in the firing line.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/8] generic command line v6
  2023-11-10  1:51 ` [PATCH 0/8] generic command line v6 Andrew Morton
@ 2023-11-10  2:22   ` Daniel Walker (danielwa)
  2023-11-10  2:40     ` Andrew Morton
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Walker (danielwa) @ 2023-11-10  2:22 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Will Deacon, Christophe Leroy, Rob Herring, Daniel Gimpelevich,
	Pratyush Brahma, Tomas Mudrunka, Sean Anderson, x86@kernel.org,
	linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	H. Peter Anvin, Nathan Chancellor, Nick Desaulniers,
	Nicolas Schier, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kbuild@vger.kernel.org, linux-efi@vger.kernel.org

On Thu, Nov 09, 2023 at 05:51:42PM -0800, Andrew Morton wrote:
> On Thu,  9 Nov 2023 17:38:04 -0800 Daniel Walker <danielwa@cisco.com> wrote:
> 
> > This release is an up-rev of the v5 patches. No additional features have
> > been added. Some changes were mode to function names and some changes to
> > Kconfig dependencies. Also updated the config conversion for mips.
> > 
> > There are a number of people who have expressed interest in these
> > patches either by asking for them to be merge or testing them. If
> > people are so inclined please continue to request them to be merge
> > or to ask the status of the next release. It's helpful to motivate me to
> > release them again and for the maintainers to see the interest
> > generated.
> > 
> > These patches have been used by Cisco Systems, Inc. on millions of
> > released products to great effect. Hopefully they can be used by the
> > entire Linux eco system.
> > 
> 
> fyi, none of the above is suitable for a [0/N] changelog - it's all
> transitory stuff which tells readers nothing much about what the
> patchset does.
 
I did not think about it this way. It's because I've submitted this so many
times. I guess I assume everyone knows what it is.

> And that info is sorely missed.  I can see that it's a code cleanup,
> but I'm sure Cisco wouldn't expend resources to maintain such a thing. 
> There's something else here.

I think the prior submissions there was no cover letter, maybe I should just
achoo that entirely.

> In [1/8] I see "Even with mips and powerpc enhancement the needs of
> Cisco are not met on these platforms" and "This unified implementation
> offers the same functionality needed by Cisco on all platform which we
> enable it on".
> 
> Well OK, what are these needs?   What functionality changes does this
> patchset offer which Cisco finds useful?  IOW, what were the
> requirements?  What's wrong with the old code and how does this
> patchset fix/enhance that?

The limitation is that you can't append and prepend to the command line at the
same time in any of the architectures. Having access to both allows OEMs to deal
with broken bootloaders which can't easily be upgraded. Others have responded
that they also use these patches for this same reason.

In 2/8 and 3/8 I modify the insert-sys-cert tool to allow modification of the
command line append and prepend after the build. This allow for an SDK
provided with a binary kernel and for the command line append/prepend to still
be modified identically to how that's done with certificates.

Making all this generic means each platform has a unified set of command line
services. Cisco uses x86/arm32/arm64/mips/powerpc , and it's nice to have all
the same features across platforms.

> 
> I see the patchset updates nothing under Documentation/.  Should it do
> so?  Could it do so?

The only documentation is Kconfig descriptions and commit messages. I suppose it
could have something under Documentation/. The only part which could use more
documentation are the changes in 2/8 and 3/8. That feature is maybe confusing
and has limitations which are maybe not clear. Although the same limitation exist for
inserting certificates.

> 
> I don't know what is the expected merge patch for this work.  I can
> grab them if no other maintainer is in the firing line.

merge patch ? Do you mean merge description ? I think your the maintainer in the
firing line for this one.

Daniel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/8] generic command line v6
  2023-11-10  2:22   ` Daniel Walker (danielwa)
@ 2023-11-10  2:40     ` Andrew Morton
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Morton @ 2023-11-10  2:40 UTC (permalink / raw)
  To: Daniel Walker (danielwa)
  Cc: Will Deacon, Christophe Leroy, Rob Herring, Daniel Gimpelevich,
	Pratyush Brahma, Tomas Mudrunka, Sean Anderson, x86@kernel.org,
	linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	H. Peter Anvin, Nathan Chancellor, Nick Desaulniers,
	Nicolas Schier, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kbuild@vger.kernel.org, linux-efi@vger.kernel.org

On Fri, 10 Nov 2023 02:22:27 +0000 "Daniel Walker (danielwa)" <danielwa@cisco.com> wrote:

> On Thu, Nov 09, 2023 at 05:51:42PM -0800, Andrew Morton wrote:
> > On Thu,  9 Nov 2023 17:38:04 -0800 Daniel Walker <danielwa@cisco.com> wrote:
> > 
> > > This release is an up-rev of the v5 patches. No additional features have
> > > been added. Some changes were mode to function names and some changes to
> > > Kconfig dependencies. Also updated the config conversion for mips.
> > > 
> > > There are a number of people who have expressed interest in these
> > > patches either by asking for them to be merge or testing them. If
> > > people are so inclined please continue to request them to be merge
> > > or to ask the status of the next release. It's helpful to motivate me to
> > > release them again and for the maintainers to see the interest
> > > generated.
> > > 
> > > These patches have been used by Cisco Systems, Inc. on millions of
> > > released products to great effect. Hopefully they can be used by the
> > > entire Linux eco system.
> > > 
> > 
> > fyi, none of the above is suitable for a [0/N] changelog - it's all
> > transitory stuff which tells readers nothing much about what the
> > patchset does.
>  
> I did not think about it this way. It's because I've submitted this so many
> times. I guess I assume everyone knows what it is.

This is all on the path to the mainline git history.  Think about how
we want it presented to future readers.  10 years from now nobody will
remember the v5 series email spray.

> 
> > In [1/8] I see "Even with mips and powerpc enhancement the needs of
> > Cisco are not met on these platforms" and "This unified implementation
> > offers the same functionality needed by Cisco on all platform which we
> > enable it on".
> > 
> > Well OK, what are these needs?   What functionality changes does this
> > patchset offer which Cisco finds useful?  IOW, what were the
> > requirements?  What's wrong with the old code and how does this
> > patchset fix/enhance that?
> 
> The limitation is that you can't append and prepend to the command line at the
> same time in any of the architectures. Having access to both allows OEMs to deal
> with broken bootloaders which can't easily be upgraded.

I would never ever have guessed that from the emails I received!

> Others have responded
> that they also use these patches for this same reason.

Citing this info in the [0/N] would be useful.

> In 2/8 and 3/8 I modify the insert-sys-cert tool to allow modification of the
> command line append and prepend after the build. This allow for an SDK
> provided with a binary kernel and for the command line append/prepend to still
> be modified identically to how that's done with certificates.

And this.

> Making all this generic means each platform has a unified set of command line
> services. Cisco uses x86/arm32/arm64/mips/powerpc , and it's nice to have all
> the same features across platforms.

Sounds good.

> > 
> > I see the patchset updates nothing under Documentation/.  Should it do
> > so?  Could it do so?
> 
> The only documentation is Kconfig descriptions and commit messages. I suppose it
> could have something under Documentation/. The only part which could use more
> documentation are the changes in 2/8 and 3/8. That feature is maybe confusing
> and has limitations which are maybe not clear. Although the same limitation exist for
> inserting certificates.

Perhaps the new functionality could be described in
Documentation/admin-guide/kernel-parameters.rst

> > 
> > I don't know what is the expected merge patch for this work.  I can
> > grab them if no other maintainer is in the firing line.
> 
> merge patch ?

"path", sorry.

> Do you mean merge description ? I think your the maintainer in the
> firing line for this one.

OK.  

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/8] generic command line v6
  2023-11-10  1:38 [PATCH 0/8] generic command line v6 Daniel Walker
  2023-11-10  1:38 ` [PATCH 8/8] CMDLINE: arm64: convert to generic builtin command line Daniel Walker
  2023-11-10  1:51 ` [PATCH 0/8] generic command line v6 Andrew Morton
@ 2023-11-23  6:23 ` Christophe Leroy
  2 siblings, 0 replies; 7+ messages in thread
From: Christophe Leroy @ 2023-11-23  6:23 UTC (permalink / raw)
  To: Daniel Walker, Will Deacon, Rob Herring, Daniel Gimpelevich,
	Andrew Morton, Pratyush Brahma, Tomas Mudrunka, Sean Anderson,
	x86@kernel.org, linux-mips@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, H. Peter Anvin, Nathan Chancellor,
	Nick Desaulniers, Nicolas Schier,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kbuild@vger.kernel.org
  Cc: linux-efi@vger.kernel.org



Le 10/11/2023 à 02:38, Daniel Walker a écrit :
> This release is an up-rev of the v5 patches. No additional features have
> been added. Some changes were mode to function names and some changes to
> Kconfig dependencies. Also updated the config conversion for mips.
> 
> There are a number of people who have expressed interest in these
> patches either by asking for them to be merge or testing them. If
> people are so inclined please continue to request them to be merge
> or to ask the status of the next release. It's helpful to motivate me to
> release them again and for the maintainers to see the interest
> generated.

Good, then lets work all together and get the best of it.

Your series has good features like the update of the command line addons 
without rebuild, including updating of the signature when applicable. 
However your series still has weaknesses it had in previous versions. I 
was hopping we could work all together to improve it, but you have been 
repeatedly telling that my proposal doesn't fit your needs without 
explaining why. Can we work in a more win-win spirit this time ?

By the way, for the record, here is a link to a series I sent out as an 
exemple of what it could look like. The intention at that time was not 
to have a concurrent series, but just to show what I meant in my 
comments, because exemples are often more explicit than words. That 
series was considered more mature and closer to a mergeable state than 
yours at that time. Link to the said series: 
https://patchwork.ozlabs.org/project/linuxppc-dev/list/?state=*&series=237158

Your series only converts a few architectures, and I can't see any 
demonstration that it will be possible to convert other architectures as 
a follow-up without too much pain.

> 
> These patches have been used by Cisco Systems, Inc. on millions of
> released products to great effect. Hopefully they can be used by the
> entire Linux eco system.

This is not an argument. Billions of computers are running Micr*s*ft 
Windows, does it make Windows better ? Do IBM or Google claim about the 
million equipment they are sending out with special Linux features ? 
Showing objectively what's the benefit of your features without 
referring to Cisco would be better.

> 
> My apologies on the length between releases. I will try to release more
> often.

Christophe

> 
> 
> Daniel Walker (8):
>    CMDLINE: add generic builtin command line
>    scripts: insert-sys-cert: add command line insert capability
>    scripts: insert-sys-cert: change name to insert-symbol
>    CMDLINE: mips: convert to generic builtin command line
>    drivers: firmware: efi: libstub: enable generic commandline
>    CMDLINE: x86: convert to generic builtin command line
>    of: replace command line handling
>    CMDLINE: arm64: convert to generic builtin command line
> 
>   arch/arm64/Kconfig                            |  33 +--
>   arch/arm64/include/asm/setup.h                |   4 +
>   arch/arm64/include/uapi/asm/setup.h           |   2 +
>   arch/arm64/kernel/idreg-override.c            |   9 +-
>   arch/arm64/kernel/pi/kaslr_early.c            |  14 +-
>   arch/mips/Kconfig                             |   4 +-
>   arch/mips/Kconfig.debug                       |  44 ----
>   arch/mips/configs/ar7_defconfig               |  12 +-
>   arch/mips/configs/bcm47xx_defconfig           |  10 +-
>   arch/mips/configs/bcm63xx_defconfig           |  21 +-
>   arch/mips/configs/bmips_be_defconfig          |  17 +-
>   arch/mips/configs/bmips_stb_defconfig         | 139 ++++------
>   arch/mips/configs/ci20_defconfig              |   8 +-
>   arch/mips/configs/cu1000-neo_defconfig        |  19 +-
>   arch/mips/configs/cu1830-neo_defconfig        |  19 +-
>   arch/mips/configs/generic_defconfig           |  15 +-
>   arch/mips/configs/gpr_defconfig               |  33 +--
>   arch/mips/configs/loongson3_defconfig         |  29 +--
>   arch/mips/include/asm/setup.h                 |   2 +
>   arch/mips/kernel/relocate.c                   |  17 +-
>   arch/mips/kernel/setup.c                      |  36 +--
>   arch/mips/pic32/pic32mzda/early_console.c     |   2 +-
>   arch/mips/pic32/pic32mzda/init.c              |   3 +-
>   arch/x86/Kconfig                              |  44 +---
>   arch/x86/kernel/setup.c                       |  18 +-
>   .../firmware/efi/libstub/efi-stub-helper.c    |  29 +++
>   drivers/firmware/efi/libstub/efi-stub.c       |   9 +
>   drivers/firmware/efi/libstub/efistub.h        |   1 +
>   drivers/firmware/efi/libstub/x86-stub.c       |  14 +-
>   drivers/of/fdt.c                              |  22 +-
>   include/linux/cmdline.h                       | 137 ++++++++++
>   init/Kconfig                                  |  79 ++++++
>   lib/Kconfig                                   |   4 +
>   lib/Makefile                                  |   3 +
>   lib/generic_cmdline.S                         |  53 ++++
>   lib/test_cmdline1.c                           | 139 ++++++++++
>   scripts/Makefile                              |   2 +-
>   .../{insert-sys-cert.c => insert-symbol.c}    | 243 ++++++++++++------
>   38 files changed, 807 insertions(+), 482 deletions(-)
>   create mode 100644 include/linux/cmdline.h
>   create mode 100644 lib/generic_cmdline.S
>   create mode 100644 lib/test_cmdline1.c
>   rename scripts/{insert-sys-cert.c => insert-symbol.c} (72%)
> 
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 8/8] CMDLINE: arm64: convert to generic builtin command line
  2023-11-10  1:38 ` [PATCH 8/8] CMDLINE: arm64: convert to generic builtin command line Daniel Walker
@ 2023-11-23  6:39   ` Christophe Leroy
  0 siblings, 0 replies; 7+ messages in thread
From: Christophe Leroy @ 2023-11-23  6:39 UTC (permalink / raw)
  To: Daniel Walker, Will Deacon, Rob Herring, Daniel Gimpelevich,
	Andrew Morton, Pratyush Brahma, Tomas Mudrunka, Sean Anderson,
	x86@kernel.org, linux-mips@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, Catalin Marinas
  Cc: xe-linux-external@cisco.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org



Le 10/11/2023 à 02:38, Daniel Walker a écrit :
> This removes arm64 from the device tree handling of the
> command line arguments.

You should provide more details on how each existing Kconfig option is 
converted, for instance when CONFIG_CMDLINE_FORCE becomes 
CONFIG_CMDLINE_OVERRIDE.

> 
> The boot_command_line variable is populated inside the earliest
> user of the command line, which is in idreg-override.c.
> 
> The device tree should not be needed to do any further handling
> of the boot command line options.

should not be ? But what's the result at the end, is it needed or not ?

> 
> Cc: xe-linux-external@cisco.com
> Signed-off-by: Daniel Walker <danielwa@cisco.com>
> ---
>   arch/arm64/Kconfig                  | 33 +----------------------------
>   arch/arm64/include/asm/setup.h      |  4 ++++
>   arch/arm64/include/uapi/asm/setup.h |  2 ++
>   arch/arm64/kernel/idreg-override.c  |  9 ++++----
>   arch/arm64/kernel/pi/kaslr_early.c  | 14 ++++++------
>   5 files changed, 19 insertions(+), 43 deletions(-)
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 78f20e632712..d3b7fd1080d0 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -131,6 +131,7 @@ config ARM64
>   	select GENERIC_ALLOCATOR
>   	select GENERIC_ARCH_TOPOLOGY
>   	select GENERIC_CLOCKEVENTS_BROADCAST
> +	select GENERIC_CMDLINE
>   	select GENERIC_CPU_AUTOPROBE
>   	select GENERIC_CPU_VULNERABILITIES
>   	select GENERIC_EARLY_IOREMAP
> @@ -2217,38 +2218,6 @@ config ARM64_ACPI_PARKING_PROTOCOL
>   	  protocol even if the corresponding data is present in the ACPI
>   	  MADT table.
>   
> -config CMDLINE
> -	string "Default kernel command string"
> -	default ""
> -	help
> -	  Provide a set of default command-line options at build time by
> -	  entering them here. As a minimum, you should specify the the
> -	  root device (e.g. root=/dev/nfs).
> -
> -choice
> -	prompt "Kernel command line type" if CMDLINE != ""
> -	default CMDLINE_FROM_BOOTLOADER
> -	help
> -	  Choose how the kernel will handle the provided default kernel
> -	  command line string.
> -
> -config CMDLINE_FROM_BOOTLOADER
> -	bool "Use bootloader kernel arguments if available"
> -	help
> -	  Uses the command-line options passed by the boot loader. If
> -	  the boot loader doesn't provide any, the default kernel command
> -	  string provided in CMDLINE will be used.
> -
> -config CMDLINE_FORCE
> -	bool "Always use the default kernel command string"
> -	help
> -	  Always use the default kernel command string, even if the boot
> -	  loader passes other arguments to the kernel.
> -	  This is useful if you cannot or don't want to change the
> -	  command-line options your boot loader passes to the kernel.
> -
> -endchoice
> -
>   config EFI_STUB
>   	bool
>   
> diff --git a/arch/arm64/include/asm/setup.h b/arch/arm64/include/asm/setup.h
> index f4af547ef54c..5a8037262cbb 100644
> --- a/arch/arm64/include/asm/setup.h
> +++ b/arch/arm64/include/asm/setup.h
> @@ -3,10 +3,13 @@
>   #ifndef __ARM64_ASM_SETUP_H
>   #define __ARM64_ASM_SETUP_H
>   
> +#ifndef __ASSEMBLY__
>   #include <linux/string.h>
> +#endif
>   
>   #include <uapi/asm/setup.h>
>   
> +#ifndef __ASSEMBLY__
>   void *get_early_fdt_ptr(void);
>   void early_fdt_map(u64 dt_phys);
>   
> @@ -30,5 +33,6 @@ static inline bool arch_parse_debug_rodata(char *arg)
>   	return false;
>   }
>   #define arch_parse_debug_rodata arch_parse_debug_rodata
> +#endif /* __ASSEMBLY__ */
>   
>   #endif
> diff --git a/arch/arm64/include/uapi/asm/setup.h b/arch/arm64/include/uapi/asm/setup.h
> index 5d703888f351..f5fc5b806369 100644
> --- a/arch/arm64/include/uapi/asm/setup.h
> +++ b/arch/arm64/include/uapi/asm/setup.h
> @@ -20,7 +20,9 @@
>   #ifndef __ASM_SETUP_H
>   #define __ASM_SETUP_H
>   
> +#ifndef __ASSEMBLY__
>   #include <linux/types.h>
> +#endif
>   
>   #define COMMAND_LINE_SIZE	2048
>   
> diff --git a/arch/arm64/kernel/idreg-override.c b/arch/arm64/kernel/idreg-override.c
> index 3addc09f8746..6334a9228909 100644
> --- a/arch/arm64/kernel/idreg-override.c
> +++ b/arch/arm64/kernel/idreg-override.c
> @@ -9,6 +9,7 @@
>   #include <linux/ctype.h>
>   #include <linux/kernel.h>
>   #include <linux/libfdt.h>
> +#include <linux/cmdline.h>
>   
>   #include <asm/cacheflush.h>
>   #include <asm/cpufeature.h>
> @@ -304,11 +305,11 @@ static __init void parse_cmdline(void)
>   {
>   	const u8 *prop = get_bootargs_cmdline();
>   
> -	if (IS_ENABLED(CONFIG_CMDLINE_FORCE) || !prop)
> -		__parse_cmdline(CONFIG_CMDLINE, true);
> +	strscpy(boot_command_line, prop, COMMAND_LINE_SIZE);
> +	cmdline_add_builtin(boot_command_line);
> +
> +	__parse_cmdline(boot_command_line, true);
>   
> -	if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && prop)
> -		__parse_cmdline(prop, true);
>   }
>   
>   /* Keep checkers quiet */
> diff --git a/arch/arm64/kernel/pi/kaslr_early.c b/arch/arm64/kernel/pi/kaslr_early.c
> index 17bff6e399e4..1e00bc01fa7a 100644
> --- a/arch/arm64/kernel/pi/kaslr_early.c
> +++ b/arch/arm64/kernel/pi/kaslr_early.c
> @@ -11,6 +11,7 @@
>   #include <linux/types.h>
>   #include <linux/sizes.h>
>   #include <linux/string.h>
> +#include <linux/cmdline.h>
>   
>   #include <asm/archrandom.h>
>   #include <asm/memory.h>
> @@ -42,7 +43,7 @@ static bool cmdline_contains_nokaslr(const u8 *cmdline)
>   
>   static bool is_kaslr_disabled_cmdline(void *fdt)
>   {
> -	if (!IS_ENABLED(CONFIG_CMDLINE_FORCE)) {
> +	if (!IS_ENABLED(CONFIG_CMDLINE_OVERRIDE)) {
>   		int node;
>   		const u8 *prop;
>   
> @@ -54,16 +55,15 @@ static bool is_kaslr_disabled_cmdline(void *fdt)
>   		if (!prop)
>   			goto out;
>   
> +		if (cmdline_contains_nokaslr(CMDLINE_STATIC_APPEND))
> +			return true;
>   		if (cmdline_contains_nokaslr(prop))
>   			return true;
> -
> -		if (IS_ENABLED(CONFIG_CMDLINE_EXTEND))
> -			goto out;
> -
> -		return false;
> +		if (cmdline_contains_nokaslr(CMDLINE_STATIC_PREPEND))
> +			return true;
>   	}
>   out:
> -	return cmdline_contains_nokaslr(CONFIG_CMDLINE);
> +	return cmdline_contains_nokaslr(cmdline_get_static_builtin());
>   }
>   
>   static u64 get_kaslr_seed(void *fdt)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-11-23  6:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-10  1:38 [PATCH 0/8] generic command line v6 Daniel Walker
2023-11-10  1:38 ` [PATCH 8/8] CMDLINE: arm64: convert to generic builtin command line Daniel Walker
2023-11-23  6:39   ` Christophe Leroy
2023-11-10  1:51 ` [PATCH 0/8] generic command line v6 Andrew Morton
2023-11-10  2:22   ` Daniel Walker (danielwa)
2023-11-10  2:40     ` Andrew Morton
2023-11-23  6:23 ` Christophe Leroy

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).