fdc-test: split test_media_change() test, so insert part can be reused
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
fdc-test: insert media before fuzzing registers
A media will be required for future fdc tests.
fdc-test: add tests for non-DMA READ command
qemu: Document GlusterFS block driver usage
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qcow2: Fix refcount table size calculation
A missing factor for the refcount table entry size in the calculationcould mean that too little memory was allocated for the in-memoryrepresentation of the table, resulting in a buffer overflow.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
qemu-iotests: qcow2: Test growing large refcount table
Actually writing all the content with 512 byte sector size would takeforever, therefore build the image file with a Python script and useqemu-io for the last write that actually triggers the refcount table...
MAINTAINERS: add Stefan Hajnoczi as block and virtio-blk co-maintainer
Kevin has requested co-maintainership to give him more time to writecode. We will alternate patch review duties on a weekly basis.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>...
block: Workaround for older versions of MinGW gcc
Versions before gcc-4.6 don't support unnamed fields in initializers(see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676).
Offset and OffsetHigh belong to an unnamed struct which is part of anunnamed union. Therefore the original code does not work with older...
tests: allow qemu-iotests to be run against nbd backend
To do this, we start a qemu-nbd process at _make_test_img and killit in _cleanup_test_img. $TEST_IMG is changed to point at the TCPserver. We also remove the checks for existence of binaries fromcommon.config - they're duplicated in common, and we can make the...
aio: switch aiocb_size type int -> size_t
Using appropriate types for variables is a good thing :). All userssimply do sizeof(MyType) and the value is passed to a memory allocator,it should be size_t.
aio: use g_slice_alloc() for AIOCB pooling
AIO control blocks are frequently acquired and released because each aiorequest involves at least one AIOCB. Therefore, we pool them to avoidheap allocation overhead.
The problem with the freelist approach in AIOPool is thread-safety. If...
aio: rename AIOPool to AIOCBInfo
Now that AIOPool no longer keeps a freelist, it isn't really a "pool" anymore. Rename it to AIOCBInfo and make it const since it no longerneeds to be modified.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
fdc: Remove status0 parameter from fdctrl_set_fifo()
It decided whether an interrupt is triggered. Only one caller made useof this functionality, so move the code there.
In this one caller, the interrupt must actually be triggeredunconditionally, like it was before commit 2fee0088. For example, a...
Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-1.3.0-rc0' into staging
vfio-pci: KVM INTx accel & common msi_get_message
Merge remote-tracking branch 'kraxel/pixman.v5' into staging
Merge remote-tracking branch 'bonzini/nbd-next' into staging
Merge remote-tracking branch 'bonzini/scsi-next' into staging
Merge remote-tracking branch 'kraxel/usb.70' into staging
Merge remote-tracking branch 'spice/spice.v63' into staging
pixman: cleanup properly on make distclean
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
pixman: add licensing info
pixman: build internal version early
Signed-off-by: Eric Johnson <ericj@mips.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
pixman: pass cflags, add -fPIC
Pass on CFLAGS to the pixman configure script.Add -fPIC to the cflags, needed to make the final link succeed.
pixman: disable gtk
gtk is only needed to build test cases.Disable it to simplify the build.
pixman: set --host for cross builds
Set --host when calling pixman configure while doing cross builds sopixman's autoconf picks up the cross build tools correctly.
pixman: add output dir to include path
Needed to make sure the (generated) pixman-version.h file is found.Based on a patch from Blue Swirl.
linux-headers: Update to 3.7-rc5
update-linux-headers.sh script run against Linux tag v3.7-rc5
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
vfio-pci: Add KVM INTx acceleration
This makes use of the new level irqfd support enabling bypass of qemuuserspace both on INTx injection and unmask. This significantlyboosts the performance of devices making use of legacy interrupts (ex.~60% better netperf TCP_RR scores for an e1000e assigned to a Linux...
vfio-pci: Use common msi_get_message
We can get rid of our local version now that a helper exists.
nbd: fixes to read-only handling
We do not need BLKROSET if the kernel supports setting flags.Also, always do BLKROSET even for a read-write export, otherwisethe read-only state remains "sticky" after the invocation of"qemu-nbd -r".
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
aio: fix aio_ctx_prepare with idle bottom halves
Commit ed2aec4867f0d5f5de496bb765347b5d0cfe113d changed the returnvalue of aio_ctx_prepare from false to true when only idle bottomhalves are available. This broke PC old-style DMA, which uses them.Fix this by making aio_ctx_prepare return true only when non-idle...
dma: Define dma_context_memory and use in sysbus-ohci
Define a new global dma_context_memory which is a DMAContext correspondingto the global address_space_memory AddressSpace. This can be used bysysbus peripherals like sysbus-ohci which need to do DMA....
virtio-scsi: use dma_context_memory
Until address_space_rw was introduced, NULL was accepted as aplaceholder for DMA with no IOMMU (to address_space_memory).
This does not work anymore, and dma_context_memory needs tobe specified explicitly.
megasas: Correct target/lun mapping
The structure to reference a logical drive has an unused field,which can be used to carry the lun ID. This enabled seabios toestablish the proper target/LUN mapping.
Cc: Paolo Bonzini <pbonzini@redhat.com>Cc: Gerd Hoffmann <kraxel@redhat.com>...
scsi: do not return short responses for emulated commands
The inquiry command, for the case of VPD=1, was returning shortresponses; the number of returned bytes was just the number of bytesin the request, without padding to the specified allocation length...
virtio-scsi: factor checks for VIRTIO_SCSI_S_DRIVER_OK when reporting events
Suggested by Laszlo Ersek.
scsi: remove superfluous call to scsi_device_set_ua
megasas: do not include block_int.h
scsi-disk: flush cache after disabling it
SBC says that "if an application client changes the WCE bit from one tozero via a MODE SELECT command, then the device server shall writeany data in volatile cache to non-volatile medium before completingthe command"....
nbd: fix nbd_server_stop crash when no server was running
This failed on the new assertion of qemu_set_fd_handler2:
qemu-system-x86_64: /home/pbonzini/work/upstream/qemu/iohandler.c:60: qemu_set_fd_handler2: Assertion `fd >= 0' failed.
nbd: force read-only export for read-only devices
This is the desired behavior for HMP, but it is a better choice for QMP as well.
nbd: disallow nbd-server-add before nbd-server-start
It works nicely with the QMP commands, but it adds useless complicationwith HMP. In particular, see the following:
(qemu) nbd_server_add -w scsi0-hd0 (qemu) nbd_server_start -a localhost:10809...
hmp: add NBD server commands
nbd: accept URIs
The URI syntax is consistent with the Gluster syntax. Export namesare specified in the path, preceded by one or more (otherwise unused)slashes.
qemu-nbd: initialize main loop before block layer
qemu-nbd was broken because they initialized the block layer whileqemu_aio_context was still NULL.
nbd: accept relative path to Unix socket
Adding the "is_unix" member now will simplify the parsing of NBD URIs.
tcg: properly check that op's output needs to be synced to memory
Fix typo introduced in b3a1be87bac3a6aaa59bb88c1410f170dc9b22d5.
Reported-by: Ruslan Savchenko <ruslan.savchenko@gmail.com>Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-mips: Fix seg fault for LUI when MIPS_DEBUG_DISAS==1.
The call to gen_logic_imm for OPC_LUI passes -1 for rs. Thiscauses the MIPS_DEBUG statement to seg fault due to the deferenceof regnames[rs]. This patch fixes that.
Signed-off-by: Eric Johnson <ericj@mips.com>...
target-i386: avoid using cpu_single_env
Pass around CPUArchState instead of using global cpu_single_env.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Reviewed-by: Andreas Färber <afaerber@suse.de>
m48t59: remove unused m48t59_set_addr
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
sun4c: remove unused functions
slirp: remove unused function u_sleep
disas: avoid using cpu_single_env
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Acked-by: Richard Henderson <rth@twiddle.net>Acked-by: Aurelien Jarno <aurelien@aurel32.net>Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
kvm: avoid using cpu_single_env
target-unicore32: avoid using cpu_single_env
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>Reviewed-by: Andreas Färber <afaerber@suse.de>
target-xtensa: avoid using cpu_single_env
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Acked-by: Max Filippov <jcmvbkbc@gmail.com>Reviewed-by: Andreas Färber <afaerber@suse.de>
tests/tcg: new test for i386 FPREM and FPREM1
This is setting the stage for a cleanup of FPREM and FPREM1 helpers while beingsure that they behave same as bare metal.
The test constructs operands using combinations of corner cases for thefloating-point bitfields and prints operands, result and FPU status word for...
memory: Don't dump disabled regions
This makes "info mtree" output readable again.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
memory: Reintroduce dirty flag to optimize changes on disabled regions
Cirrus is triggering this, e.g. during Win2k boot: Changes only ondisabled regions require no topology update when transaction depth dropsto 0 again.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
qemu-timer: Fix compilation for non-POSIX hosts
A compiler warning is caused by the unused local function reinit_timerson non-POSIX hosts. Include that function only for POSIX hosts.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
vmware_vga: Add back some info in local state partially reverting aa32b38c
Keep saving display surface parameters at init and using these cachedvalues instead of getting them when needed. Not sure why this isneeded (maybe due to the interaction with the vga device) but not...
kvmvapic: Fix TB invalidation after instruction patching
Since 0b57e287, cpu_memory_rw_debug already triggers a TB invalidation.As it doesn't (and cannot) set is_cpu_write_access=1 but "consumes" thecurrently executed TB, the tb_invalidate_phys_page_range call from...
ehci: fix migration
Commit 5010d4dc618b6b8e7c21129c487c06f6493f71fc reorganized vmstate tosplit core + pci, but got two little details wrong. Fix them.
xhci: Fix some DMA host endian bugs
The xhci device does correct endian switches on the results of some DMAsbut not all. In particular, there are many DMAs of what are essentiallyarrays of 32-bit integers which never get byteswapped. This causes them...
ehci: Add support for packets with both data and an error status
Signed-off-by: Hans de Goede <hdegoede@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
xhci: Add support for packets with both data and an error status
usb/combined-packet: Move freeing of combined to usb_combined_packet_remove()
usb: split packet result into actual_length + status
Since with the ehci and xhci controllers a single packet can be largerthen maxpacketsize, it is possible for the result of a single packetto be both having transferred some data as well as the transfer to have...
usb-redir: Allow packets to have both data and an error-status
ehci: Get rid of the magical PROC_ERR status
Instead make ehci_execute and ehci_fill_queue return the again value.
microblaze: translate.c: Fix swaph decoding
The swaph instruction was not decoding correctly. s/1e1/1e2 on the9 LSBs on the instruction decode.
Reported-by: David Holsgrove <david.holsgrove@xilinx.com>Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
tcg/ppc32: Use trampolines to trim the code size for mmu slow path accessors
mmu access looks something like:
<check tlb>if miss goto slow_path<fast path>done:...
; end of the TBslow_path:
mr r3, r27 ; move areg0 to r3 ; (r3 holds the first argument for all the PPC32 ABIs)...
tools: initialize main loop before block layer
Tools were broken because they initialized the block layer whileqemu_aio_context was still NULL.
Reported-by: malc <av1474@comtv.ru>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: malc <av1474@comtv.ru>
spice: switch to pixman
Switch over spice-display.c to use the pixman libraryinstead of the home-grown pflib bits.
pflib: unused, remove it.
Replaced by pixman library.
spice: fix initialization order
Register displaychangelistener last, after spice is fully initialized,otherwise we may hit NULL pointer dereferences when qemu starts callingour callbacks.
Commit e250d949feb1334828f27f0d145c35f29c4b7639 triggers this bug....
hw/qxl: qxl_send_events: nop if stopped
Added a trace point for easy logging.
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=870972
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qxl: fix cursor reset
When resetting the qxl cursor notify the qemu displaystate too.
qxl: call dpy_gfx_resize when entering vga mode
When entering vga mode the display size likely changes,notify all displaychangelisteners about this.
Probably went unnoticed for a while as one if the firstthings the guest does after leaving qxl native mode and...
hw/qxl: guest bug on primary create with stride %4 != 0
Due to usage of pixman for rendering on all spice surfaces we havepixman's requirement that the stride be word aligned. A guest nothonoring that can crash spice and qemu with it due to failure to create...
target-mips: use ULL for 64 bit constants
Fix build on a 32 bit host: CC mips-softmmu/target-mips/dsp_helper.o/src/qemu/target-mips/dsp_helper.c: In function 'helper_dextr_rs_w':/src/qemu/target-mips/dsp_helper.c:3556: error: integer constant is too large for 'long' type...
build: pthread_atfork() needs include of pthread.h
Cc: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
tcg/ppc: ld/st optimization
Signed-off-by: malc <av1474@comtv.ru>
vmware_vga: Allow simple drivers to work without using the fifo
Postpone stopping the dirty log to the point where the command fifo isconfigured to allow drivers which don't use the fifo to work too.(Without this the picture rendered into the vram never got to the...
vmware_vga: Return a value for FB_SIZE before the device is enabled
According to the documentation drivers using this device should readFB_SIZE before enabling the device to know what memory to map. Thiswould not work if we return 0 before enabled. The docs also mention...
vmware_vga: Remove duplicated info from local state
Removed info from vmsvga_state that is available from elsewhere andthus was duplicated here unnecessarily.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
vmware_vga: Coding style cleanup
Fix coding style as suggested by checkpatch.pl
Merge branch 'trivial-patches' of git://github.com/stefanha/qemu
tcg: Optimize qemu_ld/st by generating slow paths at the end of a block
Add optimized TCG qemu_ld/st generation which locates the code of TLB misscases at the end of a block after generating the other IRs.Currently, this optimization supports only i386 and x86_64 hosts....
tcg: Add extended GETPC mechanism for MMU helpers with ldst optimization
Add GETPC_EXT which is used by MMU helpers to selectively calculate the codeaddress of accessing guest memory when called from a qemu_ld/st optimized codeor a C function. Currently, it supports only i386 and x86-64 hosts....
configure: Add CONFIG_QEMU_LDST_OPTIMIZATION for TCG qemu_ld/st optimization
Enable CONFIG_QEMU_LDST_OPTIMIZATION for TCG qemu_ld/st optimization only whena host is i386 or x86_64.
Signed-off-by: Yeongkyoon Lee <yeongkyoon.lee@samsung.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-m68k/m68k-semi.c: Log when put_user for returning values fails
Abstract out the use of put_user for returning semihosting call results,so that we can log when a guest erroneously attempts a semihosting callwith an unwritable argument block.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
target-m68k/m68k-semi: Handle get_user failure
Handle failure of get_user accessing the semihostingargument block, rather than simply ignoring the failures.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
m68k: Return semihosting errno values correctly
Fixing a simple typo, s/errno/err/, that causedthe error status from GDB semihosted system callsto be returned incorrectly.
Signed-off-by: Meador Inge <meadori@codesourcery.com>Reviewed-by: Andreas Färber <afaerber@suse.de>...
vl: delay thread initialization after daemonization
Commit ac4119c (chardev: Use timer instead of bottom-half to postponeopen event, 2012-10-12) moved the alarm timer initialization to an earlierpoint but failed to consider that it depends on qemu_init_main_loop....
compiler: support Darwin weak references
Weakrefs only tell you if the symbol was defined elsewhere, so youneed a further check at runtime to pick the default definitionwhen needed.
This could be automated by the compiler, but it does not do it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
semaphore: implement fallback counting semaphores with mutex+condvar
OpenBSD and Darwin do not have sem_timedwait. Implement a fallbackfor them.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-timer: reinitialize timers after fork
Timers are not inherited by the child of a fork(2), so just usepthread_atfork to reinstate them after daemonize.
vl: unify calls to init_timer_alarm
init_timer_alarm was being called twice. This is not needed.
Merge remote-tracking branch 'bonzini/migr-coroutine' into staging
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>