tcg-arm: Use qemu_getauxval
Allow host detection on linux systems without glibc 2.16 or later.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Richard Henderson <rth@twiddle.net>
osdep: Create qemu_getauxval and qemu_init_auxval
Abstract away dependence on a system implementation of getauxval.
Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-ppc64: Use qemu_getauxval
atomic.h: Fix build with clang
clang defines ATOMIC_SEQ_CST but its implementation of the_atomic_exchange() builtin differs from that of gcc. Move the_clang branch of the ifdef ladder to the top and fix itsimplementation (there is no such builtin as __sync_exchange),...
pc: get rid of builtin pvpanic for "-M pc-1.5"
This causes two slight backwards-incompatibilities between "-M pc-1.5" and 1.5's "-M pc":
(1) a fw_cfg file is removed with this patch. This is only a problemif migration stops the virtual machine exactly during fw_cfg enumeration....
qmp: access the local QemuOptsLists for drive option
Currently we have three QemuOptsList (qemu_common_drive_opts,qemu_legacy_drive_opts, and qemu_drive_opts), only qemu_drive_optsis added to vm_config_groups[].
This patch changes query-command-line-options to access three local...
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
pci, pc, virtio bug fixes
This reverts PCI master abort support - we'll want iteventually but it exposes too many core bugs to be safe for 1.7.This also reverts a recent exec.c change that was an...
Revert "hw/pci: partially handle pci master abort"
This reverts commit a53ae8e934cd54686875b5bcfc2f434244ee55d6.
The patch being reverted introduced a low-priority memory regioncovering all 64 bit pci address space. This exposed the following bugselsewhere in the code:...
loader: drop return value for rom_add_blob_fixed
rom_add_blob never fails, and neither does rom_add_blob_fixed,so there's no need to return value from it.
In fact, rom_add_blob_fixed was erroneously returning -1 unconditionallywhich made the only system that checked the return value -M bamboo fail...
Fix pc migration from qemu <= 1.5
The following commit introduced a migration incompatibility:
commit 568f0690fd9aa4d39d84b04c1a5dbb53a915c3feAuthor: David Gibson <david@gibson.dropbear.id.au>Date: Thu Jun 6 18:48:49 2013 +1000
pci: Replace pci_find_domain() with more general pci_root_bus_path()...
net: disallow to specify multicast MAC address
[Assigning a multicast MAC address to a NIC leads to confusing behavior.Reject multicast MAC addresses so users are alerted to their errorstraight away.
The "net/eth.h" in6_addr rename prevents a name collision with...
bswap.h: Remove be32_to_cpupu()
Replace the legacy be32_to_cpupu() with ldl_be_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-6-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove cpu_to_be16wu()
Replace the legacy cpu_to_be16wu() with stw_be_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-7-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove cpu_to_be32wu()
Replace the legacy cpu_to_be32wu() with stl_be_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-8-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove cpu_to_be64wu()
Replace the legacy cpu_to_be64wu() with stq_be_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-9-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove cpu_to_32wu()
Replace the legacy cpu_to_32wu() with stl_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-10-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove le16_to_cpupu()
Replace the legacy le16_to_cpupu() with lduw_le_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-4-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove le32_to_cpupu()
Replace the legacy le32_to_cpupu() with ldl_le_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-5-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove cpu_to_le16wu()
Replace the legacy cpu_to_le16wu() with stw_le_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-2-git-send-email-peter.maydell@linaro.org...
bswap.h: Remove cpu_to_le32wu()
Replace the legacy cpu_to_le32wu() with stl_le_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-3-git-send-email-peter.maydell@linaro.org...
pcmcia: QOM'ify PCMCIACardState and MicroDriveState
Turn PCMCIACardState into a device.Move callbacks to new PCMCIACardClass.
Derive TYPE_MICRODRIVE from TYPE_PCMCIA_CARD.Replace ide_init2_with_non_qdev_drives().
Signed-off-by: Othmar Pasteka <pasteka@kabsi.at>...
qom: Fix pointer to int property helpers' documentation
Relocate to alongside the other object_property_add_* helpers while at it.
Signed-off-by: Andreas Färber <afaerber@suse.de>
pxa: Fix typo "dettach"
qdev: Drop misleading qdev_free() function
The qdev_free() function name is misleading since all the function doesis unlink the device from its parent. The device is not necessarilyfreed.
The device will be freed when its QObject refcount reaches zero. It is...
a9mpcore: Prepare for QOM embedding
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Andreas Färber <andreas.faerber@web.de>
a15mpcore: Prepare for QOM embedding
arm11mpcore: Split off SCU device
Inspired by a9scu.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Andreas Färber <afaerber@suse.de>
realview_gic: Prepare for QOM embedding
Move state struct, type constant and cast macro to a new header.
arm11mpcore: Prepare for QOM embedding
arm_gic: Extract headers hw/intc/arm_gic{,_common}.h
Rename NCPU to GIC_NCPU and move GICState away from gic_internal.h.
a9mpcore: Embed A9SCUState
Prepares for QOM realize.
a9mpcore: Embed ARMMPTimerState
Merge remote-tracking branch 'kwolf/tags/for-anthony' into staging
Block patches for 1.7.0-rc0 (v2)
Merge remote-tracking branch 'agraf/ppc-for-upstream' into staging
pci, pc, acpi fixes, enhancements
This includes some pretty big changes:- pci master abort support by Marcel- pci IRQ API rework by Marcel- acpi generation support by myself
Everything has gone through several revisions, latest versions have been on...
integrator: fix Linux boot failure by emulating dbg region
Commit 9b8c69243 (since reverted) broke the ability to boot the kernelas the value returned by unassigned_mem_read returned non-zero and leftthe kernel looping forever waiting for it to change (see...
coroutine: add co_aio_sleep_ns() to allow sleep in block drivers
This helper function behaves similarly to co_sleep_ns(), but thesleeping coroutine will be resumed when using qemu_aio_wait().
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>...
block: Avoid unecessary drv->bdrv_getlength() calls
The block layer generally keeps the size of an image cached inbs->total_sectors so that it doesn't have to perform expensiveoperations to get the size whenever it needs it.
This doesn't work however when using a backend that can change its size...
target-ppc: dump-guest-memory support
This patch add support for dumping guest memory using dump-guest-memorymonitor command.
Before patch:
(qemu) dump-guest-memory testcrashthis feature or command is not currently supported(qemu)
After patch:
(qemu) dump-guest-memory testcrash...
spapr: Use DeviceClass::fw_name for device tree CPU node
Instead of relying on cpu_model, obtain the device tree node labelper CPU. Use DeviceClass::fw_name as source.
Whenever DeviceClass::fw_name is unknown, default to "PowerPC,UNKNOWN".
As a consequence, spapr_fixup_cpu_dt() can operate on each CPU's fw_name,...
xics: split to xics and xics-common
The upcoming XICS-KVM support will use bits of emulated XICS code.So this introduces new level of hierarchy - "xics-common" class. Bothemulated XICS and XICS-KVM will inherit from it and override classcallbacks when required....
xics: add cpu_setup callback
This adds a cpu_setup callback to the XICS device class (as XICS-KVMwill do it different), xics_cpu_setup() will call it if it is set.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>Signed-off-by: Alexander Graf <agraf@suse.de>
xics-kvm: Support for in-kernel XICS interrupt controller
Recent (host) kernels support emulating the PAPR defined "XICS" interruptcontroller system within KVM. This patch allows qemu to initialize andconfigure the in-kernel XICS, and keep its state in sync with qemu's XICS...
xics: Implement H_XIRR_X
This implements H_XIRR_X hypercall in addition to H_XIRR asit is mandatory for PAPR+ and there is no way for the guest todetect whether it is supported or not so just add it.
As the Partition Adjunct Option is not supported at the moment,...
spapr-rtas: fix h_rtas parameters reading
On the real hardware, RTAS is called in real mode and thereforetop 4 bits of the address passed in the call are ignored.So does the patch.
This converts h_rtas() to use existing rtas_ld() handlers.
This fixed rtas_ld()/rtas_st() to ignore top 4 bits....
xics: add pre_save/post_load dispatchers
The upcoming support of in-kernel XICS will redefine migration callbacksfor both ICS and ICP so classes and callback pointers are added.
Merge remote-tracking branch 'bonzini/iommu-for-anthony' into staging
timer: add timer_mod_anticipate and timer_mod_anticipate_ns
These let a user anticipate the deadline of a timer, atomically withother sites that call the function. This helps avoiding complicatedlock hierarchies.
Reviewed-by: Alex Bligh <alex@alex.org.uk>...
timer: make qemu_clock_enable sync between disable and timer's cb
After disabling the QemuClock, we should make sure that no QemuTimersare still in flight. To implement that with light overhead, we resortto QemuEvent. The caller of disabling will wait on QemuEvent of each...
qemu-thread: add QemuEvent
This emulates Win32 manual-reset events using futexes or conditionalvariables. Typical ways to use them are with multi-producer,single-consumer data structures, to test for a complex condition whoseelements come from different threads:...
timer: protect timers_state's clock with seqlock
QEMU_CLOCK_VIRTUAL may be read outside BQL. This will make itsfoundation, i.e. cpu_clock_offset exposed to race condition.Using private lock to protect it.
After this patch, reading QEMU_CLOCK_VIRTUAL is thread safe...
portio: Allow to mark portio lists as coalesced MMIO flushing
This will enable us to remove all remaining explicit calls ofqemu_flush_coalesced_mmio_buffer in IO handlers.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
seqlock: introduce read-write seqlock
Seqlock implementation for QEMU. Usage idiom
reader: do { start = seqlock_read_begin(&sl); ... } while (seqlock_read_retry(&sl, start));
writer: seqlock_write_lock(&sl); ... seqlock_write_unlock(&sl);...
spice: fix multihead support
This patch fixes spice display initialization to handlemultihead properly.
spice-core now keeps track of which QemuConsole has a spicedisplay channel attached to it and which has not. It alsomanages display channel ids....
exec: Fix prototype of phys_mem_set_alloc and related functions
phys_mem_alloc and its assigned values qemu_anon_ram_alloc andlegacy_s390_alloc must have identical argument lists.
legacy_s390_alloc uses the size parameter to call mmap, so size_t isgood enough for all of them....
i386: ACPI table generation code from seabios
This adds C code for generating ACPI tables at runtime,imported from seabios git tree commit 51684b7ced75fb76776e8ee84833fcfb6ecf12dd
Although ACPI tables come from a system BIOS on real hw,it makes sense that the ACPI tables are coupled with the...
acpi: add interface to access user-installed tables
Also add a new API to install builtin tables, sothat we can distinguish between the two.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
loader: use file path size from fw_cfg.h
Avoid a bit of code duplication, makemax file path constant reusable.
Suggested-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>Tested-by: Gerd Hoffmann <kraxel@redhat.com>Reviewed-by: Igor Mammedov <imammedo@redhat.com>...
loader: allow adding ROMs in done callbacks
Don't abort if machine done callbacks add ROMs.
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>Tested-by: Gerd Hoffmann <kraxel@redhat.com>Reviewed-by: Igor Mammedov <imammedo@redhat.com>Tested-by: Igor Mammedov <imammedo@redhat.com>...
i386: define pc guest info
This defines a structure that will be used to fill in acpi tableswhere relevant properties are not yet available using QOM.
Reviewed-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>Tested-by: Gerd Hoffmann <kraxel@redhat.com>...
acpi/piix: add macros for acpi property names
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>Tested-by: Gerd Hoffmann <kraxel@redhat.com>Reviewed-by: Igor Mammedov <imammedo@redhat.com>Tested-by: Igor Mammedov <imammedo@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
piix: APIs for pc guest info
This adds APIs that will be used to fill in guest acpi tables.Some required information is still lacking in QOM, so wefall back on lookups by type and returning explicit types.
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>...
ich9: APIs for pc guest info
This adds APIs that will be used to fill inacpi tables, implemented using QOM,to various ich9 components.Some information is still missing in QOM,so we fall back on lookups by type instead.
pvpanic: add API to access io port
Add API to find pvpanic device and get its io port.Will be used to fill in guest info structure.
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>Tested-by: Gerd Hoffmann <kraxel@redhat.com>Reviewed-by: Igor Mammedov <imammedo@redhat.com>...
hpet: add API to find it
Add API to find HPET using QOM.
fw_cfg: interface to trigger callback on read
loader: support for unmapped ROM blobs
Support ROM blobs not mapped into guest memory:same as ROM files really but use caller's buffer.
Support invoking callback on access andreturn memory pointer making it easierfor caller to update memory if necessary....
pcie_host: expose UNMAPPED macro
Make it possible to test unmapped status through QMP.
pcie_host: expose address format
Callers pass in the address so it's helpful forthem to be able to decode it.
q35: use macro for MCFG property name
Useful to make it accessible through QOM.
q35: expose mmcfg size as a property
Address is already exposed, expose size for symmetry.
qom: add pointer to int property helpers
Make it easy to add read-only helpers for simpleinteger properties in memory.
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>Tested-by: Gerd Hoffmann <kraxel@redhat.com>...
qom: cleanup struct Error references
now that a typedef for struct Error is available,use it in qom/object.h to match coding style rules.
hw/pcie: AER and hot-plug events must use device's interrupt
The fields hpev_intx and aer_intx were removed becauseboth AER and hot-plug events must use device's interrupt.Assert/deassert interrupts using pci irq wrappers instead.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>...
hw/pci: removed irq field from PCIDevice
Instead of exposing the the irq field,pci wrappers to qemu_set_irq or qemu_irq_*can be used.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
cleanup object.h: include error.h directly
qapi/error.h is simple enough to be included in qom/object.hdirecly and prepares qom/object.h to use Error typedef.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
memory: Change MemoryRegion priorities from unsigned to signed
When memory regions overlap, priority can be used to specifywhich of them takes priority. By making the priority values signedrather than unsigned, we make it more convenient to implementa situation where one "background" region should appear only...
hw/pci: partially handle pci master abort
A MemoryRegion with negative priority was created andit spans over all the pci address space.It "intercepts" the accesses to unassigned pciaddress space and will follow the pci spec: 1. returns -1 on read 2. does nothing on write...
hw/core: Add interface to allocate and free a single IRQ
qemu_allocate_irq returns a single qemu_irq.The interface allows to specify an interrupt number.
qemu_free_irq frees it.
hw/pci: add pci wrappers for allocating and asserting irqs
Interrupt pin is selected and saved into PCI_INTERRUPT_PINregister during device initialization. Devices should not calldirectly qemu_set_irq and specify the INTx pin on each call.
Added pci_* wrappers to replace qemu_set_irq, qemu_irq_raise,...
Merge remote-tracking branch 'mdroth/qga-pull-2013-10-10' into staging
Merge remote-tracking branch 'rth/tcg-pull' into staging
Mostly revert "qemu-help: Sort devices by logical functionality"
This reverts most of commit 3d1237fb2ab4edb926c717767bb5e31d6053a7c5.
The commit claims to sort the output of "-device help" "byfunctionality rather than alphabetical". Issues:
blockdev: Introduce DriveInfo.enable_auto_del
BlockDriverStates shouldn't be affected by an unplugged guest device,except if created with the legacy -drive command line option or thedrive_add HMP command.
Make the automatic deletion as well as cancelling of jobs conditional on...
blockdev: Separate ID generation from DriveInfo creation
blockdev-add shouldn't automatically generate IDs, but will keep most ofthe DriveInfo creation code.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Max Reitz <mreitz@redhat.com>Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>...
block/get_block_status: avoid redundant callouts on raw devices
if a raw device like an iscsi target or host device is usedthe current implementation makes a second call out to getthe block status of bs->file.
Signed-off-by: Peter Lieven <pl@kamp.de>Reviewed-by: Eric Blake <eblake@redhat.com>...
block: Add BlockDriver.bdrv_check_ext_snapshot.
This field is used by blkverify to disable external snapshots creation.It will also be used by block filters like quorum to disable externalsnapshot creation.
Signed-off-by: Benoit Canet <benoit@irqsave.net>...
blockjob: rename BlockJobType to BlockJobDriver
We will use BlockJobType as the enum type name of block jobs in QAPI,rename current BlockJobType to BlockJobDriver, which will eventuallybecome a set of operations, similar to block drivers.
Signed-off-by: Fam Zheng <famz@redhat.com>...
qapi: make use of new BlockJobType
Switch the string to enum type BlockJobType in BlockJobDriver.
Signed-off-by: Fam Zheng <famz@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Add bdrv_get_specific_info
Add a function for retrieving an ImageInfoSpecific object from a blockdriver.
Signed-off-by: Max Reitz <mreitz@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qapi: Human-readable ImageInfoSpecific dump
Add a function for generically dumping the ImageInfoSpecific informationin a human-readable format to block/qapi.c.
Use this function in bdrv_image_info_dump and qemu-io-cmds.c:info_f toallow qemu-img info resp. qemu-io -c info to print that format specific...
exec: Add both big- and little-endian memory helpers
Step three in the transition: helpers not tied to the target"default" endianness. To be used when the guest uses a memoryoperation with non-default endianness.
Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging
QOM CPUState refactorings / X86CPU
Merge remote-tracking branch 'amit/char-remove-watch-on-unplug' into staging
qemu-ga: Add interface to traverse the qmp command list by QmpCommand
In the original code, qmp_get_command_list is used to constructa list of all commands' name. To get the information of all qgacommands, it traverses the name list and search the command info...
qemu-ga: Extend 'guest-info' command to expose flag 'success-response'
Now we have several qemu-ga commands not returning response on success.It has been documented in qga/qapi-schema.json already. This patch exposesthe 'success-response' flag by extending 'guest-info' command. With this...
tcg: Put target helper data into an array.
One call inside of a loop to tcg_register_helper instead of hundredsof sequential calls.
Presumably more icache and branch prediction friendly; resulting binarysize mostly unchanged on x86_64, as we're trading 32-bit rip-relative...
tcg-aarch64: Update to helper_ret_*_mmu routines
A minimal update to use the new helpers with the return address argument.
Tested-by: Claudio Fontana <claudio.fontana@linaro.org>Reviewed-by: Claudio Fontana <claudio.fontana@linaro.org>Signed-off-by: Richard Henderson <rth@twiddle.net>
exec: Delete is_tcg_gen_code and GETRA_EXT
All implementations now boil down to GETRA.
Merge remote-tracking branch 'bonzini/scsi-next' into staging