Parse and handle command line from dtb
cover Parse and handle command line from dtb
This patch series initializes bootinfo from dtb and then parse and handle command line from dtb.
This patch series is based on the patch series:
"Register Xen's load address as a boot module" [1]
[1] https://lore.kernel.org/xen-devel/[email protected]/T/#t
Oleksii Kurochko (2):
xen/riscv: initialize bootinfo from dtb
xen/riscv: parse and handle fdt command line
xen/arch/riscv/setup.c | 9 +++++++++ 1 file changed, 9 insertions(+)
Signature · 1 line
2.46.1
PATCH 1/2 xen/riscv: initialize bootinfo from dtb
Parse DTB during startup, allowing memory banks and reserved memory regions to be set up, along with early device tree node ( chosen, "xen,domain", "reserved-memory", etc ) handling.
--- xen/arch/riscv/setup.c | 4 ++++ 1 file changed, 4 insertions(+)
xen/arch/riscv/setup.c +4 -0
@@ -28,6 +28,7 @@ void __init noreturn start_xen(unsigned long bootcpu_id, paddr_t dtb_addr) {struct bootmodule *xen_bootmodule; +size_t fdt_size;remove_identity_mapping ();
@@ -54,6 +55,9 @@ void __init noreturn start_xen(unsigned long bootcpu_id,BUG_ON (!xen_bootmodule); + fdt_size =boot_fdt_info (device_tree_flattened, dtb_addr); +BUG_ON (!fdt_size); +printk ("All set up\n" );machine_halt ();
Signature · 1 line
2.46.1
Re: [PATCH v1 1/2] xen/riscv: initialize bootinfo from dtb
Quoted 11 lines · Oleksii Kurochko
xen/arch/riscv/setup.c +1
-0@@ -28,6 +28,7 @@ void __init noreturn start_xen(unsigned long bootcpu_id, paddr_t dtb_addr) {struct bootmodule *xen_bootmodule; +size_t fdt_size;remove_identity_mapping ();
xen/arch/riscv/setup.c void __init noreturn start_xen(unsigned long bootcpu_id, · line 63
Quoted 9 lines
xen/arch/riscv/setup.c +3
-0@@ -54,6 +55,9 @@ void __init noreturn start_xen(unsigned long bootcpu_id,BUG_ON (!xen_bootmodule); + fdt_size =boot_fdt_info (device_tree_flattened, dtb_addr); +BUG_ON (!fdt_size); +printk ("All set up\n" );machine_halt ();
Looks plausible, and judging from Arm code there'll be an actual use of fdt_size down the road. Or else I would have asked what use the local variable is. In fact, again from looking at Arm code, I now question the need for the xen_bootmodule local var - that has no further use in Arm, and hence that's likely going to be the case for RISC-V, too.
However, may I ask that you limit the dependency trees in what you submit? This series depends on another series, which in turn depends on yet something else, all not yet committed. That's getting unwieldy, I'm afraid.
Jan
Re: [PATCH v1 1/2] xen/riscv: initialize bootinfo from dtb
Quoted 24 lines · Jan Beulich
Quoted 14 lines · Oleksii Kurochko
xen/arch/riscv/setup.c +1
-0@@ -28,6 +28,7 @@ void __init noreturn start_xen(unsigned long bootcpu_id, paddr_t dtb_addr) { struct bootmodule *xen_bootmodule; + size_t fdt_size;
remove_identity_mapping();xen/arch/riscv/setup.c +0
-0@@ -54,6 +55,9 @@ void __init noreturn start_xen(unsigned long bootcpu_id,Quoted 8 lines
BUG_ON(!xen_bootmodule);
+fdt_size=boot_fdt_info(device_tree_flattened, dtb_addr); +BUG_ON(!fdt_size);
+
printk("All set up\n");
machine_halt();
Quoted 8 lines
Looks plausible, and judging from Arm code there'll be an actual use of
fdt_size
down the road. Or else I would have asked what use the local variable is. In
fact, again from looking at Arm code, I now question the need for thexen_bootmodulelocal var - that has no further use in Arm, and hence that's
likely going to be the case for RISC-V, too.
fdt_size and xen_bootmodule are used only for BUG_ON() now and in future ( the same as you mentioned as in Arm ). They could be dropped. I'll do that in the next patch version.
Quoted 6 lines
However, may I ask that you limit the dependency trees in what you submit? This
series depends on another series, which in turn depends on yet something else,
all not yet committed. That's getting unwieldy, I'm afraid.
Sure, sorry for that. I will limit the depedency trees in future.
~ Oleksii
PATCH 2/2 xen/riscv: parse and handle fdt command line
In reply to Oleksii KurochkoReceive Xen's command line passed by DTB using boot_fdt_cmdline() and passed it to cmdline_parse() for further procesinng and setup of Xen-specific parameters.
--- xen/arch/riscv/setup.c | 5 +++++ 1 file changed, 5 insertions(+)
xen/arch/riscv/setup.c +5 -0
@@ -29,6 +29,7 @@ void __init noreturn start_xen(unsigned long bootcpu_id, {struct bootmodule *xen_bootmodule;size_t fdt_size; +const char *cmdline;remove_identity_mapping ();
@@ -58,6 +59,10 @@ void __init noreturn start_xen(unsigned long bootcpu_id, fdt_size =boot_fdt_info (device_tree_flattened, dtb_addr);BUG_ON (!fdt_size); + cmdline =boot_fdt_cmdline (device_tree_flattened); +printk ("Command line: %s\n" , cmdline); +cmdline_parse (cmdline); +printk ("All set up\n" );machine_halt ();
Signature · 1 line
2.46.1
Re: [PATCH v1 2/2] xen/riscv: parse and handle fdt command line
Quoted 5 lines · Oleksii Kurochko
Receive Xen's command line passed by DTB using
boot_fdt_cmdline()and passed it tocmdline_parse()for further procesinng and setup of Xen-specific parameters.Signed-off-by Oleksii Kurochko <[email protected]>