aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2019-01-25 15:43:08 +0000
committerWill Deacon <will.deacon@arm.com>2019-02-01 10:35:45 +0000
commit5e4b563d75b9b46fc70cf42f59230c2a79fbcc55 (patch)
treefd728b4a5ebbead52fdf4527c6b72d7c5de734d5
parenteb41dfc9d8e5a27e09bfbec9c01aab7f33033f3f (diff)
downloadkvmtool-5e4b563d75b9b46fc70cf42f59230c2a79fbcc55.tar.gz
arm: Allow command line for firmware
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> Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--arm/fdt.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/arm/fdt.c b/arm/fdt.c
index 7c50464a..763ce467 100644
--- a/arm/fdt.c
+++ b/arm/fdt.c
@@ -132,14 +132,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));