summaryrefslogtreecommitdiffstats
path: root/hw/ppc
Commit message (Collapse)AuthorAgeFilesLines
* spapr-pci: Enable huge BARsAlexey Kardashevskiy2015-03-092-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment sPAPR only supports 512MB window for MMIO BARs. However modern devices might want bigger 64bit BARs. This extends MMIO window from 512MB to 62GB (aligned to SPAPR_PCI_WINDOW_SPACING) and advertises it in 2 records in the PHB "ranges" property. 32bit gets the space from SPAPR_PCI_MEM_WIN_BUS_OFFSET till the end of 4GB, 64bit gets the rest of the space. If no space is left, 64bit range is not advertised. The MMIO space size is set to old value of 0x20000000 by default for pseries machines older than 2.3. The approach changes the device tree which is a guest visible change, however it won't break migration as: 1. we do not support migration to older QEMU versions 2. migration to newer QEMU will migrate the device tree as well and since the new layout only extends the old one and does not change address mappigns, no breakage is expected here too. SLOF change is required to utilize this extension. Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
* spapr: Add pseries-2.3 machineAlexey Kardashevskiy2015-03-091-2/+17
| | | | | | | | | The next patch will make MMIO space bigger and keep the old value for older pseries machines. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
* pseries: Limit PCI host bridge "index" valueDavid Gibson2015-03-091-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | pseries guests can have large numbers of PCI host bridges. To avoid the user having to specify a number of different configuration values for every one, the device supports an "index" property which is a shorthand setting the various window and configuration addresses from a predefined sensible set. There are some problems with the details at present: * The "index" propery is signed, but negative values will create PCI windows below where we expect, potentially colliding with other devices * No limit is imposed on the "index" property and large values can translate to extremely large window addresses. With PCI passthrough in particular this can mean we exceed various mapping and physical address limits causing the guest host bridge to not work in strange ways. This patch addresses this, by making "index" unsigned, and imposing a limit. Currently the limit allows indices from 0..255 which is probably enough host bridges for the time being. It's fairly easy to extend if we discover we need more. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* spapr_vio/spapr_iommu: Move VIO bypass where it belongsAlexey Kardashevskiy2015-03-092-12/+42
| | | | | | | | | | | | | | | | | | | | Instead of tweaking a TCE table device by adding there a bypass flag, let's add an alias to RAM and IOMMU memory region, and enable/disable those according to the selected bypass mode. This way IOMMU memory region can have size of the actual window rather than ram_size which is essential for upcoming DDW support. This moves bypass logic to VIO layer and keeps @bypass flag in TCE table for migration compatibility only. This replaces spapr_tce_set_bypass() calls with explicit assignment to avoid confusion as the function could do something more that just syncing the @bypass flag. This adds a pointer to VIO device into the sPAPRTCETable struct to provide the sPAPRTCETable device a way to update bypass mode for the VIO device. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
* Merge remote-tracking branch 'remotes/ehabkost/tags/numa-pull-request' into ↵Peter Maydell2015-03-021-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging NUMA fixes queue # gpg: Signature made Mon Feb 23 19:28:42 2015 GMT using RSA key ID 984DC5A6 # gpg: Can't check signature: public key not found * remotes/ehabkost/tags/numa-pull-request: numa: Rename set_numa_modes() to numa_post_machine_init() numa: Rename option parsing functions numa: Move QemuOpts parsing to set_numa_nodes() numa: Make max_numa_nodeid static numa: Move NUMA globals to numa.c vl.c: Remove unnecessary zero-initialization of NUMA globals numa: Move NUMA declarations from sysemu.h to numa.h Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * numa: Move NUMA declarations from sysemu.h to numa.hEduardo Habkost2015-02-231-0/+1
| | | | | | | | | | | | | | | | | | | | Not all sysemu.h users need the NUMA declarations, and keeping them in a separate file makes it easier to see what are the interfaces provided by numa.c. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
* | Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20150218-1' into ↵Peter Maydell2015-02-252-4/+10
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staging usb: error handling fixes from Markus, make sysbus ehci arm-only. # gpg: Signature made Wed Feb 18 09:54:13 2015 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-usb-20150218-1: Make sysbus EHCI devices ARM only by default PPC: Don't use legacy -usbdevice support for setting up board r2d: Don't use legacy -usbdevice support for setting up board usb: Change usb_create_simple() to abort on failure usb: Suppress bogus error when automatic usb-hub creation fails usb: Do not prefix error_setg() messages with "Error: " usb: Improve -usbdevice error reporting a bit usb: usb_create() can't fail, drop useless error handling Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * | PPC: Don't use legacy -usbdevice support for setting up boardMarkus Armbruster2015-02-182-4/+10
| |/ | | | | | | | | | | | | | | | | | | | | | | It's tempting, because usbdevice_create() is so simple to use. But there's a lot of unwanted complexity behind the simple interface. Switch to usb_create_simple(). Cc: Alexander Graf <agraf@suse.de> Cc: qemu-ppc@nongnu.org Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell2015-02-241-0/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - vhost-scsi: add bootindex property - RCU: fix MemoryRegion lifetime issues in PCI; document the rules; convert of AddressSpaceDispatch and RAMList - KVM: add kvm_exit reasons for aarch64 # gpg: Signature made Mon Feb 16 16:32:32 2015 GMT using RSA key ID 78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: (21 commits) Convert ram_list to RCU exec: convert ram_list to QLIST cosmetic changes preparing for the following patches exec: protect mru_block with RCU rcu: add g_free_rcu rcu: introduce RCU-enabled QLIST exec: RCUify AddressSpaceDispatch exec: make iotlb RCU-friendly exec: introduce cpu_reload_memory_map docs: clarify memory region lifecycle pci: split shpc_cleanup and shpc_free pcie: remove mmconfig memory leak and wrap mmconfig update with transaction memory: keep the owner of the AddressSpace alive until do_address_space_destroy rcu: run RCU callbacks under the BQL rcu: do not let RCU callbacks pile up indefinitely vhost-scsi: set the bootable value of channel/target/lun vhost-scsi: add a property for booting vhost-scsi: expose the TYPE_FW_PATH_PROVIDER interface vhost-scsi: add bootindex property qdev: support to get a device firmware path directly ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * exec: RCUify AddressSpaceDispatchPaolo Bonzini2015-02-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | Note that even after this patch, most callers of address_space_* functions must still be under the big QEMU lock, otherwise the memory region returned by address_space_translate can disappear as soon as address_space_translate returns. This will be fixed in the next part of this series. Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* | spapr_vio: Pair g_malloc() with g_free(), not free()Markus Armbruster2015-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | Spotted by Coverity with preview checker ALLOC_FREE_MISMATCH enabled and my "coverity: Model g_free() isn't necessarily free()" model patch applied. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* | fw_cfg: fix typos in comments: patch -> pathGonglei2015-02-101-1/+1
|/ | | | | Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* hw/ppc/mac_newworld: simplify usb controller creation logicMarcel Apfelbaum2015-01-071-2/+2
| | | | | | | Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* hw/ppc/spapr: simplify usb controller creation logicMarcel Apfelbaum2015-01-071-1/+2
| | | | | | | Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* hw/ppc/mac_newworld: QOMified mac99 machinesMarcel Apfelbaum2015-01-071-10/+19
| | | | | | | Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* hw/usb: simplified usb_enabledMarcel Apfelbaum2015-01-074-4/+4
| | | | | | | | | | The argument is not longer used and the implementation uses now QOM instead of QemuOpts. Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* hw/ppc: modified the condition for usb controllers to be created for some ↵Marcel Apfelbaum2015-01-072-2/+3
| | | | | | | | | | | | | | | | | | | | | | ppc machines Some ppc machines create a default usb controller based on a 'machine condition'. Until now the logic was: create the usb controller if: - the usb option was supplied in cli and value is true or - the usb option was absent and both set_defaults and the machine condition were true. Modified the logic to: Create the usb controller if: - the machine condition is true and defaults are enabled or - the usb option is supplied and true. The main for this is to simplify the usb_enabled method. Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* target-ppc: Cast ssize_t to size_t before printing with %zxPeter Maydell2015-01-071-1/+1
| | | | | | | | | The mingw32 compiler complains about trying to print variables of type ssize_t with the %z format string specifier. Since we're printing it as unsigned hex anyway, cast to size_t to silence the warning. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* PPC: e500: Fix GPIO controller interrupt numberAmit Tomar2015-01-071-1/+1
| | | | | | | | | | | The GPIO controller lives at IRQ 47, not 43 on real hardware. This is a problem because IRQ 43 is occupied by the I2C controller which we want to implement next, so we'd have a conflict on that IRQ number. Move the GPIO controller to IRQ 47 where it belongs. Signed-off-by: Amit Singh Tomar <amit.tomar@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* PPC: Fix crash on spapr_tce_table_finalize()David Gibson2015-01-071-3/+3
| | | | | | | | | | | | | | | | | spapr_tce_table_finalize() can SEGV if the object was not previously realized. In particular this can be triggered by running qemu-system-ppc -device spapr-tce-table,? The basic problem is that we have mismatched initialization versus finalization: spapr_tce_table_finalize() is attempting to undo things that are done in spapr_tce_table_realize(), not an instance_init function. Therefore, replace spapr_tce_table_finalize() with spapr_tce_table_unrealize(). Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Cc: qemu-stable@nongnu.org Signed-off-by: Alexander Graf <agraf@suse.de>
* ppc: do not use get_clock_realtime()Paolo Bonzini2015-01-071-2/+2
| | | | | | | Use the external qemu-timer API instead. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* spapr: Fix stale HTAB during live migration (TCG)Samuel Mendoza-Jonas2015-01-071-5/+11
| | | | | | | | | | | | If a TCG guest reboots during a running migration HTAB entries are not marked dirty, and the destination boots with an invalid HTAB. When a reboot occurs, explicitly mark the current HTAB dirty after clearing it. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
* spapr: Fix integer overflow during migration (TCG)Samuel Mendoza-Jonas2015-01-071-3/+3
| | | | | | | | | | | The n_valid and n_invalid fields are unsigned short integers but it is possible to have more than 65535 entries in a contiguous hunk, overflowing the field. This results in an incorrect HTAB being sent to the destination during migration. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
* spapr: Fix stale HTAB during live migration (KVM)Samuel Mendoza-Jonas2015-01-071-0/+38
| | | | | | | | | | | If a guest reboots during a running migration, changes to the hash page table are not necessarily updated on the destination. Opening a new file descriptor to the HTAB forces the migration handler to resend the entire table. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
* PPC: e500 pci host: Add support for ATMUsAlexander Graf2015-01-074-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | The e500 PCI controller has configurable windows that allow a guest OS to selectively map parts of the PCI bus space to CPU address space and to selectively map parts of the CPU address space for DMA requests into PCI visible address ranges. So far, we've simply assumed that this mapping is 1:1 and ignored it. However, the PCICSRBAR (CCSR mapped in PCI bus space) always has to live inside the first 32bits of address space. This means if we always treat all mappings as 1:1, this map will collide with our RAM map from the CPU's point of view. So this patch adds proper ATMU support which allows us to keep the PCICSRBAR below 32bits local to the PCI bus and have another, different window to PCI BARs at the upper end of address space. We leverage this on e500plat though, mpc8544ds stays virtually 1:1 like it was before, but now also goes via ATMU. With this patch, I can run guests with lots of RAM and not coincidently access MSI-X mappings while I really want to access RAM. Signed-off-by: Alexander Graf <agraf@suse.de>
* PPC: mpc8554ds: Tell user about exceeding RAM limitsAlexander Graf2015-01-071-0/+6
| | | | | | | | | The mpc8544ds board only supports up to 3GB of RAM due to its limited address space. When the user requests more, abort and tell him that he should use less. Signed-off-by: Alexander Graf <agraf@suse.de>
* PPC: e500: Move CCSR and MMIO space to upper end of address spaceAlexander Graf2015-01-071-3/+3
| | | | | | | | | | | | | | | On e500 we're basically guaranteed to have 36bits of physical address space available for our enjoyment. Older chips (like the mpc8544) only had 32bits, but everything from e500v2 onwards bumped it up. It's reasonably safe to assume that if you're using the PV machine, your guest kernel is configured to support 36bit physical address space. So in order to support more guest RAM, we can move CCSR and other MMIO windows right below the end of our 36bit address space, just like later SoC versions of e500 do. With this patch, I'm able to successfully spawn an e500 VM with -m 48G. Signed-off-by: Alexander Graf <agraf@suse.de>
* PPC: e500: Move CCSR definition to paramsAlexander Graf2015-01-074-16/+23
| | | | | | | | We want to have different MMIO region offsets for the mpc8544ds machine and our e500 PV machine, so move the definitions of those into the machine specific params struct. Signed-off-by: Alexander Graf <agraf@suse.de>
* Merge remote-tracking branch ↵Peter Maydell2014-12-233-2/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/pmaydell/tags/pull-target-arm-20141223' into staging target-arm queue: * enable 32-bit EL3 (TrustZone) for vexpress and virt boards * add fw_cfg device to virt board for UEFI firmware config * support passing commandline kernel/initrd to firmware # gpg: Signature made Tue 23 Dec 2014 13:50:33 GMT using RSA key ID 14360CDE # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" * remotes/pmaydell/tags/pull-target-arm-20141223: (31 commits) hw/arm/virt: enable passing of EFI-stubbed kernel to guest UEFI firmware hw/arm: pass pristine kernel image to guest firmware over fw_cfg hw/loader: split out load_image_gzipped_buffer() arm: add fw_cfg to "virt" board fw_cfg_mem: expose the "data_width" property with fw_cfg_init_mem_wide() fw_cfg_mem: introduce the "data_width" property exec: allows 8-byte accesses in subpage_ops fw_cfg_mem: flip ctl_mem_ops and data_mem_ops to DEVICE_BIG_ENDIAN fw_cfg_mem: max access size and region size are the same for data register fw_cfg: move boards to fw_cfg_init_io() / fw_cfg_init_mem() fw_cfg: hard separation between the MMIO and I/O port mappings target-arm: add cpu feature EL3 to CPUs with Security Extensions target-arm: Disable EL3 on unsupported machines target-arm: Breakout integratorcp and versatilepb cpu init target-arm: Set CPU has_el3 prop during virt init target-arm: Enable CPU has_el3 prop during VE init target-arm: Add arm_boot_info secure_boot control target-arm: Add ARMCPU secure property target-arm: Add feature unset function target-arm: Add virt machine secure property ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * fw_cfg: move boards to fw_cfg_init_io() / fw_cfg_init_mem()Laszlo Ersek2014-12-222-2/+2
| | | | | | | | | | | | | | | | | | | | This allows us to drop the fw_cfg_init() shim and to enforce the possible mappings at compile time. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1419250305-31062-3-git-send-email-pbonzini@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * machine: remove qemu_machine_opts global listMarcel Apfelbaum2014-12-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | QEMU has support for options per machine, keeping a global list of options is no longer necessary. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Greg Bellows <greg.bellows@linaro.org> Message-id: 1418217570-15517-2-git-send-email-marcel.a@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* | Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20141222.0' ↵Peter Maydell2014-12-231-1/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into staging VFIO updates: - Conversion to tracepoints (Eric Auger) - Fix memory listener address space (Frank Blaschka) - Move to hw/vfio/ and split common vs pci (Eric Auger & Kim Phillips) - Trivial error_report() fixes (Alex Williamson) In addition to enabling S390 with the address space fix and updating to use tracepoints rather than compile time debug, this set of patches moves hw/misc/vfio.c to hw/vfio/ and paves the way for vfio-platform support by splitting common functionality from PCI specific code. # gpg: Signature made Mon 22 Dec 2014 20:19:43 GMT using RSA key ID 3BB08B22 # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" # gpg: aka "Alex Williamson <alex@shazbot.org>" # gpg: aka "Alex Williamson <alwillia@redhat.com>" # gpg: aka "Alex Williamson <alex.l.williamson@gmail.com>" * remotes/awilliam/tags/vfio-update-20141222.0: vfio: Cleanup error_report()s hw/vfio: create common module hw/vfio/pci: use name field in format strings hw/vfio/pci: rename group_list into vfio_group_list hw/vfio/pci: split vfio_get_device hw/vfio/pci: Introduce VFIORegion hw/vfio/pci: handle reset at VFIODevice hw/vfio/pci: add type, name and group fields in VFIODevice hw/vfio/pci: introduce minimalist VFIODevice with fd hw/vfio/pci: generalize mask/unmask to any IRQ index hw/vfio/pci: Rename VFIODevice into VFIOPCIDevice vfio: move hw/misc/vfio.c to hw/vfio/pci.c Move vfio.h into include/hw/vfio vfio: fix adding memory listener to the right address space vfio: migration to trace points Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * vfio: move hw/misc/vfio.c to hw/vfio/pci.c Move vfio.h into include/hw/vfioKim Phillips2014-12-191-1/+1
| | | | | | | | | | | | | | | | This is done in preparation for the addition of VFIO platform device support. Signed-off-by: Kim Phillips <kim.phillips@linaro.org> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* | bootdevice: add Error **errp argument for QEMUBootSetHandlerGonglei2014-12-222-5/+4
|/ | | | | | | | | | | | | | | It will be useful for checking when we change traditional boot order dynamically and propagate error message to the monitor. For x86 architecture, we pass &local_err to set_boot_dev() when vm startup in pc_coms_init(). Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Alexander Graf <agraf@suse.de> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: qemu-ppc@nongnu.org Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
* spapr: Allow dynamic creation of PHBAlexander Graf2014-11-041-0/+21
| | | | | | | | | | | | | | Now that we finally check for presence of dangling sysbus devices, make check started complaining that the sPAPR PHB is one such device. However, it really isn't. The spapr PHB is not really a traditional sysbus device, but much more a special spapr pv device which is already able to get created dynamically. Move spapr to its own dynamic sysbus check handling and allow PHB devices to get allocated dynamically. Signed-off-by: Alexander Graf <agraf@suse.de>
* e500: Add support for eTSEC in device treeAlexander Graf2014-11-041-0/+43
| | | | | | | | | | | This patch adds support to expose eTSEC devices in the dynamically created guest facing device tree. This allows us to expose eTSEC devices into guests without changes in the machine file. Because we can now tell the guest about eTSEC devices this patch allows the user to specify eTSEC devices via -device at all. Signed-off-by: Alexander Graf <agraf@suse.de>
* PPC: e500: Support dynamically spawned sysbus devicesAlexander Graf2014-11-043-0/+111
| | | | | | | | | | | | | | | For e500 our approach to supporting dynamically spawned sysbus devices is to create a simple bus from the guest's point of view within which we map those devices dynamically. We allocate memory regions always within the "platform" hole in address space and map IRQs to predetermined IRQ lines that are reserved for platform device usage. This maps really nicely into device tree logic, so we can just tell the guest about our virtual simple bus in device tree as well. Signed-off-by: Alexander Graf <agraf@suse.de>
* hw/ppc/spapr_pci.c: Avoid functions not in glib 2.12 (g_hash_table_iter_*)Peter Maydell2014-11-041-11/+17
| | | | | | | | | The g_hash_table_iter_* functions for iterating through a hash table are not present in glib 2.12, which is our current minimum requirement. Rewrite the code to use g_hash_table_foreach() instead. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* PPC: E500: Hook up power off GPIO to GPIO controllerAlexander Graf2014-11-041-0/+24
| | | | | | | Now that we have a working GPIO controller on the virt machine, we can use one pin to notify QEMU that the guests wants to power off the system. Signed-off-by: Alexander Graf <agraf@suse.de>
* PPC: E500: Instantiate MPC8XXX gpio controller on virt machineAlexander Graf2014-11-043-0/+34
| | | | | | | | With the e500 virt machine, we don't have to adhere to the exact hardware layout of an mpc8544ds board. So there we can just add a qoriq compatible GPIO controller into the system that we can add a power off hook to. Signed-off-by: Alexander Graf <agraf@suse.de>
* hw/pci/ppc4xx_pci.c: Remove unused pci4xx_cfgaddr_read/write/opsPeter Maydell2014-11-041-24/+0
| | | | | | | | The MemoryRegionOps struct pci4xx_cfgaddr_ops and the read and write functions it references are all unused; remove them. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
* spapr: Cleanup machine naming conventions, and prepare for 2.2 releaseDavid Gibson2014-11-041-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | As of qemu-2.1, spapr/pseries, has a set of versioned machine classes to represent the machine type as it appeared to the guest in different qemu versions. This allows for safe migration of guests between current and future qemu versions. However, these are organized a bit differently from those for PC: on PC, the default plain "pc" machine type is just an alias for the most recent versioned machine type. In sPAPR, it names the base machine class from which the versioned types are derived. The PC approach is preferable; it makes it clearer which explicit version is the current one. Additionally updating the "current" machine as the base class makes it even more likely than otherwise to incorrectly alter the versioned machines' behaviour when updating the current machine. Therefore this patch changes sPAPR to the PC approach - the base class becomes abstract, and plain "pseries" becomes an alias for the most recent versioned machine class. Since qemu-2.1 is now released, we also create a new pseries-2.2 machine type, to incorporate changes during this development cycle (for now it is identical to pseries-2.1). Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
* target-ppc: virtex-ml507 machine type should depend on CONFIG_XILINXDavid Gibson2014-11-041-1/+1
| | | | | | | | | | The virtex-ml507 is a Xilinx CPU based system, and requires several sub devices which are only included with CONFIG_XILINX. Therefore, it should only be compiled if CONFIG_XILINX is set. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell2014-11-031-0/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pc, virtio, misc bugfixes A bunch of minor bugfixes all over the place. changes from v2: added cpu hotplug rework added default vga type switch more fixes changes from v1: fix for test re-generation script add missing acks to two patches Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon 03 Nov 2014 16:33:13 GMT using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: (28 commits) vga: flip qemu 2.2 pc machine types from cirrus to stdvga vga: add default display to machine class vhost-user: fix mmap offset calculation hw/i386/acpi-build.c: Fix memory leak in acpi_build_tables_cleanup() smbios: Encode UUID according to SMBIOS specification pc: Add pc_compat_2_1() function hw/virtio/vring/event_idx: fix the vring_avail_event error hw/pci: fixed hotplug crash when using rombar=0 with devices having romfile hw/pci: fixed error flow in pci_qdev_init -machine vmport=off: Allow disabling of VMWare ioport emulation acpi/cpu-hotplug: introduce helper function to keep bit setting in one place cpu-hotplug: rename function for better readability qom/cpu: remove the unused CPU hot-plug notifier pc: Update rtc_cmos in pc_cpu_plug pc: add cpu hotplug handler to PC_MACHINE acpi:piix4: convert cpu hotplug to hotplug_handler API acpi:ich9: convert cpu hotplug to hotplug_handler API acpi/cpu: add cpu hotplug callback function to match hotplug_handler API acpi: create separate file for TCPA log tests: fix rebuild-expected-aml.sh for acpi-test rename ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * virtio-pci: fix migration for pci bus masterMichael S. Tsirkin2014-11-021-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current support for bus master (clearing OK bit) together with the need to support guests which do not enable PCI bus mastering, leads to extra state in VIRTIO_PCI_FLAG_BUS_MASTER_BUG bit, which isn't robust in case of cross-version migration for the case when guests use the device before setting DRIVER_OK. Rip out this code, and replace it: - Modern QEMU doesn't need VIRTIO_PCI_FLAG_BUS_MASTER_BUG so just drop it for latest machine type. - For compat machine types, set PCI_COMMAND if DRIVER_OK is set. As this is needed for 2.1 for both pc and ppc, move PC_COMPAT macros from pc.h to a new common header. Cc: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Alexander Graf <agraf@suse.de>
* | hw/core/loader: implement address translation in uimage loaderMax Filippov2014-11-032-2/+4
|/ | | | | | | | | | | | | | | | | Such address translation is needed when load address recorded in uImage is a virtual address. When the actual load address is requested, return untranslated address: user that needs the translated address can always apply translation function to it and those that need it untranslated don't need to do the inverse translation. Add translation function pointer and its parameter to uimage_load prototype. Update all existing users. No user-visible functional changes. Cc: qemu-stable@nongnu.org Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Reviewed-by: Alexander Graf <agraf@suse.de>
* hw: Convert from BlockDriverState to BlockBackend, mostlyMarkus Armbruster2014-10-206-21/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Device models should access their block backends only through the block-backend.h API. Convert them, and drop direct includes of inappropriate headers. Just four uses of BlockDriverState are left: * The Xen paravirtual block device backend (xen_disk.c) opens images itself when set up via xenbus, bypassing blockdev.c. I figure it should go through qmp_blockdev_add() instead. * Device model "usb-storage" prompts for keys. No other device model does, and this one probably shouldn't do it, either. * ide_issue_trim_cb() uses bdrv_aio_discard() instead of blk_aio_discard() because it fishes its backend out of a BlockAIOCB, which has only the BlockDriverState. * PC87312State has an unused BlockDriverState[] member. The next two commits take care of the latter two. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Rename BlockDriverAIOCB* to BlockAIOCB*Markus Armbruster2014-10-201-1/+1
| | | | | | | | | | I'll use BlockDriverAIOCB with block backends shortly, and the name is going to fit badly there. It's a block layer thing anyway, not just a block driver thing. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Eliminate DriveInfo member bdrv, use blk_by_legacy_dinfo()Markus Armbruster2014-10-203-12/+22
| | | | | | | | | | | | | | | | | | | | | | | The patch is big, but all it really does is replacing dinfo->bdrv by blk_bs(blk_by_legacy_dinfo(dinfo)) The replacement is repetitive, but the conversion of device models to BlockBackend is imminent, and will shorten it to just blk_legacy_dinfo(dinfo). Line wrapping muddies the waters a bit. I also omit tests whether dinfo->bdrv is null, because it never is. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Benoît Canet <benoit.canet@nodalink.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* ide: Update ide_drive_get to be HBA agnosticJohn Snow2014-10-033-3/+3
| | | | | | | | | | | | | | | | | | | | | | | Instead of duplicating the logic for the if_ide (bus,unit) mappings, rely on the blockdev layer for managing those mappings for us, and use the drive_get_by_index call instead. This allows ide_drive_get to work for AHCI HBAs as well, and can be used in the Q35 initialization. Lastly, change the nature of the argument to ide_drive_get so that represents the number of total drives we can support, and not the total number of buses. This will prevent array overflows if the units-per-default-bus property ever needs to be adjusted for compatibility reasons. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-id: 1412187569-23452-5-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
OpenPOWER on IntegriCloud