vfio: Fix debug output for int128 values
Memory regions can easily be 2^64 byte long and therefore overflowfor just a bit but that is enough for int128_get64() to assert.
This takes care of debug printing of huge section sizes.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>...
vfio-pci: Implement PCI hot reset
Now that VFIO has a PCI hot reset interface, take advantage of it.There are two modes that we need to consider. The first is when onlyone device within the set of devices affected is actually assigned tothe guest. In this case the other devices are are just held by VFIO...
vfio-pci: Add support for MSI affinity
When MSI is accelerated through KVM the vectors are only programmedwhen the guest first enables MSI support. Subsequent writes to thevector address or data fields are ignored. Unfortunately that meanswe're ignore updates done to adjust SMP affinity of the vectors....
vfio-pci: Test device reset capabilities
Not all resets are created equal. PM reset is not very reliable,especially for GPUs, so we might want to opt for a bus reset if astandard reset will only do a D3hot->D0 transition. We can alsouse this to tell if the standard reset will do a bus reset (if...
vfio-pci: Lazy PCI option ROM loading
During vfio-pci initfn, the device is not always in a state where theoption ROM can be read. In the case of graphics cards, there's oftenno per function reset, which means we have host driver state affectingwhether the option ROM is usable. Ideally we want to move reading the...
vfio-pci: Cleanup error_reports
Remove carriage returns and tweak formatting for error_reports.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
qom: Pass available size to object_initialize()
To be passed on to object_initialize_with_type().
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> (virtio-ccw)Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Pass size to qbus_create_inplace()
To be passed to object_initialize().
Since commit 39355c3826f5d9a2eb1ce3dc9b4cdd68893769d6 the argument isvoid*, so drop some superfluous (BusState *) casts or direct parentfield usages.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Merge remote-tracking branch 'qemu-kvm/uq/master' into stable-1.5
aio / timers: Switch entire codebase to the new timer API
This is an autogenerated patch using scripts/switch-timer-api.
Switch the entire code base to using the new timer API.
Note this patch may introduce some line length issues.
Signed-off-by: Alex Bligh <alex@alex.org.uk>...
hw/misc: make pvpanic known to user
This patch is based on Hu Tao's:http://lists.nongnu.org/archive/html/qemu-devel/2013-08/msg00125.html
The pvpanic device may be enabled now with "-device pvpanic" from command line.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>...
kvm: add KVM_IRQFD_FLAG_RESAMPLE support
Added an EventNotifier* parameter tokvm-all.c:kvm_irqchip_add_irqfd_notifier(), in order to give KVManother eventfd to be used as "resamplefd". See the documentationin the linux kernel sources in Documentation/virtual/kvm/api.txt...
mst_fpga: QOM cast cleanup
puv3_pm: QOM cast cleanup
slavio_misc: QOM cast cleanup for MiscState
slavio_misc: QOM cast cleanup for APCState
zynq_slcr: QOM cast cleanup
arm_l2x0: Rename l2x0_state to L2x0State
arm_l2x0: QOM cast cleanup
arm_sysctl: QOM cast cleanup
eccmemctl: QOM cast cleanup
exynos4210_pmu: QOM cast cleanup
lm32_sys: QOM cast cleanup
milkymist-hpdmc: QOM cast cleanup
milkymist-pfpu: QOM cast cleanup
imx_ccm: QOM cast cleanup
Introduce type constant and use QOM casts.
Acked-by: Peter Chubb <peter.chubb@nicta.com.au>Signed-off-by: Andreas Färber <afaerber@suse.de>
devices: Associate devices to their logical category
The category will be used to sort the devices displayed inthe command line help.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>Message-id: 1375107465-25767-4-git-send-email-marcel.a@redhat.com...
pc-testdev: add I/O port to test memory.c auto split/combine
The ports at 0xe8..0xeb have impl.min/max_access_size == 1, sothat memory accesses are split and combined by the memory core.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
pc-testdev: support 8 and 16-bit accesses to 0xe0
This will let us use the testdev to test endianness.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1374501278-31549-17-git-send-email-pbonzini@redhat.com...
pc-testdev: remove useless cpu_to_le64/le64_to_cpu
So far the device was only used on little-endian machines.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1374501278-31549-18-git-send-email-pbonzini@redhat.com...
misc/pci-testdev: QOM parent field cleanup
Replace direct uses of PCITestDevState::dev with QOM casts and rename itto parent_obj.
Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
misc/ivshmem: QOM Upcast Sweep
Define and use standard QOM cast macro. Remove usages of DO_UPCAST()and direct -> style upcasting.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>[AF: Simplified casts and converted two more DO_UPCAST()s]...
misc/ivshmem: QOM parent field cleanup
Replace direct uses of IVShmemState::dev with QOM casts and rename it toparent_obj.
misc/pci-testdev: QOM Upcast Sweep
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>[AF: Replaced another DO_UPCAST()]Signed-off-by: Andreas Färber <afaerber@suse.de>
Merge remote-tracking branch 'stefanha/tracing' into staging
slavio_misc: Fix slavio_led_mem_readw/_writew tracepoints
Broken since they got added in commit 97bf485.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
vfio: QEMU-AER: Qemu changes to support AER for VFIO-PCI devices
Add support for error containment when a VFIO device assigned to a KVMguest encounters an error. This is for PCIe devices/drivers that support AERfunctionality. When the host OS is notified of an error in a device either...
vfio-pci: VGA quirk update
Turns out all the suspicions for AMD devices were correct, everywherewe read a BAR address that the address matches the config space offset,there's full access to PCI config space. Attempt to generalize somehelpers to allow quirks to easily be added for mirrors and windows....
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: Add timer handler for newworld mac-io
Mac OS X accesses fancy timer registers inside of the mac-io on bootup.
These really should be ticking at the mac-io bus frequency, but I don'tsee anyone upset when we just make them as fast as we want to.
With this patch on top of my previous patch queue and latest OpenBIOS...
PPC: g3beige: Move secondary IDE bus to mac-io
On a real G3 Beige the secondary IDE bus lives on the mac-io chip, noton some random PCI device. Move it there to become more compatible.
While at it, also clean up the IDE channel connection logic.
Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: dbdma: Replace tabs with spaces
s/^I/ /g on the file with a few manual tweaks to align things.
PPC: Mac: Add debug prints in macio and dbdma code
The macio code is basically undebuggable as it stands today, with nodebug prints anywhere whatsoever. DBDMA was better, but I needed afew more to create reasonable logs that tell me where breakage is....
PPC: dbdma: Fix debug print
There was a debug print that didn't compile for me because the formatand the arguments weren't in sync. Fix it up.
PPC: dbdma: Allow new commands in RUN state
The DBDMA controller can not change its command stream while it'sactively streaming data, true. But the fact that it's in RUN statedoesn't actually indicate anything. It could just as well be inWAIT while in RUN. And then it's legal to change commands....
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.
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....
cpu: Replace cpu_single_env with CPUState current_cpu
Move it to qom/cpu.h.
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
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 -...
hw/m*: pass owner to memory_region_init* functions
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
vfio: pass device to vfio_mmap_bar and use it to set owner
Cc: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
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>
memory: add owner argument to initialization functions
applesmc: replace register_ioport*
Convert over to memory regions to obsolete register_ioport*.
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 -...
pvpanic: fix fwcfg for big endian hosts
Convert port number to little endian whenexposing it in fw cfg.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
mac-io: Add escc-legacy memory alias region
Mac OS X's debugging serial driver accesses the ESCC through a differentregister layout, called "escc-legacy". This layout differs from the normalescc register layout purely by the location of the respective registers....
kvm: Change cpu_synchronize_state() argument to CPUState
Change Monitor::mon_cpu to CPUState as well.
Reviewed-by: liguang <lig.fnst@cn.fujitsu.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
i.MX31: Fix PRCS bit test
cppcheck detected a condition which was always false.
According to the MCIMX31 Reference Manual, the PRCS bits have to be 01to select the Frequency Pre-Multiplier (FPM). PRCS uses bits 1 and 2,so we have to test for 2.
Signed-off-by: Stefan Weil <sw@weilnetz.de>...
memory: make section size a 128-bit integer
So far, the size of all regions passed to listeners could fit in 64 bits,because artificial regions (containers and aliases) are eliminated bythe memory core, leaving only device regions which have reasonable sizes...
vfio: abort if an emulated iommu is used
vfio doesn't support guest iommus yet, indicate it to the userby gently depositing a core on their disk.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Avi Kivity <avi.kivity@gmail.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Merge branch 'realize-isa.v2' of git://github.com/afaerber/qemu-cpu
ivshmem: add missing error exit(2)
If the user fails to specify 'chardev' or 'shm' then we cannot continue.Exit right away so that we don't invoke shm_open(3) with a NULL pointer.
It would be nice to replace exit(1) with error returns in the PCI device...
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.
pvpanic: use FWCfgState explicitly
Use the type-safe FWCfgState structure insteadof the unsafe void *.
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.
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>
introduce a new qom device to deal with panicked event
pvpanic device is used to send guest panic event from guest to qemu.
When guest panic happens, pvpanic device driver will write a eventnumber to IO port 0x505(which is the IO port occupied by pvpanic device,...
pvpanic: pass configurable ioport to seabios
This lets seabios patch the corresponding SSDT entry.
Also add fw_cfg object to /machine/fw_cfg so we can referenceit elsewhere.
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>Reviewed-by: Markus Armbruster <armbru@redhat.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...
vmport: QOM'ify
Introduce type constant and cast macro to obsolete DO_UPCAST().Prepares for ISA realizefn.
Drop reserved underscore from struct name while at it.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>...
sga: QOM'ify
Introduce type constant and cast macro.
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-17-git-send-email-afaerber@suse.deSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
applesmc: QOM'ify
Add a typedef for the state struct and rename from Status to State.Add type constant and cast macro to obsolete DO_UPCAST().
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
pci: add pci test device
This adds a new device that we can use for testing PCI PIO and MMIO, with andwithout ioeventfd in different configurations. FAST_MMIO will be added if/whenkvm supports it. Also included are minor cleanups in kvm APIs that it needs....
Remove unneeded type casts
cpu_physical_memory_read, cpu_physical_memory_write take any pointeras 2nd argument without needing a type cast.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This device is used for kvm unit tests,currently it supports testing performance of ioeventfd.Using updated kvm unittest, here's an example output: mmio-no-eventfd:pci-mem 8796 mmio-wildcard-eventfd:pci-mem 3609...
sysemu: avoid proliferation of include/ subdirectories
arm: fix location of some include files
The recent rearrangement of include files had some minor errors: devices.h is not ARM specific and should not be in arm/ arm.h should be in arm/
Move these two headers to correct this.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
hw: move other devices to hw/misc/, configure with default-configs/
hw: move private headers to hw/ subdirectories.
Many headers are used only in a single directory. These can bekept in hw/.
hw: move VFIO and ivshmem to hw/misc/
hw: move target-independent files to subdirectories
This patch tackles all files that are compiled once, movingthem to subdirectories of hw/.
hw: make subdirectories for devices
Prepare the new directory structure.