escc: QOM cast cleanup
Signed-off-by: Andreas Färber <afaerber@suse.de>
pcie_port: Turn PCIEPort and PCIESlot into abstract QOM types
Move PCIEPort's "port" property to the new type, same for "aer_log_max".Move PCIESlot's "chassis" and "slot" properties to the new type.
Reviewed-by: Don Koch <dkoch@verizon.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>...
pci-bridge: Turn PCIBridge into abstract QOM type
Introduce TYPE_PCI_BRIDGE as base type and use PCI_BRIDGE() casts.
Reviewed-by: Don Koch <dkoch@verizon.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>[AF: Updated pbm-bridge parent to TYPE_PCI_BRIDGE]...
Merge remote-tracking branch 'stefanha/block' into staging
Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging
QOM CPUState refactorings
pseries: savevm support for PCI host bridge
This adds the necessary support for saving the state of the PAPR virtualPCI host bridge (or host bridges).
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
pseries: savevm support with KVM
At present, the savevm / migration support for the pseries machine will notwork when KVM is enabled. That's because KVM manages the guest's hash pagetable in the host kernel, so qemu has no visibility of it. This patch...
xics: rename types to be sane and follow coding style
Basically, in HW the layout of the interrupt network is:
- One ICP per processor thread (the "presenter"). This contains the registers to fetch a pending interrupt (ack), EOI, and control the...
hw: import bitmap operations in qdev-core header
Made small tweaks in code to prevent compilation issueswhen importing qemu/bitmap.h in qdev-core
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>Message-id: 1375107465-25767-2-git-send-email-marcel.a@redhat.com...
qemu-help: Sort devices by logical functionality
Categorize devices that appear as output to "-device ?" commandby logical functionality. Sort the devices by logical categoriesbefore showing them to user.
The sort is done by functionality rather than alphabetical....
pseries: savevm support for VIO devices
This patch adds helpers to allow PAPR VIO devices to save state commonto all VIO devices during savevm.
spapr-tce: make sPAPRTCETable a proper device
Model TCE tables as a device that's hooked up as a child object tothe owner. Besides the code cleanup, we get a few nice benefits:
1) free actually works now (it was dead code before)
2) the TCE information is visible in the device tree...
pseries: savevm support for pseries machine
This adds the necessary pieces to implement savevm / migration for thepseries machine. The most complex part here is migrating the hashtable - for the paravirtualized pseries machine the guest's hash pagetable is not stored within guest memory, but externally and the guest...
dataplane: enable virtio-blk x-data-plane=on live migration
Although the dataplane thread does not cooperate with dirty memorylogging yet it's fairly easy to temporarily disable dataplane duringlive migration. This way virtio-blk can live migrate when...
target-i386: Disable PMU CPUID leaf by default
Bug description: QEMU currently gets all bits from GET_SUPPORTED_CPUIDfor CPUID leaf 0xA and passes them directly to the guest. This makesthe guest ABI depend on host kernel and host CPU capabilities, andbreaks live migration if we migrate between hosts with different...
Xen PV Device
Introduces a new Xen PV PCI device which will act as a binding point forPV drivers for Xen.The device has parameterized vendor-id, device-id and revision to allow tobe configured as a binding point for any vendor's PV drivers.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>...
hw/mips: align initrd to 64KB to avoid kernel error
The Linux kernel can be configured to use 64KB pages, but it alsorequires initrd to be page aligned. Therefore, to be safe, align theinitrd to 64KB using a new INITRD_PAGE_MASK rather thanTARGET_PAGE_MASK....
isa_mmio: delete
It is not used anymore.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1374501278-31549-15-git-send-email-pbonzini@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
scsi: Improve error propagation for scsi_bus_legacy_handle_cmdline()
Let scsi_bus_legacy_add_drive() and scsi_bus_legacy_handle_cmdline()return an Error**. Prepare qdev initfns for QOM realize error model.
sysbus: Document SysBusDeviceClass::init and realize semantics
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>[AF: Syntax and wording changes]Signed-off-by: Andreas Färber <afaerber@suse.de>
q35: Use type-safe cast instead of direct access of parent dev
And remove variables if possible.
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>[AF: Converted remaining access and renamed to parent_obj]Signed-off-by: Andreas Färber <afaerber@suse.de>
Merge remote-tracking branch 'pmaydell/tags/pull-arm-devs-20130722' into staging
arm-devs queue
hw/loader: Support ramdisk with u-boot header
Introduce 'load_ramdisk()' which can load "normal" ramdisks and ramdiskswith a u-boot header.To enable this and leverage synergies 'load_uimage()' is refactored toaccomodate this additional use case.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>...
arm/boot: Allow boards to modify the FDT blob
Add a callback hook in arm_boot_info to allow board models tomodify the device tree blob if they need to. (The major expecteduse case is to add virtio-mmio nodes for virtio-mmio transportsthat exist in QEMU but not in the hardware.)...
virtio: Add support for guest setting of queue size
The MMIO virtio transport spec allows the guest to tell the host howlarge the queue size is. Add virtio_queue_set_num() function whichimplements this in the QEMU common virtio support code.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
virtio: Support transports which can specify the vring alignment
Support virtio transports which can specify the vring alignment(ie where the guest communicates this to the host) by providinga new virtio_queue_set_align() function. (The default alignment...
dataplane: sync virtio.c and vring.c virtqueue state
Load the virtio.c state into vring.c when we start dataplane mode andvice versa when stopping dataplane mode. This patch makes it possibleto start and stop dataplane any time while the guest is running....
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
pci,net,pc enhancements
This includes some fixes and enhancements that accumulated in my tree:pci fixes by dkoch, virtio-net enhancements by akong and mst,and a fix for xen pc by mst.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
virtio-net: add feature bit for any header s/g
Old qemu versions required that 1st s/g entry is the header.
Since QEMU 1.5, patchset titled "virtio-net: iovec handling cleanup" removed this limitation but a feature bit is needed so guests know it'ssafe to lay out header differently....
PPC: dbdma: Move processing to io
Soon we will introduce intermediate processing pauses which willallow the bottom half to restart a DMA request that couldn't befulfilled yet.
For that to work, move the processing variable into the io structwhich is what DMA providers work with....
PPC: dbdma: Support unaligned DMA access
The DBDMA engine really just reads bytes from a producing device (IDEin our case) and shoves these bytes into memory. It doesn't care whetherany alignment takes place or not.
Our code today however assumes that block accesses always happen on...
PPC: dbdma: Move defines into header file
We usually keep struct and constant definitions in header files. Movethem there to stay consistent and to make access to fields easier.
Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: dbdma: Introduce kick function
The DBDMA engine really is running all the time, waiting for input. Howeverwe don't want to waste cycles constantly polling.
So introduce a kick function that data providers can call to notify theDBDMA controller of new input....
PPC: dbdma: Move static bh variable to device struct
The DBDMA controller has a bottom half to asynchronously process DMArequest queues.
This bh was stored as a gross static variable. Move it into the devicestruct instead.
While at it, move all users of it to the new generic kick function....
pci: fix BRDIGE typo
Fix typo in macro name: PCI_CLASS_BRDIGE_PCI_INF_SUB.
Signed-off-by: Don Koch <dkoch@verizon.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci-bridge: update mappings for migration/restore
Fix for LP#1187529: Devices on PCI bridge stop working whenlive-migrated. Update bridge mappings for all PCI bridgedevices in get_pci_config_device().
intc/openpic: Build openpic only once
Since current_cpu is CPUState it no longer depends on CPUPPCState.
Move ppce500_set_mpic_proxy() to a new hw/ppc/ppc_e500.h becausehw/ppc/ppc.h is too heavily using CPUPPCState and PowerPCCPU.
pci,misc enhancements
This includes some pci enhancements:
Better support for systems with multiple PCI root busesFW cfg interface for more robust pci programming in BIOSMinor fixes/cleanups for fw cfg and cross-version migration -...
pci: Use helper to find device's root bus in pci_find_domain()
Currently pci_find_domain() performs two functions - it locates the PCIroot bus above the given bus, then looks up that root bus's domain number.This patch adds a helper function to perform the first task, finding the...
pci: Replace pci_find_domain() with more general pci_root_bus_path()
pci_find_domain() is used in a number of places where we want an id for awhole PCI domain (i.e. the subtree under a PCI root bus). The trouble isthat many platforms may support multiple independent host bridges with no...
pci: Add root bus argument to pci_get_bus_devfn()
pci_get_bus_devfn() interprets a full PCI address string to give a PCIBus *and device/function number within that bus. Currently it assumes it isworking on an address under the primary PCI root bus. This patch extends...
pci: Add root bus parameter to pci_nic_init()
At present, pci_nic_init() and pci_nic_init_nofail() assume that they willonly create a NIC under the primary PCI root. As we add support formultiple PCI roots, that may no longer be the case. This patch adds a root...
pci: Fold host_buses list into PCIHostState functionality
The host_buses list is an odd structure - a list of pointers to PCI rootbuses existing in parallel to the normal qdev tree structure. This patchremoves it, instead putting the link pointers into the PCIHostState...
pci: Abolish pci_find_root_bus()
pci_find_root_bus() takes a domain parameter. Currently PCI root buseswith domain other than 0 can't be created, so this is more or less a longwinded way of retrieving the main PCI root bus. Numbered domains don'tactually properly cover the (non x86) possibilities for multiple PCI root...
spapr_iommu: pass device to spapr_tce_new_table and use it to set owner
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
pam: pass device to init_pam and use it to set owner
memory: add ref/unref calls
Add ref/unref calls at the following places:
- places where memory regions are stashed by a listener and used outside the BQL (including in Xen or KVM).
- memory_region_find callsites
- creation of aliases and containers (only the aliased/contained...
vmport: Disentangle read handler type from portio
In case the latter may vanish one day, make sure the vmport read handlertype will remain unaffected. This is also conceptually cleaner.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
dma: keep a device alive while it has SGLists
Reviewed-by: Anthony Liguori <aliguori@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
pci: Move pci_read_devaddr to pci-hotplug-old.c
pci_read_devaddr() is only used by the legacy functions for the old PCIhotplug interface in pci-hotplug-old.c. So we move the function there,and make it static.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
pvpanic: initialization cleanup
Avoid use of static variables: PC systemsinitialize pvpanic device through pvpanic_init,so we can simply create the fw_cfg file at that point.This also makes it possible to skip devicecreation completely if fw_cfg is not there, e.g. for xen -...
pci: store PCI hole ranges in guestinfo structure
Will be used to pass hole ranges to guests.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pc: pass PCI hole ranges to Guests
Guest currently has to jump through lots of hoops to guess the PCI holeranges. It's fragile, and makes us change BIOS each time we add a newchipset. Let's report the window in a ROM file, to make BIOS do exactlywhat QEMU intends....
PPC: Add clock-frequency export for Mac machines
Support in fwcfg has been around for exposure of the clock-frequencyCPU property. OpenBIOS reads it, we just never exposed it.
Since Mac OS X is very picky about its clock frequency values, let'sjust take a known good value and always expose that....
spapr-rtas: add CPU argument to RTAS calls
RTAS is a hypervisor provided binary blob that a guest loads andcalls into to execute certain functions. It's similar to thevsyscall page in Linux or the short lived VMCI paravirt interfacefrom VMware.
The QEMU implementation of the RTAS blob is simply a passthrough...
intc/openpic_kvm: Fix QOM and build issues
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
openpic: factor out some common defines into openpic.h
...for use by the KVM in-kernel irqchip stub.
Signed-off-by: Scott Wood <scottwood@freescale.com>Signed-off-by: Alexander Graf <agraf@suse.de>
kvm/openpic: in-kernel mpic support
Enables support for the in-kernel MPIC that thas been merged into theKVM next branch. This includes irqfd/KVM_IRQ_LINE support from AlexGraf (along with some other improvements).
Note from Alex regarding kvm_irqchip_create():...
intc/openpic: QOM'ify
Introduce type constant and cast macro.
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Alexander Graf <agraf@suse.de>
linux-user: Fix compilation failure
Fix compilation failures for linux-user targets following recentmigration related commits bd2fa51fcd and 43487c67.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 1372362818-4740-1-git-send-email-peter.maydell@linaro.org...
Revert "xen: start PCI hole at 0xe0000000 (same as pc_init1 and qemu-xen-traditional)"
This reverts commit 9f24a8030a70ea4954b5b8c48f606012f086f65f.
The start of the PCI hole is actually set to 0xf0000000 by hvmloader.In order to retain ABI compatibility with Xen we leave the start of the...
usb: add serial bus property
This patch adds a serial property for all usb devices, which can beused to set the serial number of a usb device (as listed by lsusb -v)to a specific value. Applies to emulated devices only.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
dma: eliminate DMAContext
The DMAContext is a simple pointer to an AddressSpace that is now alwaysalready available. Make everyone hold the address space directly,and clean up the DMA API to use the AddressSpace directly.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
spapr_vio: take care of creating our own AddressSpace/DMAContext
Fetch the root region from the sPAPRTCETable, and use it to buildan AddressSpace and DMAContext.
Now, everywhere we have a DMAContext we also have access to thecorresponding AddressSpace (either because we create it just before...
spapr: convert TCE API to use an opaque type
The TCE table is currently returned as a DMAContext, and non-type-safeAPIs are called later passing back the DMAContext. Since we want to moveaway from DMAContext, use an opaque type instead, and add an accessor...
spapr: use memory core for iommu support
Now we can stop using a "translating" DMAContext, but we do not yet modifythe sPAPRTCETable users to get an AddressSpace; they keep using the tablevia a DMAContext.
Acked-by: David Gibson <david@gibson.dropbear.id.au>...
pci: use memory core for iommu support
Use the new iommu support in the memory core for iommu support. The onlyuser, spapr, is also converted, but it still provides a DMAContextinterface until the non-PCI bits switch to AddressSpace.
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>...
vl: Rename *boot_devices to *boot_order, for consistency
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1371208516-7857-5-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
NVMe: Initial commit for new storage interface
Initial commit for emulated Non-Volatile-Memory Express (NVMe) pcistorage device.
NVMe is an open, industry driven storage specification definingan optimized register and command set designed to deliver the full...
Merge branch 'realize-isa.v2' of git://github.com/afaerber/qemu-cpu
smbios: Clean up smbios_add_field() parameters
Having size precede the associated pointer is odd. Swap them, and fixup the types.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Laszlo "ever the optimist" Ersek <lersek@redhat.com>Message-id: 1370610036-10577-5-git-send-email-armbru@redhat.com...
Merge remote-tracking branch 'mjt/trivial-patches-next' into staging
char/serial: Use generic Fifo8
Use the generic Fifo8 helper provided by QEMU, rather than re-implementprivately.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target-i386: Update model values on Conroe/Penryn/Nehalem CPU models
The CPUID model values on Conroe, Penryn, and Nehalem are tooconservative and don't reflect the values found on real Conroe, Penryn,and Nehalem CPUs.
This causes at least one known problems: Windows XP disables sysenter...
target-i386: Set level=4 on Conroe/Penryn/Nehalem
The CPUID level value on Conroe, Penryn, and Nehalem are too low. Thiscauses at least one known problem: the -smp "threads" option doesn'twork as expect if level is < 4, because thread count information is...
isa: QOM'ify ISADevice
Rename its parent field and use DEVICE where necessary.
qdev: Drop FROM_QBUS() macro
Use QOM cast macros I2C_BUS(), SSI_BUS(), PCI_BUS() instead.
isa: QOM'ify ISABus
Rename its parent field and use ISA_BUS() where necessary.
kvm/i8254: QOM'ify some more
Introduce type constant and cast macro to obsolete DO_UPCAST().
Prepares for PIT realizefn.
i8254: Convert PITCommonState to QOM realizefn
Instead of having the parent provide PITCommonClass::init,let the children override DeviceClass::realize themselves.This pushes the responsibility for saving and calling the parent'srealizefn to the children....
i8259: Convert PICCommonState to use QOM realizefn
Instead of having the parent provide PICCommonClass::init,let the children override DeviceClass::realize themselves.This pushes the responsibility of saving and calling the parent'srealizefn to the children....
i8254: QOM'ify some more
Introduce type constant and avoid DO_UPCAST().
isa: Use realizefn for ISADevice
Drop ISADeviceClass::init and the resulting no-op initfn and letchildren implement their own realizefn. Adapt error handling.Split off an instance_init where sensible.
Merge remote-tracking branch 'sstabellini/xen_fixes_20130603' into staging
pci: misc cleanups
This includes some pci-related cleanups,and fw cfg cleanups which will be useful for on-goingpci related work.
xen: start PCI hole at 0xe0000000 (same as pc_init1 and qemu-xen-traditional)
We are currently setting the PCI hole to start at HVM_BELOW_4G_RAM_END,that is 0xf0000000.Start the PCI hole at 0xe0000000 instead, that is the same value used bypc_init1 and qemu-xen-traditional....
xen: remove xen_vcpu_init
No need for xen_vcpu_init anymore:
- the RTC emulator doesn't have any periodic timers continuously runningeven in absence of guest interactions anymore;
- qemu_dummy_start_vcpu takes care of disabling TCG for us, so we don't...
xen: simplify xen_enabled
No need for preprocessor conditionals in xen_enabled: xen_allowed isalways defined.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>CC: qemu-stable@nongnu.org
Merge remote-tracking branch 'kraxel/usb.83' into staging
pci: add VMSTATE_MSIX
Using a trick cut+pasted from vmstate_scsi_deviceto wind up msix_save and msix_load.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>
fw_cfg: move typedef to qemu/typedefs.h
Less header dependencies this way.
fw_cfg: add API to find FW cfg object
Remove some code duplication by adding afunction to look up the fw cfg file.This way, we don't need to duplicate same strings everywhere.Use by both fw cfg and pvpanic device.
refer to FWCfgState explicitly
Currently some places use pointer-to-void even though they meanpointer-to-FWCfgState. Clean them up.
Signed-off-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
firmware_abi: move to include/hw/nvram/
firmware_abi.h with structs for OpenBIOS landed in hw/sparc/ by mistake- move it to hw/nvram/ alongside fw_cfg.h. In addition to sparc it'sincluded from ppc mac_nvram.c and will need to include it from prep.c in...
rtc: remove rtc_set_date
Since it's not defined and used anywhere.
Cc: qemu-trivial@nongnu.orgSigned-off-by: Hu Tao <hutao@cn.fujitsu.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Merge remote-tracking branch 'mjt/trivial-patches' into staging
virtio-net: dynamic network offloads configuration
Virtio-net driver currently negotiates network offloadson startup via features mechanism and have no ability todisable and re-enable offloads later.This patch introduced a new control command that allows...
remove some double-includes
Some source files #include the same header more thanonce for no good reason. Remove second #includes insuch cases.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
virtio-net: add virtio_net_set_netclient_name.
This adds virtio_net_set_netclient_name, which is used to set thename and type shown in "info network" command.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Message-id: 1368619970-23892-2-git-send-email-fred.konrad@greensocs.com...
Revert "pc: Kill the "use flash device for BIOS unless KVM" misfeature"
This reverts commit 9953f8822cc316eec9962f0a2858c3439a80adec.While Markus's analysis is entirely correct, there are 1.6 patchesthat fix the bug for real and without requiring machine type hacks....