spapr-pci: rework MSI/MSIX
On the sPAPR platform a guest allocates MSI/MSIX vectors via RTAShypercalls which return global IRQ numbers to a guest so it onlyoperates with those and never touches MSIMessage.
Therefore MSIMessage handling is completely hidden in QEMU....
pseries: Add H_SET_MODE hcall to change guest exception endianness
H_SET_MODE is used for controlling various partition settings. Oneof these settings is the endianness a guest takes its exceptions in.
Signed-off-by: Anton Blanchard <anton@samba.org>[agraf: fix whitespace]...
monitor: avoid use of global *cur_mon in monitor_find_completion()
Parameter *mon is added, and local variable *mon added in previous patchis removed. The caller readline_completion(), pass rs->mon as value, whichshould be initialized in readline_init() called by monitor_init()....
Merge remote-tracking branch 'qemu-kvm/uq/master' into stable-1.5
Merge remote-tracking branch 'mst/tags/for_anthony' into stable-1.5
pc,pci,virtio fixes and cleanups
This includes pc and pci cleanups, future-proofing of ROM files,and a virtio bugfix correcting splice on virtio console.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
tcg-i386: Remove abort from GETPC_LDST
Indeed, remove it entirely and remove the is_tcg_gen_code checkfrom GETPC_EXT.
Fixes https://bugs.launchpad.net/qemu/+bug/1218098 wherein a callto a "normal" helper function performed a sequence of tail callsall the way into the memory helper functions, leading to a stack...
tcg: Tidy softmmu_template.h
Avoid a loop in the tlb_fill path; the fill will either succeed orgenerate an exception.
Inline the slow_ld/st function; it was a complete copy of the mainhelper except for the actual cross-page unaligned code, and thecompiler was inlining it anyway....
tcg-i386: Use new return-argument ld/st helpers
Discontinue the jump-around-jump-to-jump scheme, trading it for a singleimmediate move instruction. The two extra jumps always consume 7 bytes,whereas the immediate move is either 5 or 7 bytes depending on where the...
tcg: Add mmu helpers that take a return address argument
Allow the code that tcg generates to be less obtuse, passing inthe return address directly instead of computing it in the helper.
Maintain the old entrance point unchanged as an alternate entry point....
Merge remote-tracking branch 'stefanha/block' into staging
aio / timers: Rearrange timer.h & make legacy functions call non-legacy
Rearrange timer.h so it is in order by function type.
Make legacy functions call non-legacy functions rather than vice-versa.
Convert cpus.c to use new API.
Signed-off-by: Alex Bligh <alex@alex.org.uk>...
aio / timers: Remove main_loop_timerlist
Now we have timerlistgroups implemented and main_loop_tlg, weno longer need the concept of a default timer list associatedwith each clock. Remove it and simplify initialisation ofclocks and timer lists.
aio / timers: Convert rtc_clock to be a QEMUClockType
Convert rtc_clock to be a QEMUClockType
Move rtc_clock users to use the new API
Signed-off-by: Alex Bligh <alex@alex.org.uk>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
aio / timers: convert block_job_sleep_ns and co_sleep_ns to new API
Convert block_job_sleep_ns and co_sleep_ns to use the new timerAPI.
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.
aio / timers: Remove legacy interface
Remove the legacy interface from include/qemu/timers.h.
Ensure struct QEMUClock is not exposed at all.
aio / timers: Remove alarm timers
Remove alarm timers from qemu-timers.c now we use g_poll / ppollinstead.
aio / timers: Remove legacy qemu_clock_deadline & qemu_timerlist_deadline
Remove qemu_clock_deadline and qemu_timerlist_deadline now we are usingthe ns functions throughout.
aio / timers: Add qemu_clock_get_ms and qemu_clock_get_ms
Add utility functions qemu_clock_get_ms and qemu_clock_get_us
aio / timers: Add documentation and new format calls
Add documentation for existing qemu timer calls. Add new formatcalls of the format timer_XXX rather than qemu_XXX_timerfor consistency.
aio / timers: Add a notify callback to QEMUTimerList
Add a notify pointer to QEMUTimerList so it knows what to notifyon a timer change.
aio / timers: Add aio_timer_init & aio_timer_new wrappers
Add aio_timer_init and aio_timer_new wrapper functions.
aio / timers: On timer modification, qemu_notify or aio_notify
On qemu_mod_timer_ns, ensure qemu_notify or aio_notify is called toend the appropriate poll(), irrespective of use_icount value.
On qemu_clock_enable, ensure qemu_notify or aio_notify is called for...
aio / timers: Introduce new API timer_new and friends
Introduce new API for creating timers - timer_new and_ns, _ms, _us derivatives.
aio / timers: Use all timerlists in icount warp calculations
Notify all timerlists derived from vm_clock in icount warpcalculations.
When calculating timer delay based on vm_clock deadline, useall timerlists.
For compatibility, maintain an apparent bug where when using...
aio / timers: Make qemu_run_timers and qemu_run_all_timers return progress
Make qemu_run_timers and qemu_run_all_timers return progressso that aio_poll etc. can determine whether a timer has beenrun.
aio / timers: Split QEMUClock into QEMUClock and QEMUTimerList
Split QEMUClock into QEMUClock and QEMUTimerList so that we canhave more than one QEMUTimerList associated with the same clock.
Introduce a main_loop_timerlist concept and make existingqemu_clock_* calls that actually should operate on a QEMUTimerList...
aio / timers: Untangle include files
include/qemu/timer.h has no need to include main-loop.h anddoing so causes an issue for the next patch. Unfortunatelyvarious files assume including timers.h will pull in main-loop.h.Untangle this mess.
aio / timers: Add QEMUTimerListGroup and helper functions
Add QEMUTimerListGroup and helper functions, to representa QEMUTimerList associated with each clock. Add a defaultQEMUTimerListGroup representing the default timer listswhich are not associated with any other object (e.g....
aio / timers: Add QEMUTimerListGroup to AioContext
Add a QEMUTimerListGroup each AioContext (meaning a QEMUTimerListassociated with each clock is added) and delete it when theAioContext is freed.
aio / timers: add ppoll support with qemu_poll_ns
Add qemu_poll_ns which works like g_poll but takes a nanosecondtimeout.
Merge remote-tracking branch 'luiz/queue/qmp' into staging
aio / timers: Rename qemu_timer_* functions
Rename four functions in preparation for new API.
Rename qemu_timer_expired to timer_expiredRename qemu_timer_expire_time_ns to timer_expire_time_nsRename qemu_timer_pending to timer_pendingRename qemu_timer_expired_ns to timer_expired_ns...
aio / timers: Rename qemu_new_clock and expose clock types
Rename qemu_new_clock to qemu_clock_new.
Expose clock types.
aio / timers: add qemu-timer.c utility functions
Add utility functions to qemu-timer.c for nanosecond timing.
Add qemu_clock_deadline_ns to calculate deadlines tonanosecond accuracy.
Add utility function qemu_soonest_timeout to calculate soonest deadline....
block: Introduce bs->zero_beyond_eof
In 4146b46c42e0989cb5842e04d88ab6ccb1713a48 (block: Produce zeros whenprotocols reading beyond end of file), we break qemu-iotests ./check-qcow2 022. This happens because qcow2 temporarily sets ->growable = 1for vmstate accesses (which are stored beyond the end of regular image...
loader: store FW CFG ROM files in RAM
ROM files that are put in FW CFG are copied to guest ram, by BIOS, butthey are not backed by RAM so they don't get migrated.
Each time we change two bytes in such a ROM this breaks cross-versionmigration: since we can migrate after BIOS has read the first byte but...
Merge remote-tracking branch 'pmaydell/tags/pull-target-arm-20130820' into staging
target-arm queue
OptsVisitor: don't try to flatten overlong integer ranges
Prevent mistyped command line options from incurring high memory and CPUusage at startup. 64K elements in a range should be enough for everyone(TM).
The OPTS_VISITOR_RANGE_MAX macro is public so that unit tests can...
Merge remote-tracking branch 'stefanha/block-next' into staging
hw/arm/pic_cpu: Remove the now-unneeded arm_pic_init_cpu()
Now all the boards have been converted arm_pic_init_cpu()is unused and can just be deleted.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Message-id: 1375977856-25046-15-git-send-email-peter.maydell@linaro.org
aio: drop io_flush argument
The .io_flush() handler no longer exists and has no users. Drop theio_flush argument to aio_set_fd_handler() and related functions.
The AioFlushEventNotifierHandler and AioFlushHandler typedefs are nolonger used and are dropped too....
gdbstub: Fix gdb_register_coprocessor() register counting
Commit a0e372f0c49ac01faeaeb73a6e8f50e8ac615f34 reorganized the registercounting for GDB. While it seems correct not to let the total number ofregisters skyrocket in an SMP scenario through a static variable, the...
qom: Introduce instance_post_init hook
This will allow classes to specify a function to be called after allinstance_init functions were called.
This will be used by DeviceState to call qdev_prop_set_globals() at theright moment.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>...
pc_sysfw: do not make it a device anymore
Move the code to hw/i386, the sole remaining property is availableas !pci_enabled.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1376069702-22330-4-git-send-email-aliguori@us.ibm.com...
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
pci,virtio fixes for 1.6
This includes some last-minute bugfixes for 1.6.All very small patches that also look very safe to me.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
virtio: clear signalled_used_valid when switching from dataplane
When the dataplane thread stops, its vring.c implementation synchronizesvring state back to virtio.c so we can continue emulating the virtiodevice.
This patch ensures that virtio.c's signalled_used_valid flag is reset so...
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...
dump: introduce GuestPhysBlockList
The vmcore must use physical addresses that are visible to the guest, notaddresses that point into linear RAMBlocks. As first step, introduce thelist type into which we'll collect the physical mappings in effect at the...
dump: populate guest_phys_blocks
While the machine is paused, in guest_phys_blocks_append() we register aone-shot MemoryListener, solely for the initial collection of the validguest-physical memory ranges that happens at listener registration time.
For each range that is reported to guest_phys_blocks_region_add(), we...
dump: rebase from host-private RAMBlock offsets to guest-physical addresses
RAMBlock.offset --> GuestPhysBlock.target_startRAMBlock.offset + RAMBlock.length --> GuestPhysBlock.target_endRAMBlock.length --> GuestPhysBlock.target_end -...
semaphore: fix a hangup problem under load on NetBSD hosts.
Fix following bugs in "fallback implementation of counting semaphoreswith mutex+condvar" added in c166cb72f1676855816340666c3b618beef4b976: - waiting threads are not restarted properly if more than one threads...
Merge remote-tracking branch 'spice/spice.v72' into staging
Message-id: 1375173625-3784-1-git-send-email-kraxel@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'borntraeger/s390-for-1.6' into staging
chardev: fix CHR_EVENT_OPENED events for mux chardevs
As of bd5c51ee6c4f1c79cae5ad2516d711a27b4ea8ec, chardevs no longer usebottom-halves to issue CHR_EVENT_OPENED events. To maintain pastsemantics, we instead defer the CHR_EVENT_OPENED events toward the end...
s390: Implement dump-guest-memory support for target s390x
With this patch dump-guest-memory on s390 produces an ELF formatted,crash-readable dump.In order to implement this, the arch-specific part of dump-guest-memorywas added:target-s390x/arch_dump.c contains the whole set of function for writing...
spice: fix display initialization
Spice has two display interface implementations: One integrated intothe qxl graphics card, and one generic which can operate with everyqemu-emulated graphics card.
The generic one is activated in case spice is used without qxl. The...
pc: limit 64 bit hole to 2G by default
It turns out that some 32 bit windows guests crashif 64 bit PCI hole size is >2G.Limit it to 2G for piix and q35 by default.User may override default 64-bit PCI hole size byusing "pci-hole64-size" property.
Examples:...
qdev: Add SIZE type to qdev properties
This patch adds a 'SIZE' type property to qdev.
Signed-off-by: Ian Molton <ian.molton@collabora.co.uk>Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>...
pc: move IO_APIC_DEFAULT_ADDRESS to include/hw/i386/ioapic.h
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Laszlo Ersek <lersek@redhat.com>Signed-off-by: Igor Mammedov <imammedo@redhat.com>Reviewed-by: Andreas Färber <afaerber@suse.de>...
sysbus: QOM parent field cleanup for SysBusDevice
Rename the parent field and hide it from gtk-doc.
Signed-off-by: Andreas Färber <afaerber@suse.de>
sysbus: Drop FROM_SYSBUS()
As a replacement, use your own macro based on OBJECT_CHECK().
sysbus: Remove unused sysbus_new() prototype
m48t59: QOM cast cleanup for M48t59SysBusState
lm32_juart: QOM cast cleanup
escc: QOM cast cleanup
lm32_juart: Relocate and tidy header
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 '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...
migration: fix spice migration
Commit 29ae8a4133082e16970c9d4be09f4b6a15034617 ("rdma: introduceMIG_STATE_NONE and change MIG_STATE_SETUP state transition") changed thestate transitions during migration setup.
Spice used to be notified with MIG_STATE_ACTIVE and it detected this...
block: Repair the throttling code.
The throttling code was segfaulting since commit02ffb504485f0920cfc75a0982a602f824a9a4f4 because some qemu_co_queue_next callerdoes not run in a coroutine.qemu_co_queue_do_restart assume that the caller is a coroutinne....
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>...
Merge branch 'trivial-patches' of git://git.corpit.ru/qemu
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....
exec: Remove env from list of poisoned names
The global variable env was removed some time ago, so this name may beused without any restriction now.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
gdbstub: Replace GET_REG*() macros with gdb_get_reg*() functions
This avoids polluting the global namespace with a non-prefixed macro andmakes it obvious in the call sites that we return.
Semi-automatic conversion using, e.g., sed i 's/GET_REGL(/return gdb_get_regl(mem_buf, /g' target*/gdbstub.c...
cpu: Introduce CPUClass::gdb_{read,write}_register()
Completes migration of target-specific code to new target-*/gdbstub.c.
Acked-by: Michael Walle <michael@walle.cc> (for lm32)Acked-by: Max Filippov <jcmvbkbc@gmail.com> (for xtensa)Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Introduce CPUClass::gdb_core_xml_file for GDB_CORE_XML
Replace the GDB_CORE_XML define in gdbstub.c with a CPUClass field.Use first_cpu for qSupported and qXfer:features:read: for now.Add a stub for xml_builtin.
Merge remote-tracking branch 'kwolf/for-anthony' into staging
cpu: Introduce CPUState::gdb_num_regs and CPUClass::gdb_num_core_regs
CPUState::gdb_num_regs replaces num_g_regs.CPUClass::gdb_num_core_regs replaces NUM_CORE_REGS.
Allows building gdb_register_coprocessor() for xtensa, too.
As a side effect this should fix coprocessor register numbering for SMP....
kvm: Change prototype of kvm_update_guest_debug()
Passing a CPUState pointer instead of a CPUArchState pointer eliminatesthe last target dependent data type in sysemu/kvm.h.
It also simplifies the code.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Acked-by: Paolo Bonzini <pbonzini@redhat.com>...
Implement qdict_flatten()
qdict_flatten(): For each nested QDict with key x, all fields with key yare moved to this QDict and their key is renamed to "x.y". This operationis applied recursively for nested QDicts.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
Implement sync modes for drive-backup.
This patch adds sync-modes to the drive-backup interface andimplements the FULL, NONE and TOP modes of synchronization.
FULL performs as before copying the entire contents of the drivewhile preserving the point-in-time using CoW....
qapi: Anonymous unions
The discriminator for anonymous unions is the data type. This allows tohave a union type that allows both of these:
{ 'file': 'my_existing_block_device_id' } { 'file': { 'filename': '/tmp/mydisk.qcow2', 'read-only': true } }...
QemuOpts: Add qemu_opt_unset()
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
qapi: Add visitor for implicit structs
These can be used when an embedded struct is parsed and members notbelonging to the struct may be present in the input (e.g. parsing aflat namespace QMP union, where fields from both the base and oneof the alternative types are mixed in the JSON object)...
Merge remote-tracking branch 'rth/tcg-next' into staging