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.
hw/sd.c: Correct handling of APP_CMD status bit
Fix some bugs in our implementation of the APP_CMD status bit: * the response to an ACMD should have APP_CMD set, not cleared * if an illegal ACMD is sent then the next command should be handled as a normal command...
hw/sd.c: Correct handling of type B SD status bits
Correct how we handle the type B ("cleared on valid command")status bits. In particular, the CURRENT_STATE bits in a responseshould be the state of the card when it received that command,not the state when it received the preceding command. (This is...
hw/sd.c: Set ILLEGAL_COMMAND for ACMDs in invalid state
App commands in an invalid state should set ILLEGAL_COMMAND, notmerely return a zero response.
hw/sd.c: Handle CRC and locked-card errors in normal code path
Handle returning CRC and locked-card errors in the same code pathwe use for other responses. This makes no difference in behaviourbut means that these error responses will be printed by the debug...
hw/sd.c: Handle illegal commands in sd_do_command
Add an extra sd_illegal value to the sd_rsp_type_t enum so thatsd_app_command() and sd_normal_command() can tell sd_do_command()that the command was illegal. This is needed so we can do thingslike reset certain status bits only on receipt of a valid command....
hw/sd.c: When setting ADDRESS_ERROR bit, don't clear everything else
Fix a typo that meant that ADDRESS_ERRORs setting or clearing writeprotection would clear every other bit in the status register.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
hw/sd.c: On CRC error, set CRC error status bit rather than clearing it
If we fail to validate the CRC for an SD command we should be settingCOM_CRC_ERROR, not clearing it. (This bug actually has no effect currentlybecause sd_req_crc_validate() always returns success.)...
hw/sd.c: Add comment regarding CARD_STATUS_* defines
Add a clarifying comment about what the CARD_STATUS_[ABC]macros are defining.
hw/sd.c: Fix the set of commands which are failed when card is locked
Fix bugs in the code determining whether to accept a command when theSD card is locked. Most notably, we had the condition completelyreversed, so we would accept all the commands we should refuse and...
isa: always use provided ISA bus in isa_bus_irqs()
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
audio: remove unused parameter isa_pic
hw/sysbus.c: Remove unnecessary conditionals
Now that all sysbus MMIO regions are MemoryRegions, mmio[n].memoryis never NULL, and we can remove some unnecessary conditionals.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
isa: give ISABus/ISADevice to isa_create(), isa_bus_irqs() and isa_get_irq() functions
NULL is a valid bus/device, so there is no change in behaviour.
isa: move ISABus structure definition to header file
i8259: give ISA device to isa_register_ioport()
pc: give ISA bus to ISA methods
alpha: give ISA bus to ISA methods
sun4u: give ISA bus to ISA methods
fulong2e: give ISA bus to ISA methods
malta: give ISA bus to ISA methods
isa: always use provided ISA bus when creating an isa device
i440fx: remove piix3 field
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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.
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.
qdev: fix hotplug when no -device is specified
The peripheral[-anon] containers are initialized lazily but since they sit onsysbus, they can not be created after realize. This was causing an abort() tooccur during hotplug if no -device option was used....