qemu-patch-raspberry4/hw/ppc
Markus Armbruster 36ad0e948e Fix -machine options accel, kernel_irqchip, kvm_shadow_mem
Multiple -machine options with the same ID are merged.  All but the
one without an ID are to be silently ignored.

In most places, we query these options with a null ID.  This is
correct.

In some places, we instead query whatever options come first in the
list.  This is wrong.  When the -machine processed first happens to
have an ID, options are taken from that ID, and the ones specified
without ID are silently ignored.

Example:

    $ upstream-qemu -nodefaults -S -display none -monitor stdio -machine id=foo -machine accel=kvm,usb=on
    $ upstream-qemu -nodefaults -S -display none -monitor stdio -machine id=foo,accel=kvm,usb=on -machine accel=xen
    $ upstream-qemu -nodefaults -S -display none -monitor stdio -machine accel=xen -machine id=foo,accel=kvm,usb=on

    $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -machine accel=kvm,usb=on
    QEMU 1.5.50 monitor - type 'help' for more information
    (qemu) info kvm
    kvm support: enabled
    (qemu) info usb
    (qemu) q
    $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -machine id=foo -machine accel=kvm,usb=on
    QEMU 1.5.50 monitor - type 'help' for more information
    (qemu) info kvm
    kvm support: disabled
    (qemu) info usb
    (qemu) q
    $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -machine id=foo,accel=kvm,usb=on -machine accel=xen
    QEMU 1.5.50 monitor - type 'help' for more information
    (qemu) info kvm
    kvm support: enabled
    (qemu) info usb
    USB support not enabled
    (qemu) q
    $ qemu-system-x86_64 -nodefaults -S -display none -monitor stdio -machine accel=xen -machine id=foo,accel=kvm,usb=on
    xc: error: Could not obtain handle on privileged command interface (2 = No such file or directory): Internal error
    xen be core: can't open xen interface
    failed to initialize Xen: Operation not permitted

Option usb is queried correctly, and the one without an ID wins,
regardless of option order.

Option accel is queried incorrectly, and which one wins depends on
option order and ID.

Affected options are accel (and its sugared forms -enable-kvm and
-no-kvm), kernel_irqchip, kvm_shadow_mem.

Additionally, option kernel_irqchip is normally on by default, except
it's off when no -machine options are given.  Bug can't bite, because
kernel_irqchip is used only when KVM is enabled, KVM is off by
default, and enabling always creates -machine options.  Downstreams
that enable KVM by default do get bitten, though.

Use qemu_get_machine_opts() to fix these bugs.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-id: 1372943363-24081-5-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-09 13:38:58 -05:00
..
e500-ccsr.h ppc: do not use ../ in include files 2013-03-01 13:57:33 +01:00
e500.c Fix -machine options accel, kernel_irqchip, kvm_shadow_mem 2013-07-09 13:38:58 -05:00
e500.h PPC: e500: Select MPIC v4.2 on ppce500 platform 2013-01-25 22:02:56 +01:00
e500plat.c PPC: e500: advertise 4.2 MPIC only if KVM supports EPR 2013-04-26 23:02:40 +02:00
mac.h hw: move headers to include/ 2013-04-08 18:13:10 +02:00
mac_newworld.c pci,misc enhancements 2013-07-08 08:00:23 -05:00
mac_oldworld.c pci,misc enhancements 2013-07-08 08:00:23 -05:00
Makefile.objs hw: move NVRAM interfaces to hw/nvram/, configure with default-configs/ 2013-04-08 18:13:16 +02:00
mpc8544_guts.c hw/p*: pass owner to memory_region_init* functions 2013-07-04 17:42:48 +02:00
mpc8544ds.c hw: move headers to include/ 2013-04-08 18:13:10 +02:00
ppc.c hw: move headers to include/ 2013-04-08 18:13:10 +02:00
ppc4xx_devs.c memory: add owner argument to initialization functions 2013-07-04 17:42:44 +02:00
ppc4xx_pci.c hw/p*: pass owner to memory_region_init* functions 2013-07-04 17:42:48 +02:00
ppc405.h hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
ppc405_boards.c memory: add owner argument to initialization functions 2013-07-04 17:42:44 +02:00
ppc405_uc.c memory: add owner argument to initialization functions 2013-07-04 17:42:44 +02:00
ppc440_bamboo.c pci: Add root bus parameter to pci_nic_init() 2013-07-07 23:10:57 +03:00
ppc_booke.c booke_ppc: limit booke timer to max when timeout overflow 2013-07-01 01:11:16 +02:00
ppce500_spin.c hw/p*: pass owner to memory_region_init* functions 2013-07-04 17:42:48 +02:00
prep.c pci,misc enhancements 2013-07-08 08:00:23 -05:00
spapr.c pci,misc enhancements 2013-07-08 08:00:23 -05:00
spapr_events.c spapr-rtas: add CPU argument to RTAS calls 2013-07-01 01:11:16 +02:00
spapr_hcall.c spapr-rtas: add CPU argument to RTAS calls 2013-07-01 01:11:16 +02:00
spapr_iommu.c spapr_iommu: pass device to spapr_tce_new_table and use it to set owner 2013-07-04 17:42:47 +02:00
spapr_pci.c pci,misc enhancements 2013-07-08 08:00:23 -05:00
spapr_rtas.c spapr-rtas: add CPU argument to RTAS calls 2013-07-01 01:11:16 +02:00
spapr_vio.c spapr_iommu: pass device to spapr_tce_new_table and use it to set owner 2013-07-04 17:42:47 +02:00
virtex_ml507.c memory: add owner argument to initialization functions 2013-07-04 17:42:44 +02:00
xics.c spapr-rtas: add CPU argument to RTAS calls 2013-07-01 01:11:16 +02:00