ioapic: Drop post-load irr initialization
As all devices undergo a reset prior to vmloa, and the reset value ofirr is 0, we do not need to do this clearing for older vmstatesexplicitly. Dropping this redundant code will also make KVM integrationa bit simpler....
apic: Inject external NMI events via LINT1
On real hardware, NMI button events are injected via the LINT1 line ofthe APICs. E.g. kdump expect this wiring and gets upset if the per-APICLINT1 mask is not respected, i.e. if NMIs are injected to VCPUs that...
apic: Introduce apic_report_irq_delivered
The in-kernel i8259 and IOAPIC backends for KVM will need this, soencapsulate the shared bits.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
apic: Factor out base class for KVM reuse
The KVM in-kernel APIC model will reuse parts of the user space modelwhile providing the same frontend view to guest and most managementinterfaces.
Factor out an APIC base class to encapsulate those parts that will be...
apic: Open-code timer save/restore
To enable migration between accelerated and non-accelerated APIC models,we will need to handle the timer saving and restoring specially and canno longer rely on the automatics of VMSTATE_TIMER. Specifically,accelerated model will not start any QEMUTimer....
i8259: Completely privatize PicState
Use DeviceState instead of PicState in the public i8259 API. This iscleaner and allows to reorganize the PIC data structures for KVM reuse.
i8259: Factor out base class for KVM reuse
Analogously to the APIC, we will reuse some parts of the user spacei8259 model for KVM. The base class provides a common device state, thevmstate, the property list, a reset core and some shared init bits.
This also introduces a common helper to instantiate a single i8259 chip...
msi: Generalize msix_supported to msi_supported
Rename msix_supported to msi_supported and control MSI and MSI-Xactivation this way. That was likely to original intention for thisflag, but MSI support came after MSI-X.
kvm: Move kvmclock into hw/kvm folder
More KVM-specific devices will come, so let's start with moving thekvmclock into a dedicated folder.
apic: Stop timer on reset
All LVTs are masked on reset, so the timer becomes ineffective. Lettingit tick nevertheless is harmless, but will at least create a spurioustrace event.
pxa2xx_keypad: fix unbalanced parenthesis.
Breakage introduced by me when ammending a previous patch, sorry.
hw/arm_boot.c: Make SMP boards specify address to poll in bootup loop
The secondary CPU bootloader in arm_boot.c holds secondary CPUs in apen until the primary CPU releases them. Make boards specify theaddress to be polled to determine whether to leave the pen (it was...
hw/sysbus.h: Increase maximum number of device IRQs.
Samsung exynos4210 Interrupt Combiner needs 512 IRQ sources.
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
pxa2xx_keypad: make single automatic scans work
u-boot uses single automatic scans and polling inpxa2xx_keypad driver, so clear KPC_AS bit immediatelyand update keys state even if KPC_AS and KPC_ASACT arecleared.
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>...
pxa2xx_lcd: fix palette parser
Pallete entry size for 16bpp format is 2 bytes, not 4
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
isapc: Fix segfault during initialization
Obviously, linking the RTC device state to the PIIX does not belong intothe common path that is shared with the isapc.
prepare for future GPLv2+ relicensing
All files under GPLv2 will get GPLv2+ changes starting tomorrow.event_notifier.c and exec-obsolete.h were only ever touched by Red Hatemployees and can be relicensed now.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
qdev: Add a 'free' method to disassociate chardev from qdev device
When a device is removed, remove the association with a chardev, if any,so that the chardev can be re-used later for other devices.
Reported-by: Qunfang Zhang <qzhang@redhat.com>Fix-suggested-by: Markus Armbruster <armbru@redhat.com>...
virtio-console: no need to remove char handlers explicitly
qdev is now equipped (thanks to the last commit) to disassociatechardevs from the qdev devices on the devices going away. So doing itin the virtio-console driver is not necessary.
Since that was the only thing being done in the qdev exit method, drop...
vmstate: extract declarations out of hw/hw.h
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-blk: refuse SG_IO requests with scsi=off
QEMU does have a "scsi" option (to be used like -devicevirtio-blk-pci,drive=foo,scsi=off). However, it onlymasks the feature bit, and does not reject the commandif a malicious guest disregards the feature bits and...
rtc: clear non-PF bits when reinjecting on ack
When an rtc interrupt is reinjected immediately after being acked,other interrupts should not be reinjected, so do clear their bits.
Also, if the periodic interrupts have been disabled before acking,do not reinject, as the guest might get very confused!...
ptimer: move declarations to ptimer.h
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: fix device_del by refactoring reference counting
Commit 8eb0283 broken device_del by having too overzealous reference countingchecks. Move the reference count checks to qdev_free(), make sure to removethe parent link on free, and decrement the reference count on property removal....
rtc: fix 12-hour mode
Hours in 12-hour mode are in the 1-12 range, not 0-11.
rtc: raise AF bit when the alarm is encountered but AIE=0
rtc: raise PF bit when the periodic timer triggers but PIE=0
omap_dss: correct chip1 index in RFBI_READ/RFBI_STATUS
The RFBI_READ/RFBI_STATUS code incorrectly uses chip0 when it shouldbe using chip1. Andrzej Zaborowski <balrog@zabor.org> confirmed thisbug since I don't know this code well.
Reported-by: Dr David Alan Gilbert <davidagilbert@uk.ibm.com>...
Add 'fall through' comments to case statements without break
These comments are used by static code analysis tools and in code reviewsto avoid false warnings because of missing break statements.
The case statements handled here were reported by coverity....
vga: optimize ppm_save() divisions
ppm_save() spends upwards of 50% of its time doing divisions. Replace themwith shifts.
Reviewed-by: Alon Levy <alevy@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
etraxfs-dma: Model metadata and eop
- Send EOP flags to the out channels.- Send data descriptor metadata to the out channels.
Signed-off-by: Lars Persson <larper@axis.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
wm8750: Fix calculation of number of array elements
Coverity says that the division by sizeof(*s->rate) might be wrong.I think that coverity is right.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
elf: Improve symbol lookup (optimize, fix for bsd-user)
Coverity complained about local variable key which was only partiallyinitiated. Only key.st_value was set. As this was also the only partof key which was used in function symfind, the code could be optimized...
hw/integratorcp: Simplify flash remap code
Use the new memory mutator API to simplify the flash remap code;this allows us to drop the flash_mapped flag.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Andreas Färber <afaerber@suse.de>...
hw/integratorcp: Fix sense of REMAP bit
Fix the sense of the REMAP bit: 0 should mean "map flash",1 should mean "map RAM".
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Merge branch 's390-next' of git://repo.or.cz/qemu/agraf
vhost: improve region filtering
vhost memory management doesn't care about non-memory (e.g. PIO) or non-RAMregions. Adjust the filtering to reflect that, and move it earlier so itapplies to mem_sections too.
Signed-off-by: Avi Kivity <avi@redhat.com>...
vhost: fix mem_sections memory corruption
A memset() used to delete an entry in an array did not take into accountthe array element's size.
Signed-off-by: Avi Kivity <avi@redhat.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>
vhost: fix incorrect userspace address
MemoryListener::region_add() gives us a slice of a MemoryRegion, not aregion. Adjust the userspace address to reflect that.
Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
sm501: Fix size of color_reg
color_reg is expected to hold 32 bit values, so it was too small.
This bug was reported by coverity:
hw/sm501.c:624:result_independent_of_operands:color_reg >> 16 is 0 regardless of the values of its operands.This occurs as the bitwise first operand of '&'....
malta: Fix regression (i8259 interrupts did not work)
Commit 5632ae46d5bda798e971dae48ebb318ac2c3686a passes the addressof i8259 to qemu_irq_proxy. i8259 is an auto variable with undefinedvalue outside of mips_malta_init.
This made the interrupt proxy unusable: either QEMU crashes, or...
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
virtio-9p-proxy: Fix typo causing compile failure on 32 bit hosts
Fix a compile failure on 32 bit hosts (integer constant is too largefor 'unsigned long' type) by correcting a typo where the mask usedfor filling in the second f_fsid word had too many 'F's in it....
Strip trailing '\n' from error_report()'s first argument (again)
Commit 6daf194d got rid of them, but Hans and Gerd added some morelately. Tracked down with this Coccinelle semantic patch:
r expression fmt; position p;@@ error_report(fmt, ...)@p...
r
scsi virtio-blk usb-msd: Clean up device init error messages
Replace
error_report("DEVICE-NAME: MESSAGE");
by just
error_report("MESSAGE");
in block device init functions.
DEVICE-NAME is bogus in some cases: it's "scsi-disk" for devicescsi-hd and scsi-cd, "virtio-blk-pci" for virtio-blk-s390, and...
Merge remote-tracking branch 'amit/master' into staging
Merge remote-tracking branch 'aneesh/for-upstream' into staging
Merge remote-tracking branch 'kraxel/usb.33' into staging
usb-storage: cancel I/O on reset
When resetting the usb-storage device we'll have to carefully canceland clear any requests which might be in flight, otherwise we'll confusethe state machine.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-ohci: td.cbp incorrectly updated near page end
The current code that updates the cbp value after a transfer looks like this:td.cbp += ret;if ((td.cbp & 0xfff) + ret > 0xfff) { <handle page overflow>because the 'ret' value is effectively added twice the check may fire too early...
Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into staging
hw/9pfs: Add support to use named socket for proxy FS
Add option to use named socket for communicating between proxy helperand qemu proxy FS. Access to socket can be given by using command lineoptions -u and -g.
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>...
hw/9pfs: Proxy getversion
Add proxy getversion to get generation number
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs: xattr interfaces in proxy filesystem driver
Add xattr support for proxy FS
hw/9pfs: File ownership and others
Add file ownership interfaces like chmod/chown, utime update, rename,remove and truncating files for proxy FS
hw/9pfs: Add stat/readlink/statfs for proxy FS
hw/9pfs: Create other filesystem objects
Add interfaces to create filesystem objects like directory,device nodes, symbolic links, links for proxy filesytem driver
hw/9pfs: Open and create files
Add interfaces to open and create files for proxy file system driver.
hw/9pfs: File system helper process for qemu 9p proxy FS
Provide root privilege access to QEMU 9p proxy filesystem using socketcommunication.
Proxy helper is started by root user as:~ # virtfs-proxy-helper -f|--fd <socket descriptor> -p|--path <path-to-share>...
hw/9pfs: Add new proxy filesystem driver
Add new proxy filesystem driver to add root privilege to qemu process.It needs a helper process to be started by root user.
Following command line can be used to utilize proxy filesystem driver-virtfs proxy,id=<id>,mount_tag=<tag>,socket_fd=<socket-fd>...
hw/9pfs: Add validation to {un}marshal code
hw/9pfs: Move opt validation to FsDriver callback
This remove all conditional code from common code path andmake opt validation a FSDriver callback.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs: Move pdu_marshal/unmarshal code to a seperate file
Move p9 marshaling/unmarshaling code to a separate file so thatproxy filesytem driver can use these calls. Also made marshalingcode generic to accept "struct iovec" instead of V9fsPDU.
hw/omap1.c: Separate dpll_ctl from omap_mpu_state
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>[Riku Voipio: Fixes and restructuring patchset]Signed-off-by: Riku Voipio <riku.voipio@iki.fi>[Peter Maydell: More fixes and cleanups for upstream submission]...
hw/omap1.c: Drop unused includes
Drop includes of qemu-timer.h, qemu-char.h and pc.h as they are nolonger needed.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/omap_gpmc: Fix region map/unmap when configuring prefetch engine
When configuring the prefetch engine (and also when resetting froma state where the prefetch engine was enabled) be careful to adhereto the "unmap/change config fields/map" ordering, to avoid trying...
arm: add missing scu registers
Add power control register to a9mpcore
Signed-off-by: Rob Herring <rob.herring@calxeda.com>Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
arm: Set frequencies for arm_timer
Use qdev properties to allow board modelers to set the frequenciesfor the sp804 timer. Each of the sp804's timers can have anindividual frequency. The timers default to 1MHz.
Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>...
arm: add dummy gic security registers
Implement handling for the RAZ/WI gic security registers.
add L2x0/PL310 cache controller device
This is just a dummy device for ARM L2 cache controllers, based on thepl310. The cache type parameter can be defined by a property valueand has a meaningful default.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>...
hw/omap1.c: Separate PWT from omap_mpu_state
vmstate, memory: decouple vmstate from memory API
Currently creating a memory region automatically registers it forlive migration. This differs from other state (which is enumeratedin a VMStateDescription structure) and ties the live migration codeinto the memory core....
hw/omap1.c: Separate PWL from omap_mpu_state
hw/omap1.c: omap_mpuio_init() need not be public
omap_mpuio_init() is only used and defined in omap1.c, so make it static.
hw/pl110.c: Add post-load hook to invalidate display
Add a post-load hook which invalidates the display. In particular, if wedon't do this and the display size we've just reloaded is larger thanthe default then we will segfault trying to read off the end of the buffer....
hw/pl181.c: Add save/load support
Add save/load support to the PL181.
[S390] Add hotplug support
I just submitted a few patches that enable the s390 virtio bus to receivea hotplug add event. This patch implements the qemu side of it, so that newhotplug events can be submitted to the guest.
Signed-off-by: Alexander Graf <agraf@suse.de>...
Add generic drive hotplugging
The monitor command for hotplugging is in i386 specific code. This is justplain wrong, as S390 just learned how to do hotplugging too and needs toget drives for that.
So let's add a generic copy to generic code that handles drive_add in a...
Merge remote-tracking branch 'qemu-kvm/memory/page_desc' into staging
vhost: avoid cpu_get_physical_page_desc()
This reaches into the innards of the memory core, which are beingchanged. Switch to a memory API version.
Signed-off-by: Avi Kivity <avi@redhat.com>
virtio-balloon: avoid cpu_get_physical_page_desc()
pseries: Populate "/chosen/linux,stdout-path" in the FDT
There is a device tree property "/chosen/linux,stdout-path" which indicateswhich device should be used as stdout - ie. "the console".
Currently we don't specify anything, which means both firmware and Linux...
pseries: Check for duplicate addresses on the spapr-vio bus
Check that devices on the spapr vio bus aren't given duplicateaddresses. Currently we will not run with duplicate devices, thefdt code will spot it, but the error reporting is not great. Withthis patch we can report the error nicely in terms of the device...
pseries: Remove hcalls callback
For forgotten historical reasons, PAPR hypercalls for specific virtual IOdevices (oh which there are quite a number) are registered via a callbackin the VIOsPAPRDeviceInfo structure.
This is kind of ugly, so this patch instead registers hypercalls from...
pseries: FDT NUMA extensions to support multi-node guests
Add NUMA specific properties to guest's device tree to boot a multi-nodeguests. This patch adds the following properties:
ibm,associativityibm,architecture-vec-5ibm,associativity-reference-points...
pseries: Emit device tree nodes in reg order
Although in theory the device tree has no inherent ordering, in practicethe order of nodes in the device tree does effect the order that devicesare detected by software.
Currently the ordering is determined by the order the devices appear on...
pseries: Add a routine to find a stable "default" vty and use it
In vty_lookup() we have a special case for supporting early debug inthe kernel. This accepts reg == 0 as a special case to mean "any vty".
We implement this by searching the vtys on the bus and returning the...
kvm-ppc: halt secondary cpus when guest reset
When guest reset, we need to halt secondary cpus until guest kick them.This already works for tcg. The patch add the support for kvm.
Signed-off-by: Liu Yu <yu.liu@freescale.com>Signed-off-by: Alexander Graf <agraf@suse.de>...
virtio-console: Fix failure on unconnected pty
when I tried qemu with -virtio-console pty the guest hangs and attachingon /dev/pts/<x> does not return anything if the attachment is too late.
This results in pty_chr_write() returning 0, which causes the port to...
Set numa topology for max_cpus
qemu-kvm passes numa/SRAT topology information for smp_cpus to SeaBIOS. HoweverSeaBIOS always expects to setup max_cpus number of SRAT cpu entries(MaxCountCPUs variable in build_srat function of Seabios). When qemu-kvm runs...
virtio-console: Check if chardev backends available before calling into them
For the callback functions invoked by the virtio-serial-bus code, checkif we have chardev backends registered before we call into the chardevfunctions.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
virtio-console: Properly initialise class methods
The earlier code really was a hack: initialising class methods in anobject init function as noted by Anthony.
The motivation for that was to not have the virtio-serial-bus call intothe callback functions if there was no chardev backend registered....
virtio-serial-bus: Ports are expected to implement 'have_data' callback
There's no need to check if ports can accept any incoming data from theguest each time the guest sends data. Check if the port implements suchfunctionality during port initialisation....
hw/9pfs: Use the correct signed type for different variables
hw/9pfs: iattr_valid flags are kernel internal flags map them to 9p values.
Kernel internal values can change, add protocol values for these constant anduse them.
hw/9pfs: replace iovec manipulation with QEMUIOVector
The v9fs_read() and v9fs_write() functions rely on iovec[] manipulationcode should be replaced with QEMUIOVector to avoid duplicating code.In the future it may be possible to make the code even more concise by...
sd: Remember to reset .expecting_acmd on reset.
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/sd.c: Clear status bits when read via response r6
Response format r6 includes a subset of the status bits;clear the clear-on-read bits which are read by an r6 response.