All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH kvmtool] arm: Allow command line for firmware
@ 2019-01-25 15:43 Andre Przywara
  2019-01-30 18:20 ` Will Deacon
  0 siblings, 1 reply; 5+ messages in thread
From: Andre Przywara @ 2019-01-25 15:43 UTC (permalink / raw)
  To: Will Deacon; +Cc: kvmarm, kvm

When loading a firmware instead of a kernel, we can still pass on any
*user-provided* command line, as /chosen/bootargs is a generic device tree
feature. We just need to make sure to not pass our mangled-for-Linux
version.

This allows to run "firmware" images which make use of a command line,
still are not Linux kernels, like kvm-unit-tests.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
Hi Will,

this goes on top of Julien's firmware series (which did not yet appear
on kernel.org?)
This fixes an issue with some kvm-unit-tests support. [1]

Cheers,
Andre.

[1] https://lists.cs.columbia.edu/pipermail/kvmarm/2019-January/034251.html

 arm/fdt.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/arm/fdt.c b/arm/fdt.c
index e3a7a647..a1f8e912 100644
--- a/arm/fdt.c
+++ b/arm/fdt.c
@@ -163,14 +163,11 @@ static int setup_fdt(struct kvm *kvm)
 	_FDT(fdt_begin_node(fdt, "chosen"));
 	_FDT(fdt_property_cell(fdt, "linux,pci-probe-only", 1));
 
+	/* Pass on our amended command line to a Linux kernel only. */
 	if (kvm->cfg.firmware_filename) {
-		/*
-		 * When using a firmware, command line is not passed through DT,
-		 * or the firmware can add it itself
-		 */
 		if (kvm->cfg.kernel_cmdline)
-			pr_warning("Ignoring custom bootargs: %s\n",
-				   kvm->cfg.kernel_cmdline);
+			_FDT(fdt_property_string(fdt, "bootargs",
+						 kvm->cfg.kernel_cmdline));
 	} else
 		_FDT(fdt_property_string(fdt, "bootargs",
 					 kvm->cfg.real_cmdline));
-- 
2.17.1

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

end of thread, other threads:[~2019-01-31 13:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25 15:43 [PATCH kvmtool] arm: Allow command line for firmware Andre Przywara
2019-01-30 18:20 ` Will Deacon
2019-01-31 13:07   ` Andrew Jones
2019-01-31 13:48     ` Andre Przywara
2019-01-31 13:40   ` Julien Thierry

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.