summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-01-11Merge remote-tracking branch ↵HEADmasterPeter Maydell1-2/+2
'remotes/kraxel/tags/misc-20190111-pull-request' into staging misc: fix seabios cross build. # gpg: Signature made Fri 11 Jan 2019 11:46:47 GMT # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/misc-20190111-pull-request: roms: seabios: Rename CROSS_COMPILE to CROSS_PREFIX Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-01-11Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell207-897/+1498
* HAX support for Linux hosts (Alejandro) * esp bugfixes (Guenter) * Windows build cleanup (Marc-André) * checkpatch logic improvements (Paolo) * coalesced range bugfix (Paolo) * switch testsuite to TAP (Paolo) * QTAILQ rewrite (Paolo) * block/iscsi.c cancellation fixes (Stefan) * improve selection of the default accelerator (Thomas) # gpg: Signature made Fri 11 Jan 2019 14:47:40 GMT # gpg: using RSA key BFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: (34 commits) avoid TABs in files that only contain a few remove space-tab sequences scripts: add script to convert multiline comments into 4-line format hw/watchdog/wdt_i6300esb: remove a unnecessary comment checkpatch: warn about qemu/queue.h head structs that are not typedef-ed qemu/queue.h: simplify reverse access to QTAILQ qemu/queue.h: reimplement QTAILQ without pointer-to-pointers qemu/queue.h: remove Q_TAILQ_{HEAD,ENTRY} qemu/queue.h: typedef QTAILQ heads qemu/queue.h: leave head structs anonymous unless necessary vfio: make vfio_address_spaces static qemu/queue.h: do not access tqe_prev directly test: replace gtester with a TAP driver test: execute g_test_run when tests are skipped qga: drop < Vista compatibility build-sys: build with Vista API by default build-sys: move windows defines in osdep.h header build-sys: don't include windows.h, osdep.h does it scsi: esp: Defer command completion until previous interrupts have been handled esp-pci: Fix status register write erase control ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-01-11avoid TABs in files that only contain a fewPaolo Bonzini92-386/+386
Most files that have TABs only contain a handful of them. Change them to spaces so that we don't confuse people. disas, standard-headers, linux-headers and libdecnumber are imported from other projects and probably should be exempted from the check. Outside those, after this patch the following files still contain both 8-space and TAB sequences at the beginning of the line. Many of them have a majority of TABs, or were initially committed with all tabs. bsd-user/i386/target_syscall.h bsd-user/x86_64/target_syscall.h crypto/aes.c hw/audio/fmopl.c hw/audio/fmopl.h hw/block/tc58128.c hw/display/cirrus_vga.c hw/display/xenfb.c hw/dma/etraxfs_dma.c hw/intc/sh_intc.c hw/misc/mst_fpga.c hw/net/pcnet.c hw/sh4/sh7750.c hw/timer/m48t59.c hw/timer/sh_timer.c include/crypto/aes.h include/disas/bfd.h include/hw/sh4/sh.h libdecnumber/decNumber.c linux-headers/asm-generic/unistd.h linux-headers/linux/kvm.h linux-user/alpha/target_syscall.h linux-user/arm/nwfpe/double_cpdo.c linux-user/arm/nwfpe/fpa11_cpdt.c linux-user/arm/nwfpe/fpa11_cprt.c linux-user/arm/nwfpe/fpa11.h linux-user/flat.h linux-user/flatload.c linux-user/i386/target_syscall.h linux-user/ppc/target_syscall.h linux-user/sparc/target_syscall.h linux-user/syscall.c linux-user/syscall_defs.h linux-user/x86_64/target_syscall.h slirp/cksum.c slirp/if.c slirp/ip.h slirp/ip_icmp.c slirp/ip_icmp.h slirp/ip_input.c slirp/ip_output.c slirp/mbuf.c slirp/misc.c slirp/sbuf.c slirp/socket.c slirp/socket.h slirp/tcp_input.c slirp/tcpip.h slirp/tcp_output.c slirp/tcp_subr.c slirp/tcp_timer.c slirp/tftp.c slirp/udp.c slirp/udp.h target/cris/cpu.h target/cris/mmu.c target/cris/op_helper.c target/sh4/helper.c target/sh4/op_helper.c target/sh4/translate.c tcg/sparc/tcg-target.inc.c tests/tcg/cris/check_addo.c tests/tcg/cris/check_moveq.c tests/tcg/cris/check_swap.c tests/tcg/multiarch/test-mmap.c ui/vnc-enc-hextile-template.h ui/vnc-enc-zywrle.h util/envlist.c util/readline.c The following have only TABs: bsd-user/i386/target_signal.h bsd-user/sparc64/target_signal.h bsd-user/sparc64/target_syscall.h bsd-user/sparc/target_signal.h bsd-user/sparc/target_syscall.h bsd-user/x86_64/target_signal.h crypto/desrfb.c hw/audio/intel-hda-defs.h hw/core/uboot_image.h hw/sh4/sh7750_regnames.c hw/sh4/sh7750_regs.h include/hw/cris/etraxfs_dma.h linux-user/alpha/termbits.h linux-user/arm/nwfpe/fpopcode.h linux-user/arm/nwfpe/fpsr.h linux-user/arm/syscall_nr.h linux-user/arm/target_signal.h linux-user/cris/target_signal.h linux-user/i386/target_signal.h linux-user/linux_loop.h linux-user/m68k/target_signal.h linux-user/microblaze/target_signal.h linux-user/mips64/target_signal.h linux-user/mips/target_signal.h linux-user/mips/target_syscall.h linux-user/mips/termbits.h linux-user/ppc/target_signal.h linux-user/sh4/target_signal.h linux-user/sh4/termbits.h linux-user/sparc64/target_syscall.h linux-user/sparc/target_signal.h linux-user/x86_64/target_signal.h linux-user/x86_64/termbits.h pc-bios/optionrom/optionrom.h slirp/mbuf.h slirp/misc.h slirp/sbuf.h slirp/tcp.h slirp/tcp_timer.h slirp/tcp_var.h target/i386/svm.h target/sparc/asi.h target/xtensa/core-dc232b/xtensa-modules.inc.c target/xtensa/core-dc233c/xtensa-modules.inc.c target/xtensa/core-de212/core-isa.h target/xtensa/core-de212/xtensa-modules.inc.c target/xtensa/core-fsf/xtensa-modules.inc.c target/xtensa/core-sample_controller/core-isa.h target/xtensa/core-sample_controller/xtensa-modules.inc.c target/xtensa/core-test_kc705_be/core-isa.h target/xtensa/core-test_kc705_be/xtensa-modules.inc.c tests/tcg/cris/check_abs.c tests/tcg/cris/check_addc.c tests/tcg/cris/check_addcm.c tests/tcg/cris/check_addoq.c tests/tcg/cris/check_bound.c tests/tcg/cris/check_ftag.c tests/tcg/cris/check_int64.c tests/tcg/cris/check_lz.c tests/tcg/cris/check_openpf5.c tests/tcg/cris/check_sigalrm.c tests/tcg/cris/crisutils.h tests/tcg/cris/sys.c tests/tcg/i386/test-i386-ssse3.c ui/vgafont.h Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20181213223737.11793-3-pbonzini@redhat.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Acked-by: Richard Henderson <richard.henderson@linaro.org> Acked-by: Eric Blake <eblake@redhat.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11remove space-tab sequencesPaolo Bonzini18-48/+48
There are not many, and they are all simple mistakes that ended up being committed. Remove them. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20181213223737.11793-2-pbonzini@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Acked-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11scripts: add script to convert multiline comments into 4-line formatPaolo Bonzini1-0/+62
Since we're adding checkpatch rules to enforce 4-line multiline comment format, i.e. with lone /* and */, this script can be run on existing code so that the comment style does not become inconsistent within a file. The alternative to awk-in-a-shell-script could be Perl, which also supports -i directly, but a2p seems to have bitrotten and I didn't quite feel like writing this twice... Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11hw/watchdog/wdt_i6300esb: remove a unnecessary commentPeng Hao1-1/+0
The registered memory region of i6300esb is not suitable for coalesced mmio, because a write for the region may trigger an immediate action and can't be delayed. Signed-off-by: Peng Hao <peng.hao2@zte.com.cn> Message-Id: <1544253511-82742-1-git-send-email-peng.hao2@zte.com.cn> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11checkpatch: warn about qemu/queue.h head structs that are not typedef-edPaolo Bonzini1-0/+5
These are just like any other struct or union, so they should have CamelCase typedefs. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11qemu/queue.h: simplify reverse access to QTAILQPaolo Bonzini27-54/+49
The new definition of QTAILQ does not require passing the headname, remove it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11qemu/queue.h: reimplement QTAILQ without pointer-to-pointersPaolo Bonzini3-106/+92
QTAILQ is a doubly linked list, with a pointer-to-pointer to the last element from the head, and the previous element from each node. But if you squint enough, QTAILQ becomes a combination of a singly-linked forwards list, and another singly-linked list which goes backwards and is circular. This is the idea that lets QTAILQ implement reverse iteration: only, because the backwards list points inside the node, accessing the previous element needs to go two steps back and one forwards. What this patch does is implement it in these terms, without actually changing the in-memory layout at all. The coexistence of the two lists is realized by making QTAILQ_HEAD and QTAILQ_ENTRY unions of the forwards pointer and a generic QTailQLink node. Thq QTailQLink can walk the list in both directions; the union is needed so that the forwards pointer can have the correct type, as a sort of poor man's template. While there are other ways to get the same layout without a union, this one has the advantage of simpler operation in the debugger, because the fields tqh_first and tqe_next still exist as before the patch. Those fields are also used by scripts/qemugdb/mtree.py, so it's a good idea to preserve them. The advantage of the new representation is that the two-back-one-forward dance done by backwards accesses can be done all while operating on QTailQLinks. No casting to the head struct is needed anymore because, even though the QTailQLink's forward pointer is a void *, we can use typeof to recover the correct type. This patch only changes the implementation, not the interface. The next patch will remove the head struct name from the backwards visit macros. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11qemu/queue.h: remove Q_TAILQ_{HEAD,ENTRY}Paolo Bonzini2-18/+6
These are not present for other kinds of queue, and unused. Zap them before more changes are made to the QTAILQ implementation. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11qemu/queue.h: typedef QTAILQ headsPaolo Bonzini5-11/+16
This will be needed when we change the QTAILQ head and elem structs to unions. However, it is also consistent with the usage elsewhere in QEMU for other list head structs (see for example FsMountList). Note that most QTAILQs only need their name in order to do backwards walks. Those do not break with the struct->union change, and anyway the change will also remove the need to name heads when doing backwards walks, so those are not touched here. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11qemu/queue.h: leave head structs anonymous unless necessaryPaolo Bonzini41-65/+59
Most list head structs need not be given a name. In most cases the name is given just in case one is going to use QTAILQ_LAST, QTAILQ_PREV or reverse iteration, but this does not apply to lists of other kinds, and even for QTAILQ in practice this is only rarely needed. In addition, we will soon reimplement those macros completely so that they do not need a name for the head struct. So clean up everything, not giving a name except in the rare case where it is necessary. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11vfio: make vfio_address_spaces staticPaolo Bonzini2-2/+1
It is not used outside hw/vfio/common.c, so it does not need to be extern. Acked-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11qemu/queue.h: do not access tqe_prev directlyPaolo Bonzini1-1/+1
Use the QTAILQ_IN_USE macro instead, it does the same thing but the next patch will change it to a different definition. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11test: replace gtester with a TAP driverPaolo Bonzini7-52/+543
gtester is deprecated by upstream glib (see for example the announcement at https://blog.gtk.org/2018/07/11/news-from-glib-2-58/) and it does not support tests that call g_test_skip in some glib stable releases. glib suggests instead using Automake's TAP support, which gtest itself supports since version 2.38 (QEMU's minimum requirement is 2.40). We do not support Automake, but we can use Automake's code to beautify the TAP output. I chose to use the Perl copy rather than the shell/awk one, with some changes so that it can accept TAP through stdin, in order to reuse Perl's TAP parsing package. This also avoids duplicating the parser between tap-driver.pl and tap-merge.pl. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1543513531-1151-3-git-send-email-pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11Merge remote-tracking branch ↵Peter Maydell13-1200/+368
'remotes/ehabkost/tags/machine-next-pull-request' into staging Machine queue, 2019-01-10 * Simplify GlobalProperty array declarations (Eduardo Habkost) * Deprecate cpu-add commands (Kashyap Chamarthy) * range/memory-device cleanups (David Hildenbrand) * Fix -device scsi-hd,help regression (Marc-André Lureau) * Fix crash when -global generates multiple warnings (Eduardo Habkost) # gpg: Signature made Thu 10 Jan 2019 14:28:23 GMT # gpg: using RSA key 2807936F984DC5A6 # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: qom: Don't keep error value between object_property_parse() calls qdev: fix -device scsi-hd,help regression machine: Use shorter format for GlobalProperty arrays machine: Eliminate unnecessary stringify() usage spapr: Eliminate SPAPR_PCI_2_7_MMIO_WIN_SIZE macro memory-device: rewrite address assignment using ranges range: add some more functions Mention that QMP 'cpu-add' will be deprecated Update that HMP 'cpu-add' is deprecated in 4.0 qemu-deprecated.texi: Rename the HMP section Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-01-11test: execute g_test_run when tests are skippedPaolo Bonzini4-9/+9
Sometimes a test's main() function recognizes that the environment does not support the test, and therefore exits. In this case, we still should run g_test_run() so that a TAP harness will print the test plan ("1..0") and the test will be marked as skipped. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1543513531-1151-2-git-send-email-pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11qga: drop < Vista compatibilityMarc-André Lureau1-64/+0
Building QGA for XP seems possible so far: the dependency on libqemuutil.a implies building qemu-thread-win32.c, which requires Vista API since commit 12f8def0 (v2.9). But qemu-thread isn't being used in QGA, the resulting binary may still work on XP. XP is no longer supported for the past 4.5y, it's time to drop support for it. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20181122110039.15972-5-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11build-sys: build with Vista API by defaultMarc-André Lureau3-11/+3
Both qemu & qga build with Vista API by default already, by defining _WIN32_WINNT 0x0600. Set it globally in osdep.h instead. This replaces WINVER by _WIN32_WINNT in osdep.h. WINVER doesn't seem to be really useful these days. (see also https://blogs.msdn.microsoft.com/oldnewthing/20070411-00/?p=27283) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20181122110039.15972-4-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11build-sys: move windows defines in osdep.h headerMarc-André Lureau2-3/+17
This removes some clutter in compilation logging, and allows some easier tweaking per compilation unit/CFLAGS overriding. Note that we can't move those define in os-win32.h, since they must be set before the first system headers are included. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20181122110039.15972-3-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11build-sys: don't include windows.h, osdep.h does itMarc-André Lureau1-4/+0
osdep.h will also define the available Windows API version for QEMU. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20181122110039.15972-2-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11scsi: esp: Defer command completion until previous interrupts have been handledGuenter Roeck4-9/+31
The guest OS reads RSTAT, RSEQ, and RINTR, and expects those registers to reflect a consistent state. However, it is possible that the registers can change after RSTAT was read, but before RINTR is read, when esp_command_complete() is called. Guest OS qemu -------- ---- [handle interrupt] Read RSTAT esp_command_complete() RSTAT = STAT_ST esp_dma_done() RSTAT |= STAT_TC RSEQ = 0 RINTR = INTR_BS Read RSEQ Read RINTR RINTR = 0 RSTAT &= ~STAT_TC RSEQ = SEQ_CD The guest OS would then try to handle INTR_BS combined with an old value of RSTAT. This sometimes resulted in lost events, spurious interrupts, guest OS confusion, and stalled SCSI operations. A typical guest error log (observed with various versions of Linux) looks as follows. scsi host1: Spurious irq, sreg=13. ... scsi host1: Aborting command [84531f10:2a] scsi host1: Current command [f882eea8:35] scsi host1: Queued command [84531f10:2a] scsi host1: Active command [f882eea8:35] scsi host1: Dumping command log scsi host1: ent[15] CMD val[44] sreg[90] seqreg[00] sreg2[00] ireg[20] ss[00] event[0c] scsi host1: ent[16] CMD val[01] sreg[90] seqreg[00] sreg2[00] ireg[20] ss[02] event[0c] scsi host1: ent[17] CMD val[43] sreg[90] seqreg[00] sreg2[00] ireg[20] ss[02] event[0c] scsi host1: ent[18] EVENT val[0d] sreg[92] seqreg[04] sreg2[00] ireg[18] ss[00] event[0c] ... Defer handling command completion until previous interrupts have been handled to fix the problem. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-01-11esp-pci: Fix status register write erase controlGuenter Roeck1-3/+3
Per AM53C974 datasheet, definition of "SCSI Bus and Control (SBAC)" register: Bit 24 'STATUS' Write Erase Control This bit controls the Write Erase feature on bits 3:1 and bit 6 of the DMA Status Register ((B)+54h). When this bit is programmed to '1', the state of bits 3:1 are preserved when read. Bits 3:1 are only cleared when a '1' is written to the corresponding bit location. For example, to clear bit 1, the value of '0000_0010b' should be written to the register. When the DMA Status Preserve bit is '0', bits 3:1 are cleared when read. The status register is currently defined to bit 12, not bit 24. Also, its implementation is reversed: The status is auto-cleared if the bit is set to 1, and must be cleared explicitly when the bit is set to 0. This results in spurious interrupts reported by the Linux kernel, and in some cases even results in stalled SCSI operations. Set SBAC_STATUS to bit 24 and reverse the logic to fix the problem. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Message-Id: <1543442171-24863-1-git-send-email-linux@roeck-us.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11block/iscsi: cancel libiscsi task when ABORT TASK TMF completesStefan Hajnoczi1-2/+14
The libiscsi iscsi_task_mgmt_async() API documentation says: abort_task will also cancel the scsi task. The callback for the scsi task will be invoked with SCSI_STATUS_CANCELLED The libiscsi implementation does not fulfil this promise. The task's callback is not invoked and its struct iscsi_pdu remains in the internal list (effectively leaked). This patch invokes the libiscsi iscsi_scsi_cancel_task() API to force the task's callback to be invoked with SCSI_STATUS_CANCELLED when the ABORT TASK TMF completes and the task's callback hasn't been invoked yet. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20180215111526.2464-1-stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11block/iscsi: fix ioctl cancel use-after-freeStefan Hajnoczi1-3/+18
iscsi_aio_cancel() does not increment the request's reference count, causing a use-after-free when ABORT TASK finishes after the request has already completed. There are some additional issues with iscsi_aio_cancel(): 1. Several ABORT TASKs may be sent for the same task if iscsi_aio_cancel() is invoked multiple times. It's better to avoid this just in case the command identifier is reused. 2. The iscsilun->mutex protection is missing in iscsi_aio_cancel(). Reported-by: Felipe Franciosi <felipe@nutanix.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20180203061621.7033-4-stefanha@redhat.com> Reviewed-by: Felipe Franciosi <felipe@nutanix.com> Tested-by: Sreejith Mohanan <sreejit.mohanan@nutanix.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11block/iscsi: take iscsilun->mutex in iscsi_timed_check_events()Stefan Hajnoczi1-0/+4
Commit d045c466d9e62b4321fadf586d024d54ddfd8bd4 ("iscsi: do not use aio_context_acquire/release") introduced iscsilun->mutex but appears to have overlooked iscsi_timed_check_events() when introducing the mutex. iscsi_service() and iscsi_set_events() must be called with iscsilun->mutex held. iscsi_timed_check_events() is invoked from the AioContext and does not take the mutex. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20180203061621.7033-3-stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11block/iscsi: drop unused IscsiAIOCB->buf fieldStefan Hajnoczi1-8/+0
The IscsiAIOCB->buf field has not been used since commit e49ab19fcaa617ad6cdfe1ac401327326b6a2552 ("block/iscsi: bump libiscsi requirement to 1.9.0"). It used to be a linear buffer for old libiscsi versions that didn't support scatter-gather. The minimum libiscsi version supports scatter-gather so we don't linearize buffers anymore. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20180203061621.7033-2-stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11hax: Support for Linux hostsAlexandro Sanchez Bach4-6/+6
Intel HAXM supports now 32-bit and 64-bit Linux hosts. This patch includes the corresponding userland changes. Since the Darwin userland backend is POSIX-compliant, the hax-darwin.{c,h} files have been renamed to hax-posix.{c,h}. This prefix is consistent with the naming used in the rest of QEMU. Signed-off-by: Alexandro Sanchez Bach <asanchez@kryptoslogic.com> Message-Id: <20181115013331.65820-1-asanchez@kryptoslogic.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11memory: update coalesced_range on transaction_commitPaolo Bonzini1-4/+16
The e1000 driver calls memory_region_add_coalescing but kvm_coalesce_mmio_region is never called for those regions. The bug dates back to the introduction of the memory region API; to fix it, delete and re-add coalesced MMIO ranges when building the FlatViews. Because coalesced MMIO regions apply to all address spaces, the has_coalesced_range flag has to be changed into an int. Fixes: 093bc2cd885e ("Hierarchical memory region API") Reported-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11memory: avoid unnecessary coalesced_io_del operationsPaolo Bonzini1-0/+11
Store whether the FlatRange has had any coalesced I/O ranges applied, and if not avoid calling coalesced_io_del. This is useful in preparation for the next patch, which will call coalesced_io_del when rendering memory regions. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11memory: extract flat_range_coalesced_io_{del,add}Paolo Bonzini1-24/+29
Extract two new functions from memory_region_update_coalesced_range_as. To avoid duplication in the creation of the MemoryRegionSection, use MEMORY_LISTENER_UPDATE_REGION instead of MEMORY_LISTENER_CALL to invoke the listener callback. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11pam: wrap MemoryRegion initialization in a transactionPaolo Bonzini1-0/+2
This avoids a few re-rendering of the memory AddressSpace. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11checkpatch: colorize output to terminalPaolo Bonzini1-7/+42
Add optional colors to make seeing message types a bit easier. The default is to show them on a tty. Inspired by Linux commits 57230297116fa ("checkpatch: colorize output to terminal") and 737c0767758b ("checkpatch: change format of --color argument to --color[=WHEN]"). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2019-01-11checkpatch: improve handling of multiple patches or filesPaolo Bonzini1-7/+23
Similar to how patchew output looks like for multiple patches, say what file or patch is being tested _before_ emitting errors. This is clearer to a human that scans the output from top to bottom. In addition, provide a truncated commit hash and subject instead of the full hash, and process the commits first-to-last rather than last-to-first. Inspired by Linux commit 0dea9f1eef86bedacad91b6f652ca1ab0d08854c ("checkpatch: reduce number of `git log` calls with --git", 2016-03-20). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11checkpatch: check Signed-off-by in --mailback modePaolo Bonzini1-3/+4
Pull the test before the anticipated exits from the process sub. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11checkpatch: fix premature exit when no input or --mailbackPaolo Bonzini1-3/+3
In some cases, checkpatch's process subroutine is exiting the whole process. This is wrong, just return from the subroutine instead. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11accel: Improve selection of the default acceleratorThomas Huth3-5/+17
When compiling with "--disable-tcg", we currently still use "tcg" as default accelerator. "kvm" should be used in this case instead. Also, some downstream distros provide QEMU binaries which have "kvm" in their names (e.g. "qemu-kvm" on RHEL or "kvm" on Ubuntu) that use KVM by default - and some users might want to do something similar with upstream binaries, too. Accomodate them by using "kvm:tcg" as default when we detect such a binary name. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1538748792-19444-1-git-send-email-thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-01-11roms: seabios: Rename CROSS_COMPILE to CROSS_PREFIXRoman Bolshakov1-2/+2
SeaBIOS introduced CROSS_PREFIX in 2013 but it's not set in roms Makefile. With the change it's possible to cross-compile SeaBIOS on macOS, if acpica/iasl is installed: cd roms export PATH=/path/to/cross/x86_64-unknown-linux-gnu/bin:$PATH make bios system=unknown-linux-gnu Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com> Message-id: 20181121203720.75916-1-r.bolshakov@yadro.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-01-10Merge remote-tracking branch ↵Peter Maydell1-0/+3
'remotes/kraxel/tags/audio-20190110-pull-request' into staging audio: two fixes. # gpg: Signature made Thu 10 Jan 2019 09:23:24 GMT # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/audio-20190110-pull-request: usb-audio: ignore usb packages with wrong size hw/audio/marvell: Don't include unnecessary i2c.h header file Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-01-10Merge remote-tracking branch ↵Peter Maydell1-4/+57
'remotes/vivier2/tags/linux-user-for-4.0-pull-request' into staging Minor linux-user update (2019-01-10) Fixes LTP tests pwrite03 and pwrite03_64 # gpg: Signature made Thu 10 Jan 2019 08:37:04 GMT # gpg: using RSA key F30C38BD3F2FBE3C # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" # gpg: aka "Laurent Vivier <laurent@vivier.eu>" # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier2/tags/linux-user-for-4.0-pull-request: linux-user: make pwrite64/pread64(fd, NULL, 0, offset) return 0 Add getsockopt for settable SOL_IPV6 options Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-01-10Merge remote-tracking branch 'remotes/kraxel/tags/ui-20190110-pull-request' ↵Peter Maydell15-256/+367
into staging ui: bugfixes, drop keymap include support, drop dead code. # gpg: Signature made Thu 10 Jan 2019 08:47:10 GMT # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/ui-20190110-pull-request: spice: Remove unused include keymaps: drop support for include files keymaps: remove common include keymaps: drop nl-be map keymaps: remove modifiers include ui/console: Remove qemu_create_display_surface_guestmem() configure: bump spice-server required version to 0.12.5 egl-headless: add egl_create_context Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-01-10Merge remote-tracking branch ↵Peter Maydell17-20/+14
'remotes/vivier2/tags/trivial-patches-pull-request' into staging Trivial patches for 4.0 (2019-01-09) # gpg: Signature made Wed 09 Jan 2019 13:06:58 GMT # gpg: using RSA key F30C38BD3F2FBE3C # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" # gpg: aka "Laurent Vivier <laurent@vivier.eu>" # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier2/tags/trivial-patches-pull-request: ioapic: use TYPE_FOO MACRO than constant string trivial: Don't include isa.h if it is not really necessary hw/audio/marvell: Don't include unnecessary i2c.h header file qom: Include qemu/fprintf-fn.h in cpu.h hw/core: fix whitespace in a sentence typedefs: (Re-)sort entries alphabetically Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-01-10qom: Don't keep error value between object_property_parse() callsEduardo Habkost1-1/+1
When handling errp==NULL at object_apply_global_props(), we are leaving the old error value in `err` after printing a warning. This makes QEMU crash if two global properties generate warnings: $ echo device_add rtl8139 | qemu-system-x86_64 -monitor stdio -global rtl8139.xxx=yyy -global rtl8139.xxx=zzz warning: can't apply global rtl8139.xxx=yyy: Property '.xxx' not found qemu-system-x86_64: util/error.c:57: error_setv: Assertion `*errp == NULL' failed. Aborted (core dumped) Fix that by making `err` go out of scope immediately after the warn_report_err() call. Fixes: 50545b2cc029 "qdev-props: call object_apply_global_props()" Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20190110020259.8492-2-ehabkost@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-01-10Merge remote-tracking branch 'remotes/famz/tags/staging-pull-request' into ↵Peter Maydell2-10/+10
staging Block/testing patches v2: Fix URL. Drop BSD patch. # gpg: Signature made Wed 09 Jan 2019 01:51:47 GMT # gpg: using RSA key CA35624C6A9171C6 # gpg: Good signature from "Fam Zheng <famz@redhat.com>" # Primary key fingerprint: 5003 7CB7 9706 0F76 F021 AD56 CA35 624C 6A91 71C6 * remotes/famz/tags/staging-pull-request: docker: Use a stable snapshot for Debian Sid block/nvme: optimize the performance of nvme driver based on vfio-pci Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-01-10usb-audio: ignore usb packages with wrong sizeGerd Hoffmann1-0/+3
usb packets with no payload (zero length) seem to happen in practice for whatever reason. Add a check and skip the packet then, otherwise we'll trigger an assert. Reported-by: Leonardo Soares Müller <leozinho29_eu@hotmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20181211072649.20700-1-kraxel@redhat.com
2019-01-10hw/audio/marvell: Don't include unnecessary i2c.h header fileThomas Huth1-1/+0
This device does not use I2C, so no need to include the header file here. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1546614146-10525-1-git-send-email-thuth@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-01-10linux-user: make pwrite64/pread64(fd, NULL, 0, offset) return 0Peter Maydell1-4/+18
Linux returns success if pwrite64() or pread64() are called with a zero length NULL buffer, but QEMU was returning -TARGET_EFAULT. This is the same bug that we fixed in commit 58cfa6c2e6eb51b23cc9 for the write syscall, and long before that in 38d840e6790c29f59 for the read syscall. Fixes: https://bugs.launchpad.net/qemu/+bug/1810433 Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190108184900.9654-1-peter.maydell@linaro.org> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2019-01-10Add getsockopt for settable SOL_IPV6 optionsTom Deseyn1-0/+39
Signed-off-by: Tom Deseyn <tom.deseyn@gmail.com> Message-Id: <20181213130611.7496-1-tom.deseyn@gmail.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2019-01-10spice: Remove unused includeFrediano Ziglio1-1/+0
The definitions in the header are not used. Also this fixes porting SPICE to Windows where the header is not available. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20190107184404.31993-1-fziglio@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-01-10keymaps: drop support for include filesGerd Hoffmann1-4/+3
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Li Qiang <liq3ea@gmail.com> Message-id: 20181116104319.10329-5-kraxel@redhat.com