xen, vga: add API for registering the framebuffer
Xen currently uses the name of a memory region to determine whether itis the framebuffer. Replace with an explicit API.
Signed-off-by: Avi Kivity <avi@redhat.com>
framebuffer: drop use of cpu_get_physical_page_desc()
cpu_get_physical_page_desc() is tied into the memory core'sinnards, replace it with uses of the API.
loader: remove calls to cpu_get_physical_page_desc()
framebuffer: drop use of cpu_physical_sync_dirty_bitmap()
Replace with memory API equivalent.
vhost: convert to MemoryListener API
Drop the use of cpu_register_phys_memory_client() in favour of the newMemoryListener API. The new API simplifies the caller, since there is noneed to deal with splitting and merging slots; however this is not exploited...
sysbus: add sysbus_address_space()
Given a bus device, retrieves the memory address space for its bus.
sh_pci: remove sysbus_init_mmio_cb2 usage
The isa region is not exposed as a sysbus region because the iobrregister contains its address and use it to remap dynamicallythe region. (Peter Maydell's idea)
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
ppce500_pci: remove sysbus_init_mmio_cb2 usage
Expose only one container MemoryRegion to sysbus.(Peter Maydell's idea)
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Benoît Canet <benoit.canet@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
sysbus: remove sysbus_init_mmio_cb2
This function is not longer in use so remove it.
Signed-off-by: Benoît Canet <benoit.canet@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qom: introduce get/set methods for Property
This patch adds a visitor interface to Property. This way, QOM will beable to expose Properties that access a fixed field in a struct withoutexposing also the everything-is-a-string "feature" of qdev properties....
qom: distinguish "legacy" property type name from QOM type name
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qom: register qdev properties also as non-legacy properties
Push legacy properties into a "legacy-..." namespace, and make themavailable with correct types too.
For now, all properties come in both variants. This need not be thecase for string properties. We will revisit this after -device is...
qom: fix swapped parameters
Reviewed-by: Anthony Liguori <anthony@codemonkey.ws>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qom: push permission checks up into qdev_property_add_legacy
qdev_property_get and qdev_property_set can generate permissiondenied errors themselves. Do not duplicate this functionality inqdev_get/set_legacy_property, and clean up excessive indentation....
qom: interpret the return value when setting legacy properties
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'qemu-kvm/memory/exec-obsolete' into staging
Merge remote-tracking branch 'qemu-kvm/memory/xen' into staging
etraxfs_eth: drop bogus cpu_unregister_io_memory()
Leftover call to cpu_unregister_io_memory() can segfault on cleanup. Remove.
memory, xen: pass MemoryRegion to xen_ram_alloc()
Currently xen_ram_alloc() relies on ram_addr, which is going away.Give it something else to use as a cookie.
Merge remote-tracking branch 'qemu-kvm/memory/mutators' into staging
Conflicts: memory.h
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
pc: fix event_idx compatibility for virtio devices
event_idx was introduced in 0.15 and must be disabled for all virtio-pci devices(including virtio-balloon-pci).
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Also create piix3 property when Xen is enabled
This recently added line in hw/pc_piix.c is causing a SEGV on a Xensetup because the piix3 property is never created:
qdev_property_add_child(qdev_resolve_path("/i440fx/piix3", NULL), "rtc", (DeviceState *)rtc_state, NULL);...
pc: add pc-0.15
stellaris: Calculate system clock period on reset
Calculate the system clock period on reset; otherwise it remainsset to the default value of zero and attempting to use it provokesa hang. This is one of the issues noted in LP:696094.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
ide: drop argument to dma_buf_commit
The argument is unused and even wrong when the function is calledby ide_handle_rw_error. Drop it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
usb: fix usb_qdev_init() error handling again
Commit f462141f18ffdd75847f6459ef83d90b831d12c0 introduced clean up codewhen usb_qdev_init() fails. Unfortunately it calls .handle_destroy()when .init() was never invoked or failed. This can lead to crashes when...
rtc: make piix3 set the rtc as a child (v2)
rtc: add a dynamic property for retrieving the date
This really shows the power of dynamic object properties compared to qdevstatic properties.
This property represents a complex structure who's format is preserved over thewire. This is enabled by visitors....
qom: optimize qdev_get_canonical_path using a parent link
The full tree search was a bit unreasonable.
qom: add vga node to the pc composition tree
qom: add string property type
qdev: add a qdev_get_type() function and expose as a 'type' property
qdev: provide a path resolution (v2)
There are two types of supported paths--absolute paths and partial paths.
Absolute paths are derived from the root device and can follow child<> orlink<> properties. Since they can follow link<> properties, they can be...
qom: add child properties (composition) (v3)
Child properties express a relationship of composition.
qom: add link properties (v2)
Links represent an ephemeral relationship between devices. They are meant toreplace the qdev concept of busses by allowing more informal relationshipsbetween devices.
Links are fairly limited in their usefulness without implementing QOM-style...
qdev: add explicitly named devices to the root complex
We first add a 'peripheral' container to the root device that we add usercreated devices to. This provides all user created devices with a unique andisolated namespace.
dev: add an anonymous peripheral container
qom: add a reference count to qdev objects
To ensure that a device isn't removed from the graph until all of its links arebroken.
qom: add new dynamic property infrastructure based on Visitors (v2)
qdev properties are settable only during construction and static to classes.This isn't flexible enough for QOM.
This patch introduces a property interface for qdev that provides dynamic...
qom: register legacy properties as new style properties (v2)
Expose all legacy properties through the new QOM property mechanism. The qdevproperty types are exposed through the 'legacy<>' namespace. They are alwaysvisited as strings since they do their own string parsing....
qom: introduce root device
This is based on Jan's suggestion for how to do unique naming. The root deviceis the root of composition. All devices are reachable via child<> links fromthis device.
qdev: provide an interface to return canonical path from root (v2)
The canonical path is the path in the composition tree from the root to thedevice. This is effectively the name of the device.
This is an incredibly unefficient implementation that will be optimized in...
block: dma_bdrv_* does not return NULL
Initially attempted with the following semantic patch:
rule1 expression E;statement S;@@ E =( dma_bdrv_io | dma_bdrv_read | dma_bdrv_write) (...);(- if (E == NULL) { ... } |- if (E) { <... S ...> }...
rule1
block: bdrv_aio_* do not return NULL
Initially done with the following semantic patch:
rule1 expression E;statement S;@@ E =( bdrv_aio_readv | bdrv_aio_writev | bdrv_aio_flush | bdrv_aio_discard | bdrv_aio_ioctl) (...);(- if (E == NULL) { ... }...
Merge remote-tracking branch 'stefanha/trivial-patches-next' into staging
hw: Fix spelling in comments and code
compatiblity->compatibilitytransfered->transferredtransfering->transferring
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw: Fix spelling in comments
adress->addressadvertisment->advertisementbegining->beginningbondary->boundarycontroler->controllercontroll->controlconvertion->conversiondoesnt->doesn'texistant->existentinstuction->instructionloosing->losingmanagment->management...
hw: Fix spelling (licenced->licensed)
New code introduced old misspellings.
fmopl: Fix spelling in code and comments
algorythm->algorithmrythm->rhythm
I did not try to fix the coding standard, so checkpatch.plreports lots of violations.
syborg: drop support for Symbian Virtual Platform
The Symbian Virtual Platform was an ARM-based development and debuggingboard. Since Symbian has been disbanded and the code is no longer beingused it can now be removed.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
qemu-thread: add API for joinable threads
Split from Jan's original qemu-thread-posix.c patch. No semantic change,just introduce the new API that POSIX and Win32 implementations willconform to.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
ccid: make threads joinable
Destroying a mutex that another thread might have just unlockedis racy. It usually works, but you cannot do that in general andcan lead to deadlocks or segfaults. Change ccid to use joinablethreads instead.
(Also, qemu_mutex_init/qemu_cond_init were missing)....
QEMUFileCloseFunc: add return value documentation (v2)
qemu_fclose() and QEMUFile->close will return -errno on error, and anypositive value on success.
We need the positive non-zero success values becausemigration-exec.c:exec_close() relies on non-zero return values to get...
hw/usb-net.c: Fix precedence bug when checking rndis_state
"!X == 2" is always false (spotted by Coverity), so the checksfor whether rndis is in the correct state would never fire.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Remove unnecessary casts from PCI DMA code in PCI IDE
This patch removes some unnecessary casts in the PCI IDE device,introduced by commit 552908fef5b67ad9d96b76d7cb8371ebc26c9bc8'PCI IDE: Use PCI DMA stub functions'.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
Remove unnecessary casts from PCI DMA code in lsi53c895a
This patch removes some unnecessary casts in the lsi53c895a device,introduced by commit 9ba4524cda1348cbe741535f77815dca6a57da05'lsi53c895a: Use PCI DMA stub functions'.
Remove unnecessary casts from PCI DMA code in rtl8139
This patch removes some unnecessary casts in the rtl8139 device,introduced by commit 3ada003aee2004d24f23b9cd6f4eda87d9601ddb'rtl8139: Use PCI DMA stub functions'.
Remove unnecessary casts from PCI DMA code in usb-ehci
This patch removes some unnecessary casts in the usb-ehci device,introduced by commit 68d553587c0aa271c3eb2902921b503740d775b6'usb-ehci: Use PCI DMA stub functions'.
Remove unnecessary casts from PCI DMA code in usb-uhci
This patch removes some unnecessary casts in the usb-uhci device,introduced by commit fff23ee9a5de74ab111b3cea9eec56782e7d7c50'usb-uhci: Use PCI DMA stub functions'.
Remove unnecessary casts from PCI DMA code in eepro100
This patch removes some unnecessary casts in the eepro100 device,introduced by commit 16ef60c9a8eeee269f7cbc95219a431b1d7cbf29'eepro100: Use PCI DMA stub functions'.
Remove unnecessary casts from PCI DMA code in e1000
This patch removes some unnecessary casts in the e1000 device,introduced by commit 62ecbd353d25e62c4a6c327ea88ba5404e13507a 'e1000:Use PCI DMA stub functions'.
hw/arm_mptimer.c: Turn ARM MPcore private timers into qdev devices
Turn the ARM MPcore private timer/watchdog blocks into separateqdev devices. This will allow us to share them neatly between11MPCore and A9MPcore.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm_gic: Expose GIC CPU interfaces as sysbus memory regions
Expose the ARM GIC CPU interfaces as memory regions, rather thanjust providing read and write functions for them.
hw/mpcore.c: Use the GIC memory regions for the CPU interface
Switch to using the GIC memory regions for the CPU interfacerather than hand implementing them as a subcase of mpcore_priv_read()and mpcore_priv_write().
hw/realview_gic: Use GIC memory region for the CPU interface
Use the GIC provided memory region for the CPU interface ratherthan implementing our own.
hw/mpcore: Clean up mpcore_priv_read/write as they are now SCU only
The only code left in mpcore_priv_read and mpcore_priv_write is nowthe implementation of the SCU registers. Clean up by renaming functionsand removing some unnecessary conditionals to make this clearer....
hw/a9mpcore.c: Implement A9MP peripherals rather than 11MPcore ones
Implement the A9MP private peripheral region correctly, ratherthan piggybacking on the 11MPCore code; the two CPUs are not thesame in this area.
hw/mpcore.c: Merge with hw/arm11mpcore.c
hw/mpcore.c is now implementing only ARM11MPCore specific peripherals,and is #included only from hw/arm11mpcore.c, so just merge it into thatfile.
Fix sp804 dual-timer
Properly implement dual-timer read/write for the sp804 dual timer module.Based on ARM specs athttp://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0271d/index.html
Signed-off-by: Hans Jang <hsjang@ok-labs.com>Signed-off-by: David Mirabito <david.mirabito@nicta.com.au>...
virtio-pci: use pci macros
Signed-off-by: Hui Kai Ran <hkran@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
mips_malta: resolve endless loop when loading bios
Tested-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Chen Rui <chennrui@gmail.com>
Convert source files to UTF-8 encoding
Most QEMU files either are pure ASCII or use UTF-8.Convert some files which still used ISO-8859-1 to UTF-8.
fix typo: delete redundant semicolon
Double semicolons should be single.
Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
fix spelling in hw sub directory
Correct obvious spelling errors in qemu/hw directory.
pcie_aer: adjust do_pcie_aer_inejct_error -> do_pcie_aer_inject_error
This function name is a bit wrong. Although it doesn't impact function, it is a bit necessary that we should fixup it.
Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/arm_gic.c: Ignore attempts to complete nonexistent IRQs
Ignore attempts to complete non-existent IRQs; this fixes a bufferoverrun if the guest writes a bad value to the GICC_EOIR register.(This case is UNPREDICTABLE so ignoring it is a valid choice.)...
pseries: Fix array overrun bug in PCI code
spapr_populate_pci_devices() containd a loop with PCI_NUM_REGIONS (7)iterations. However this overruns the 'bars' global array, which only has6 elements. In fact we only want to run this loop for things listed in the...
Fix hw_error messages from arm_timer.c
Two of the calls to hw_error() in arm_timer.c contain the wrong function name.
As suggested by Andreas Färber, use the C99 standard func macro toget the correct name, instead of putting the name directly into the code....
Merge remote-tracking branch 'aneesh/1.0-fixes' into staging
Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging
block: convert qemu_aio_flush() calls to bdrv_drain_all()
Many places in QEMU call qemu_aio_flush() to complete all pendingasynchronous I/O. Most of these places actually want to drain all blockrequests but there is no block layer API to do so.
This patch introduces the bdrv_drain_all() API to wait for requests...
xen_disk: remove dead code
Xen_disk.c has support for using synchronous I/O instead of asynchronous,but it is compiled out by default. Remove it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
piix_pci: adapt smram mapping to use memory mutators
Eliminates fake state ->smram_enabled.
cirrus_vga: adapt to memory mutators API
Simplify the code by avoiding dynamic creation and destruction ofmemory regions.
hw/9pfs: use migration blockers to prevent live migration when virtfs export path is mounted
Now when you try to migrate with VirtFS export path mounted, you get a proper QMP error:
(qemu) migrate tcp:localhost:4444Migration is disabled when VirtFS export path '/tmp/' is mounted in the guest using mount_tag 'v_tmp'...
hw/9pfs: Reset server state during TVERSION
As per the 9p rfc, during TVERSION its necessary to clean all the activefids, so that we start the session from a clean state. Its also needed inscenarios where the guest is booting off 9p, and boot fails, and client...
hw/9pfs: Add qdev.reset callback for virtio-9p-pci device
Add the device reset callback
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs: Use the correct file descriptor in Fsdriver Callback
Fsdriver callback that operate on file descriptor need todifferentiate between directory fd and file fd.
Based on the original patch from Sassan Panahinejad <sassan@sassan.me.uk>
hw/9pfs: Improve portability to older systems
handle fs driver require a set of newly added syscalls. Don'tCompile handle FS driver if those syscalls are not available.Instead of adding #ifdef for all those syscalls we check foropen by handle syscall. If that is available then rest of the...
sonic: fix typo
Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qxl: Don't convert from size_t to int and back in qxl_cursor()
Just for cleanliness; it would take a truly gigantic cursor to break.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
ccid: Fix buffer overrun in handling of VSC_ATR message
ATR size exceeding the limit is diagnosed, but then we merrily use itanyway, overrunning card->atr[].
The message is read from a character device. Obvious securityimplications unless the other end of the character device is trusted....
9pfs: improve portability to older systems
I guess we can also make sure we don't call local_ioc_getversion atall.
Reported-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
eepro100: Fix alignment requirement for statistical counters
According to Intel's Open Source Software Developer Manual,the dump counters address must be Dword aligned.
The new code enforces this alignment, so s->statsaddr may nowbe used with stw_le_pci_dma() and stl_le_pci_dma()....
virtio: add and use virtio_set_features
vdev->guest_features is not masking features that are not supported bythe guest. Fix this by introducing a common wrapper to be used by allvirtio bus implementations.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
Small requirements on "new" features have percolated to virtio-9p-local.c.In particular, the utimensat wrapper actually only supports dirfd = AT_FDCWDand flags = AT_SYMLINK_NOFOLLOW in the fallback code. Remove the arguments...