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>...
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.
Signed-off-by: Andreas Färber <afaerber@suse.de>
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....
target-i386: Change CPUID model of 486 to 8
This changes the model number of 486 to 8 (DX4) which matches thefeature set presented, and actually has the CPUID instruction.
This adds a compatibility property, to keep model=0 on pc-*-1.4 and older.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>...
qdev: Introduce qdev_prop_set_globals_for_type()
Reuse it in qdev_prop_set_globals().
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>[AF: Renamed from qdev_prop_set_custom_globals()]Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Let qdev_prop_parse() pass through Error
Move error reporting to callers.
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
virtio: add virtio_device_set_child_bus_name.
Add virtio_device_set_child_bus_name function.
It will be used with virtio-serial-x and virtio-scsi-x to set thechild bus name before calling virtio-x-device's init.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>...
scsi: add bus_name parameter to scsi_bus_new.
This adds the possibility to create a scsi-bus with a specified name.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>...
virtio-scsi: fix the command line compatibility.
The bus name is wrong since the refactoring.
This keeps the behaviour of the command line.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>Message-id: 1367330931-12994-6-git-send-email-fred.konrad@greensocs.com...
Merge remote-tracking branch 'afaerber/qom-cpu' into staging
Trivial grammar and spelling fixes
similiar -> similarrecieve -> receivetransfered -> transferredpreperation -> preparation
Most changes are in comments, one modifies a parameter name in a functionprototype.
The spelling fixes were made using codespell....
target-i386: Move APIC to ICC bus
It allows APIC to be hotplugged.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
Add hot_add_cpu hook to QEMUMachine
Hook should be set by machines that implement CPU hot-addvia cpu-add QMP command.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
pc: Implement QEMUMachine::hot_add_cpu hook
target-i386: Introduce ICC bus/device/bridge
Provides a hotpluggable bus for APIC and CPU.
target-i386: Attach ICC bus to CPU on its creation
X86CPU should have parent bus so it could provide bus for child APIC.
target-i386: Replace MSI_SPACE_SIZE with APIC_SPACE_SIZE
Put APIC_SPACE_SIZE in a public header so that it can bereused elsewhere later.
pc: Update rtc_cmos on CPU hot-plug
It provides updated currently available CPUs count to BIOS on reboot.
fw_cfg: add required header files
If fw_cfg.h is included alone, gcc gives error messages like these:
error: unknown type name ‘uint32_t’ error: unknown type name ‘size_t’ error: unknown type name ‘hwaddr’ ...
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>...
pvpanic: create pvpanic by default for machine 1.5
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>Reviewed-by: Markus Armbruster <armbru@redhat.com>Message-id: f840042f0e1205041f8feaf0d39ca639884f3a00.1366945969.git.hutao@cn.fujitsu.com...
audio: remove the need for audio card CONFIG_* symbols
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Message-id: 1366303444-24620-3-git-send-email-pbonzini@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
serial: QOM'ify ISA serial
Prepares for ISA realizefn.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>Message-id: 1367093935-29091-16-git-send-email-afaerber@suse.de...
mc146818rtc: QOM'ify
Signed-off-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Igor Mammedov <imammedo@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>...
pcspk: QOM'ify
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>Message-id: 1367093935-29091-14-git-send-email-afaerber@suse.de...
fdc: QOM'ify ISA floppy controller
Introduce type constant and cast macro to obsolete DO_UPCAST().Reuse type constant for PC machine compatibility settings.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>...
i8259: QOM cleanups
Eliminate DO_UPCAST() for PICCommonState. Prepares for ISA realizefn.
Also give the i8259_common type registration functions unique nameswhile at it.
pc: Kill the "use flash device for BIOS unless KVM" misfeature
Use of a flash memory device for the BIOS was added in series "[PATCHv10 0/8] PC system flash support", commit 4732dca..1b89faf, v1.1.
Flash vs. ROM is a guest-visible difference. Thus, flash use had to...
virtio: cleanup: init and exit function.
This clean the init and the exit functions and rename virtio_common_cleanupto virtio_cleanup.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Message-id: 1366791683-5350-7-git-send-email-fred.konrad@greensocs.com...
virtio: drop unused function prototypes.
This removes the unused prototypes in virtio.h.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Message-id: 1366791683-5350-8-git-send-email-fred.konrad@greensocs.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>