[PATCH kvmtool] arm: Allow command line for firmware

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux