hw/arm/virt: Make host as default CPU type on AArch64
PATCH 1/1 hw/arm/virt: Make host as default CPU type on AArch64
Currently mach-virt machine model uses cortex-a15 as default CPU when -cpu option is missing. This caused confusion to certain virt tools (e.g. libvirt, virt-install) which don't suppply -cpu option while invoking qemu-kvm. To solve this problem this patch changes the default CPU type to "host" when target is AArch64.
NOTE: It doesn't use "cortex-a57" as default CPU type because cortex-a57 doesn't work on some 64bit ARM machine, such as APM Mustang. "host" is a safe bet for all AArch64 machines.
--- hw/arm/virt.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/arm/virt.c +4 -0
@@ -731,7 +731,11 @@ static void machvirt_init(MachineState *machine)char **cpustr;if (!cpu_model) { +#if defined(TARGET_AARCH64 ) + cpu_model ="host" ; +#else cpu_model ="cortex-a15" ; +#endif }/* Separate the actual CPU model name from any appended features */
Signature · 1 line
1.8.3.1
Quoted 9 lines · Wei Huang
Currently mach-virt machine model uses cortex-a15 as default CPU when -cpu option is missing. This caused confusion to certain virt tools (e.g. libvirt, virt-install) which don't suppply -cpu option while invoking qemu-kvm. To solve this problem this patch changes the default CPU type to "host" when target is AArch64.
NOTE: It doesn't use "cortex-a57" as default CPU type because cortex-a57 doesn't work on some 64bit ARM machine, such as APM Mustang. "host" is a safe bet for all AArch64 machines.
This won't work if you're not using KVM, since 'host' isn't a valid CPU type there, and it will break working command lines as well. Also it breaks the current invariant of "command lines on qemu-system-arm also work on qemu-system-aarch64". I don't like the place we've ended up with the command line setup for the 64-bit virt board, but I don't think this is the correct fix...
-- PMM