scsi: force unit access on VERIFY
Also DMA data from the host, to avoid that the host reports anunderrun.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scsi: make code more homogeneous in AIO callback functions
First scsi_flush_complete, like scsi_dma_complete, is always called withan active AIOCB.
Second, always test for "ret < 0" to check for errors.
scsi: move scsi_flush_complete around
scsi: add support for FUA on writes
To force unit access, add a flush operation after the actual write.WRITE AND VERIFY commands always flush according to SBC, so do iteven though we do not perform the reread.
scsi: add missing test for cancelled request
scsi: fix memory leak
scsibus_get_dev_path is leaking id if it is not NULL. Fix it.
Reported-by: Laszlo Ersek <lersek@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virtio-scsi: prepare migration format for multiqueue
In order to restore requests correctly from a multitude of virtqueues,we need to store the id of the request queue that each request camefrom.
Do this even for single-queue, by storing a hard-coded zero, to...
virtio: add virtio_queue_get_id
Serializing virtio-scsi requests needs a simple way to get from aVirtQueue to the number of the queue. The virtio_queue_get_idprovides this.
virtio-scsi: add multiqueue capability
Adding multiqueue is as simple as creating more than one virtqueues,and saving the queue number for each request.
Merge branch 'w64' of git://qemu.weilnetz.de/qemu
target-alpha: QOM'ify CPU init
Move code from cpu_alpha_init() into a CPU initializer.
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Richard Henderson <rth@twiddle.net>
target-alpha: QOM'ify CPU
Embed CPUAlphaState as first member of AlphaCPU.
disas: Replace 'unsigned long' by 'uintptr_t'
This is needed for w64. It changes nothing for other hosts.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
nbd: Fix compiler warning (w64)
Portable printing of dev_offset (data type off_t) needs a type cast.
w64: Fix time conversion for some versions of MinGW-w64
tb.time is a time value, but not necessarily of the same size as time_t:while time_t is 64 bit for w64, tb.time still is 32 bit only.
Therefore we need en explicit conversion.
softmmu: Use uintptr_t for physaddr and rename it
Variable physaddr is a host address which should be represented bydata type 'uintptr_t'.
This is needed for w64 and changes nothing for other hosts.
v2:Rename physaddr -> hostaddr (suggested by Blue Swirl)....
w64: Use uintptr_t in exec.c
Replace all type casts to 'long' or 'unsigned long' by 'intptr_t' or 'uintptr_t'.
For type casts which are only used to extract the lower bits of an addressor to modify those bits, signedness does not matter. There I always use 'uintptr_t'....
w64: Fix data types in softmmu*.h
w64 requires uintptr_t.
w64: Fix type cast in os_host_main_loop_wait
Casting a pointer to an integer must use (DWORD_PTR) instead of (DWORD).This also matches the definition of 'fd' (gint for w32, gint64 for w64).
target-mips: Fix type cast for w64 (uintptr_t)
This changes nothing for other hosts.
cpu-exec: Remove non-portable type cast and fix format string
This change is needed for w64, but also changes the code for other hosts.
w64: Fix type casts used in some macros in cpu-all.h
Instead of type casts to long, w64 needs type casts to intptr_t.For other hosts, this changes nothing.
w64: Fix data types in cpu-all.h, exec.c
w64 needs uintptr_t instead of unsigned long.For other hosts, nothing changes.
w64: Use larger alignment for section with generated code
The MinGW-w64 compiler allows attribute((aligned (32)).
w32: Move defines for socket specific errors to qemu-os-win32.h
As those defines are only used for w32,they should be in the header file for w32.
All files which include slirp.h or qemu_socket.h alsoinclude qemu-os-win32.h.
w64: Fix definition of setjmp
The default definition of setjmp which is implemented in MinGW-w64cannot be used with programs like QEMU which call longjmp fromcode without structured exception handling (SEH).
This code therefore disables stack unwinding....
w64: Fix struct CPUTLBEntry
For w64, some entries need 'uintptr_t' instead of 'unsigned long'.
For other host systems, both data types are identical, so nothing changes.
tcg/i386: Use GDB JIT debugging interface only for hosts with ELF
Not all i386 / x86_64 hosts use ELF.Ask the compiler whether ELF is used.
On w64, gdb crashes when ELF_HOST_MACHINE is defined.
Cc: Blue Swirl <blauwirbel@gmail.com>Acked-by: Richard Henderson <rth@twiddle.net>...
tcg/i386: Add support for w64 ABI
w64 uses the registers rcx, rdx, r8 and r9 for function arguments,so it needs a different declaration of tcg_target_call_iarg_regs.
rax, rcx, rdx, r8, r9, r10 and r11 may be changed by function calls.
rbx, rbp, rdi, rsi, r12, r13, r14 and r15 remain unchanged by function calls....
Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf
pseries: Fix reset of VIO network device
Currently, the PAPR VIO network device does not have a reset handler. Thismeans that after a hard reset, H_REGISTER_LOGICAL_LAN will return an errorwhen the new guest boot attempts to initialize the device.
This patch corrects this, adding a suitable reset hook....
pseries: Remove old debug leftovers from spapr_vscsi
The PAPR VSCSI emulation contains a few lines of code which were once usedfor debug but now do nothing at all. This patch removes them.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>Signed-off-by: Andreas Färber <afaerber@suse.de>
pseries: Remove old hcalls hook stub
Some time ago we removed all use of the 'hcalls' callback in the pseriesVIO code, which was used to workaround an ordering problem which has sincebeen solved properly. However, the function pointer for the hook remains....
pseries: Correctly use the device model reset hooks
Recently we added code to properly clean away VIO CRQs on reset However,this directly uses qemu_register, rather than the existing device modelreset callbacks. This patch cleans this up by adding proper use of the...
pseries: Reset vscsi properly
Currently the PAPR vscsi implementation does not properly clear its tableof request tags when the system is reset. This patch adds a reset hookto do so.
pseries: Fix RTAS based config access
On the pseries platform, access to PCI config space is via RTAS calls(which go to the hypervisor) rather than MMIO. This means we don't usethe same code path as nearly everyone else which goes through pci_host.cand we're missing some of the parameter checking along the way....
target-xtensa: add license to core-fsf.c
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-xtensa: add license to core-dc232b.c
target-xtensa: add dc233c core
This is Diamond 233L Standard Core Rev.C (LE), implemented throughlinux/gdb overlay.
linux-user: Fix exit syscall with QOM CPU
For QOM'ified CPUs we cannot g_free() CPUArchState, we mustobject_delete() the object it is embedded into.
Fixes LP#982321 (invalid free() while executing pacman with qemu-arm).
Reported-by: Serge Schneider <serge@xecdesign.com>...
target-ppc/machine.c: Drop unnecessary ifdefs
machine.c is only compiled for softmmu targets, so checks for!defined(CONFIG_USER_ONLY) are unnecessary and can be dropped.
Signed-off-by: Juan Quintela <quintela@redhat.com>[AF: Use more verbose commit message suggested by PMM]...
target-ppc: Init dcache and icache size for e500 user mode
commit f7aa558396dd0f6b7a2b22c05cb503c655854102 pulled the dcache and icacheline size initialization inside of a '#if !defined(CONFIG_USER_ONLY)' block.This is not correct because instructions like 'dcbz' need the dcache size...
target-ppc: Fix type casts for w64 (uintptr_t)
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Andreas Färber <afaerber@suse.de>
target-ppc: QOM'ify CPU reset
Move code from cpu_state_reset() into ppc_cpu_reset().Reorder #include of helper_regs.h to use it in translate_init.c.
Adjust whitespace and add braces.
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: David Gibson <david@gibson.dropbear.id.au>
target-ppc: Start QOM'ifying CPU init
Move code not dependent on ppc_def_t from cpu_ppc_init() into an initfn.
target-ppc: QOM'ify CPU
Embed CPUPPCState as first member of PowerPCCPU.Distinguish between "powerpc-cpu", "powerpc64-cpu" and"embedded-powerpc-cpu".
Let CPUClass::reset() call cpu_state_reset() for now.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
target-ppc: Add hooks for handling tcg and kvm limitations
On target-ppc, our table of CPU types and features encodes the features asfound on the hardware, regardless of whether these features are actuallyusable under TCG or KVM. We already have cases where the information from...
PPC: Fix TLB invalidation bug within the PPC interrupt handler.
Commit 41557447d30eeb944e42069513df13585f5e6c7f also introduced a subtle TLBflush bug. By applying a mask to the interrupt MSR which cleared the IR/DRbits at the start of the interrupt handler, the logic towards the end of the...
pseries: Clean up hcall_dprintf() debugging messages
The pseries machine code has a number of debug messages for debugging PAPRhypercalls, dependent on DEBUG_SPAPR_HCALLS. This patch cleans thesemessages up a bit, by adding func to the hcall_dprintf() macro and...
pseries: Fix bug with reset of VIO CRQs
PAPR specifies a Command Response Queue (CRQ) mechanism used for virtualIO, which we implement. However, we don't correctly clean up registeredCRQs when we reset the system.
This patch adds a reset handler to fix this bug. While we're at it, add...
pseries: Implement RTAS system-reboot call
This patch adds the PAPR defined RTAS system-reboot call to the pseriesmachine emulation, providing the guest with a way to trigger a reboot.
pseries: Remove unused fields from VIOsPAPRBus structure
The VIOsPAPRBus structure, used on the pseries machine contains some oldfields which are no longer used anywhere. This patch removes them.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
pseries: Consolidate hack for RTAS display-character usage
Currently the pseries machine contains not one but two somewhat ugly hacksto allow printing of early debug messages before the guest has properlyread the device tree.
First, we special case H_PUT_TERM_CHAR so that a vtermno of 0 (usually...
target-ppc: Drop cpu_ppc_close()
It is unused, so avoid QOM'ifying it unneededly.
pcspk: initialize PC speaker if compiled in
PC speaker has been moved to target-independant code in 71093711589dafcb920dc3bc9bb811eaf8b14101,so do not depend of target to include it or not.
Cc: malc <av1474@comtv.ru>Cc: Blue Swirl <blauwirbel@gmail.com>...
tests: remove .SECONDARY special target
The special target should not be needed anymore, and caused (perhapsdue to a Make bug) a failure with "make -j2". In any case, themain makefile is a better place for such special targets ratherthan an included makefile....
target-xtensa: add tests for LBEG/LEND invalidation
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-xtensa: add test for IBREAK invalidation
target-xtensa: fix tb invalidation for IBREAK and LOOP
Instruction breakpoint/zero overhead loop handling code is built intoTBs pointed to by IBREAKA/LEND SRs. When these or related SRs getchanged TBs at virtual addresses corresponding to their old and their...
exec: provide tb_invalidate_phys_addr function
Allow TB invalidation by its physical address, extract implementationfrom the breakpoint_invalidate function.
Use uintptr_t for various op related functions
Use uintptr_t instead of void * or unsigned long inseveral op related functions, env->mem_io_pc andGETPC macro.
Reviewed-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
coroutine-gthread.c: Avoid threading APIs deprecated in GLib 2.31
The GLib threading APIs were revamped in GLib 2.31 and a numberof the old interfaces were deprecated, which means they provokecompilation warnings (errors if -Werror) now. Add support for the...
Merge branch 'xtensa' of git://jcmvbkbc.spb.ru/dumb/qemu-xtensa
Merge branch 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
target-xtensa: Move helpers.h to helper.h
Provides a file naming scheme consistent with other targets.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: improve unit tests debugging
- add testcase announcement;- add global symbols for individual tests;- add host-debug-* makefile target.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: QOM'ify CPU
Embed CPUXtensaState as first member of XtensaCPU.Let CPUClass::reset() call cpu_state_reset() for now.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
target-xtensa: QOM'ify CPU reset
Move code from cpu_state_reset() into QOM xtensa_cpu_reset().To avoid moving reset_mmu() and dependencies, make it non-static.
target-xtensa: Start QOM'ifying CPU init
Move XtensaConfig-independent code from cpu_xtensa_init() into aQOM initfn, as a start.
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
Merge remote-tracking branch 'afaerber/qom-cpu-lm32.v3' into staging
hw/arm11mpcore: Convert to using sysbus GIC device
Convert arm11mpcore to using the standalone sysbus GIC device.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm_gic: Make gic_reset a sysbus reset function
Make gic_reset a sysbus reset function, so we actuallyreset the GIC on system reset rather than only at init.For the NVIC this requires us also to implement resetof the SysTick.
hw/arm_gic: Use NVIC instead of LEGACY_INCLUDED_GIC define
Now all the A profile cores have been switched to use the standalonesysbus GIC, the only remaining code which #includes arm_gic.c isthe v7M NVIC. The coupling is much closer here so it's not so...
hw/arm_gic: gic_set_pending_private() is NVIC only
The function gic_set_pending_private() is now used by the NVIConly (for the GIC we now set PPI interrupts via gpio lines andgic_set_irq()). So make it #ifdef NVIC and remove the 'attributeunused' annotation....
hw/arm_gic: Remove stray hardcoded tab
Remove the single instance of a hardcoded tab from hw/arm_gic.c.
hw/a15mpcore: switch to using sysbus GIC
Switch the a15mpcore private peripheral region to usingthe standalone sysbus GIC device.
hw/a9mpcore: Switch to using sysbus GIC
Switch the a9mpcore to using the sysbus GIC device ratherthan having the a9mp private memory region device subclassthe GIC.
hw/realview_gic: switch to sysbus GIC
Switch the realview_gic device to the standalone sysbus GIC.
hw/exynos4210_gic: Convert to using sysbus GIC
Convert the Exynos GIC code to use the standalone sysbusGIC device.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Evgeny Voevodin <e.voevodin@samsung.com>
hw/arm_gic: Move NCPU definition to arm_gic.c
Move the NCPU definition to arm_gic.c: the maximum numberof CPU interfaces is defined by the GIC architecture specificationto be 8, so we don't need to have this #define in each of thesources files which currently includes arm_gic.c....
hw/arm_gic: Move gic_get_current_cpu into arm_gic.c
Move the gic_get_current_cpu() function into arm_gic.c.There are only two implementations: (1) "get the indexof the currently executing CPU", used by all multicoreGICs, and (2) "always 0", used by all GICs instantiated...
hw/arm_gic: Expose PPI inputs as gpio inputs
Expose the Private Peripheral Interrupt inputs as GPIO inputs.The layout of the GPIO array is thus: [0..N-1] SPIs [N..N+31] PPIs for CPU 0 [N+32..N+63] PPIs for CPU 1 ...
Treating PPIs as being another kind of input line is in line with the...
hw/arm_gic: Make the GIC its own sysbus device
Compile arm_gic.c as a standalone C file to produce a self containedsysbus GIC device. Support the legacy usage by #include of the .c fileby making those users #define LEGACY_INCLUDED_GIC, so we can convert...
Fix bit test in Exynos4210 UART emulation to use & instead of &&
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
ARM: Exynos4210: Drop gic_cpu_write() after initialization.
Remove gic_cpu_write() call after initialization that was emulatingfunctionality of earliest SOC bootloader which enables externalGIC CPU1 interface. Instead introduce Exynos4210-specific secondary...
hw/exynos4210_combiner.c: Drop excessive read/write access check.
Access to reserved area at offset higher than 0x3c is allowed inExternal Combiner. Samsung Galaxy Kernel implements this. So, dropexcessive checks in read/write functions.
Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>...
configure: Insist on a Python 2, not Python 3
Our Python scripts require Python 2 and will fail on Python 3, eg: File "/home/petmay01/linaro/qemu-from-laptop/qemu/scripts/qapi-commands.py", line 378 except getopt.GetoptError, err: ^...
bsd-user: fix compile failure
bsd-user doesn't actually support reserving a memory area for theguest address space, but we need to at least define the reserved_vaglobal so that cpu-all.h's RESERVED_VA macro will work correctly.
This fixes a compilation error introduced in commit 39879bb...
kvm: set gsi_bits and max_gsi correctly
The current kvm_init_irq_routing() doesn't set up the used_gsi_bitmapcorrectly, and as a consequence pins max_gsi to 32 when it reallyshould be 1024. I ran into this limitation while testing pcipassthrough, where I consistently got an -ENOSPC return from...
kvm: update linux headers
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
kvmclock: guest stop notification
Often when a guest is stopped from the qemu console, it will report spurioussoft lockup warnings on resume. There are kernel patches being discussed thatwill give the host the ability to tell the guest that it is being stopped and...
kvm: add flightrecorder script
The kvm kernel module includes a number of trace events which can beuseful when debugging system behavior. Even on production systems thesetrace events can be used to observe guest behavior and identify thesource of problems....
kvm: Drop redundant kvm_enabled from cpu_thread_is_idle
This is now implied by kvm_irqchip_in_kernel.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Avi Kivity <avi@redhat.com>
kvm: allow arbitrarily sized mmio ioeventfd
We use a 2 byte ioeventfd for virtio memory,add support for this.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Reviewed-by: Amos Kong <akong@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
kvm: Drop unused kvm_pit_in_kernel
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
ps2: avoid repeated header file includes
Signed-off-by: Wanpeng Li <liwp@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
make: Always set LC_ALL=C for makeinfo
Otherwise the generated file qemu-doc.html will contain "Anhang" instead of "Appendix" with a German locale (de_DE.UTF-8).
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
configure: Fix wrong preprocessor statement
#abort is not a preprocessor statement. It aborts, but the preprocessorstatement #error is more common to abort a compilation.