diff options
author | Alexandru Elisei <alexandru.elisei@arm.com> | 2021-09-23 15:44:58 +0100 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2021-10-12 09:40:46 +0100 |
commit | 638630c9f7a364a7601e6ee8b50cd1299e6f9e7d (patch) | |
tree | f1876c2a914c054505f5c9db97fbdd264fa9f405 | |
parent | 6cbec43ef88d88f527c6e8a9f4a412e566f45b72 (diff) | |
download | kvmtool-638630c9f7a364a7601e6ee8b50cd1299e6f9e7d.tar.gz |
builtin-run: Do not attempt to find vmlinux if --firmware
kvm->vmlinux is used by symbol.c on x86 to translate a PC address to a
kernel symbol when kvmtool exits unexpectedly. When the --firmware argument
is used, a kernel image is not used for the VM, and the vmlinux file has no
relevance in this case.
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
Link: https://lore.kernel.org/r/20210923144505.60776-4-alexandru.elisei@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r-- | builtin-run.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin-run.c b/builtin-run.c index 083c7a2a..6a55e34a 100644 --- a/builtin-run.c +++ b/builtin-run.c @@ -528,8 +528,10 @@ static struct kvm *kvm_cmd_run_init(int argc, const char **argv) } } - kvm->cfg.vmlinux_filename = find_vmlinux(); - kvm->vmlinux = kvm->cfg.vmlinux_filename; + if (kvm->cfg.kernel_filename) { + kvm->cfg.vmlinux_filename = find_vmlinux(); + kvm->vmlinux = kvm->cfg.vmlinux_filename; + } if (kvm->cfg.nrcpus == 0) kvm->cfg.nrcpus = nr_online_cpus; |