From a1403e9384c6fb4a330645d7c0d7411d26d9f6c6 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Sun, 20 Nov 2022 10:42:05 -0700 Subject: [PATCH] boot-qemu.py: Combine aarch64 machine flags Two '-machine' arguments looks odd, especially since the gic-version parameter is specified on the first '-machine' instance. Append 'virtualization=true' to the existing machine string in a similar manner to 'gic-version' to keep everything uniform. Additionally, add a comment around why and where 'virtualization=true' is specified. Signed-off-by: Nathan Chancellor --- boot-qemu.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/boot-qemu.py b/boot-qemu.py index 40dba4e..d29e76b 100755 --- a/boot-qemu.py +++ b/boot-qemu.py @@ -434,7 +434,7 @@ def get_qemu_args(cfg): kernel_arch = "arm64" kernel_image = "Image.gz" qemu = "qemu-system-aarch64" - qemu_args += ["-machine", "virt,gic-version=max"] + machine = "virt,gic-version=max" if not use_kvm: cpu = "max" @@ -458,7 +458,11 @@ def get_qemu_args(cfg): cpu += ",pauth-impdef=true" qemu_args += ["-cpu", cpu] - qemu_args += ["-machine", "virtualization=true"] + # Boot with VHE emulation, which allows the kernel to run at EL2. + # KVM does not emulate VHE, so this cannot be unconditional. + machine += ",virtualization=true" + + qemu_args += ["-machine", machine] elif arch == "m68k": append += " console=ttyS0,115200"