• A
    hw/arm/virt: fix cmdline parsing bug with CPU options and smp > 1 · 886bc7a0
    Ard Biesheuvel 提交于
    The recently introduced feature that allows 32 bit guests to be
    executed under KVM on a 64-bit host incorrectly handles the case
    where more than 1 cpu is specified using '-smp N'
    
    For instance, this invocation of qemu
    
      qemu-system-aarch64 -M virt -cpu cortex-a57,aarch64=off -smp 2
    
    produces the following error
    
      qemu-system-aarch64: Expected key=value format, found aarch64
    
    which is caused by the destructive parsing performed by
    cpu_common_parse_features(), resulting in subsequent attempts
    to parse the CPU option string (for each additional CPU) to fail.
    
    So duplicate the string before parsing it, and free it directly
    afterwards.
    Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
    Reviewed-by: NGreg Bellows <greg.bellows@linaro.org>
    Message-id: 1425402380-10488-1-git-send-email-ard.biesheuvel@linaro.org
    Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
    886bc7a0
virt.c 31.3 KB