Re: [PATCH 1/2] block: bdrv_set_backing_bs: fix use-after-free

2020-03-16 Thread John Snow
On 3/16/20 4:47 AM, Philippe Mathieu-Daudé wrote: > On 3/16/20 7:06 AM, Vladimir Sementsov-Ogievskiy wrote: >> There is a use-after-free possible: bdrv_unref_child() leaves >> bs->backing freed but not NULL. bdrv_attach_child may produce nested >> polling loop due to drain, than access of freed

[PULL 18/38] linux-user, xtensa: add syscall table generation support

2020-03-16 Thread Laurent Vivier
Copy syscall.tbl and syscallhdr.sh from linux/arch/xtensa/kernel/syscalls v5.5 Update syscallhdr.sh to generate QEMU syscall_nr.h Signed-off-by: Laurent Vivier Reviewed-by: Taylor Simpson Message-Id: <20200310103403.3284090-6-laur...@vivier.eu> Signed-off-by: Laurent Vivier --- configure

Re: [PATCH v3 11/34] qapi/schema: Clean up around QAPISchemaEntity.connect_doc()

2020-03-16 Thread Marc-André Lureau
On Sun, Mar 15, 2020 at 4:23 PM Markus Armbruster wrote: > > QAPISchemaEntity calls doc.connect_feature() in .check(). Improper > since commit ee1e6a1f6c8 split .connect_doc() off .check(). Move the > call. Requires making the children call super().connect_doc() as they > should. > > Signed-off

Re: [PATCH v3 28/34] qapi: Implement deprecated-output=hide for QMP command results

2020-03-16 Thread Marc-André Lureau
Hi On Sun, Mar 15, 2020 at 4:11 PM Markus Armbruster wrote: > > This policy suppresses deprecated bits in output, and thus permits > "testing the future". Implement it for QMP command results. Example: > when QEMU is run with -compat deprecated-output=hide, then > > {"execute": "query-cpus-

Re: [PATCH v3 21/34] qapi: Inline do_qmp_dispatch() into qmp_dispatch()

2020-03-16 Thread Marc-André Lureau
On Sun, Mar 15, 2020 at 4:05 PM Markus Armbruster wrote: > > Both functions check @request is a QDict, and both have code for > QCO_NO_SUCCESS_RESP. This wasn't the case back when they were > created. It's a sign of muddled responsibilities. Inline. The next > commits will clean up some more.

[PULL 24/38] linux-user, s390x: add syscall table generation support

2020-03-16 Thread Laurent Vivier
Copy syscall.tbl from linux/arch/s390x/kernel/syscalls v5.5 Copy syscallhdr.sh from m68k. Signed-off-by: Laurent Vivier Reviewed-by: Taylor Simpson Message-Id: <20200310103403.3284090-12-laur...@vivier.eu> Signed-off-by: Laurent Vivier --- configure | 3 +- linux-user/Ma

[PATCH v1 15/28] target/arm: prepare for multiple dynamic XMLs

2020-03-16 Thread Alex Bennée
We will want to generate similar dynamic XML for gdbstub support of SVE registers (the upstream doesn't use XML). To that end lightly rename a few things to make the distinction. Signed-off-by: Alex Bennée Acked-by: Richard Henderson --- target/arm/cpu.h | 20 +--- target/ar

Re: [PULL 04/31] util/async: make bh_aio_poll() O(1)

2020-03-16 Thread Marc-André Lureau
Hi On Sat, Feb 22, 2020 at 9:51 AM Stefan Hajnoczi wrote: > > The ctx->first_bh list contains all created BHs, including those that > are not scheduled. The list is iterated by the event loop and therefore > has O(n) time complexity with respected to the number of created BHs. > > Rewrite BHs so

[PATCH v2 3/4] usb-serial: Increase receive buffer to 496

2020-03-16 Thread Jason Andryuk
A FTDI USB adapter on an xHCI controller can send 512 byte USB packets. These are 8 * ( 2 bytes header + 62 bytes data). A 384 byte receive buffer is insufficient to fill a 512 byte packet, so bump the receive size to 496 ( 512 - 2 * 8 ). Signed-off-by: Jason Andryuk Reviewed-by: Samuel Thibault

[PULL 34/38] linux-user,mips: update syscall-args-o32.c.inc

2020-03-16 Thread Laurent Vivier
Add a script to update the file from strace github and run it Signed-off-by: Laurent Vivier Reviewed-by: Taylor Simpson Message-Id: <20200310103403.3284090-22-laur...@vivier.eu> [lv: added file in MAINTAINERS] Signed-off-by: Laurent Vivier --- MAINTAINERS| 1 + li

[PATCH v1 13/28] target/i386: use gdb_get_reg helpers

2020-03-16 Thread Alex Bennée
This is cleaner than poking memory directly and will make later clean-ups easier. Signed-off-by: Alex Bennée --- v7 - remove stray space - fixup the floatx80 set/get routines --- target/i386/gdbstub.c | 27 +++ 1 file changed, 11 insertions(+), 16 deletions(-) diff

[PULL 27/38] linux-user, i386: add syscall table generation support

2020-03-16 Thread Laurent Vivier
Copy syscall_32.tbl and syscallhdr.sh from linux/arch/x86/kernel/syscalls v5.5 Update syscallhdr.sh to generate QEMU syscall_nr.h Signed-off-by: Laurent Vivier Reviewed-by: Taylor Simpson Message-Id: <20200310103403.3284090-15-laur...@vivier.eu> Signed-off-by: Laurent Vivier --- configure

[PATCH v1 12/28] target/m68k: use gdb_get_reg helpers

2020-03-16 Thread Alex Bennée
This is cleaner than poking memory directly and will make later clean-ups easier. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier --- v3 - fix mem_buf references - fix mem_buf + len cases --- target/m68k/helper.c | 29 +++-- 1

[PATCH v2 0/4] usb-serial: xHCI and timeout fixes

2020-03-16 Thread Jason Andryuk
This patch series includes two fixes for usb-serial. The first is a data corruption issue with xHCI controllers. The FTDI data packets need to have a 2 byte header start every 64 bytes of packet data. For EHCI this is not a problem since USBPacket size is 64, so only 1 such chunk fits in a packe

Re: [PATCH v2 3/8] ppc/spapr: Add FWNMI System Reset state

2020-03-16 Thread Cédric Le Goater
On 3/16/20 3:26 PM, Nicholas Piggin wrote: > The FWNMI option must deliver system reset interrupts to their > registered address, and there are a few constraints on the handler > addresses specified in PAPR. Add the system reset address state and > checks. > > Signed-off-by: Nicholas Piggin This

[PULL 22/38] linux-user, ppc: add syscall table generation support

2020-03-16 Thread Laurent Vivier
Copy syscall.tbl and syscallhdr.sh from linux/arch/ppc/kernel/syscalls v5.5 Update syscallhdr.sh to generate QEMU syscall_nr.h and to not generate the entry if entry point is sys_ni_syscall. Fix ppc/signal.c to define do_sigreturn() for TARGET_ABI32. Signed-off-by: Laurent Vivier Reviewed-by: Ta

[PATCH v1 09/28] gdbstub: move mem_buf to GDBState and use GByteArray

2020-03-16 Thread Alex Bennée
This is in preparation for further re-factoring of the register API with the rest of the code. Theoretically the read register function could overwrite the MAX_PACKET_LENGTH buffer although currently all registers are well within the size range. Signed-off-by: Alex Bennée Reviewed-by: Richard Hen

Re: [PATCH v2 7/8] ppc/spapr: Implement FWNMI System Reset delivery

2020-03-16 Thread Mahesh J Salgaonkar
On 2020-03-17 00:26:12 Tue, Nicholas Piggin wrote: > PAPR requires that if "ibm,nmi-register" succeeds, then the hypervisor > delivers all system reset and machine check exceptions to the registered > addresses. > > System Resets are delivered with registers set to the architected state, > and wit

[PULL 12/38] linux-user: Support futex_time64

2020-03-16 Thread Laurent Vivier
From: Alistair Francis Add support for host and target futex_time64. If futex_time64 exists on the host we try that first before falling back to the standard futex syscall. Signed-off-by: Alistair Francis Reviewed-by: Laurent Vivier Message-Id: <517832730838e1d0b5eda26781b280854d792f9e.158414

[PULL 30/38] linux-user, mips64: add syscall table generation support

2020-03-16 Thread Laurent Vivier
Copy syscall_n32.tbl, syscall_n64.tbl and syscallhdr.sh from linux/arch/parisc/kernel/syscalls v5.5 Update syscallhdr.sh to generate QEMU syscall_nr.h Move the offsets (6000 for n32 and 5000 for n64) from the file to the Makefile.objs to be passed to syscallhdr.sh Signed-off-by: Laurent Vivier R

Re: [PATCH v3 06/34] tests/test-qmp-cmds: Check responses more thoroughly

2020-03-16 Thread Eric Blake
On 3/15/20 9:46 AM, Markus Armbruster wrote: Signed-off-by: Markus Armbruster --- tests/test-qmp-cmds.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) @@ -163,9 +164,17 @@ static QObject *do_qmp_dispatch(QDict *req, bool allow_oob) static void do_qmp_disp

[PATCH v1 05/28] travis.yml: Set G_MESSAGES_DEBUG do report GLib errors

2020-03-16 Thread Alex Bennée
From: Philippe Mathieu-Daudé Since commit f5852efa293 we can display GLib errors with the QEMU error reporting API. Set it to the 'error' level, as this helps understanding failures from QEMU calls to GLib on Travis-CI. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-I

[PULL 05/38] linux-user: Flush out implementation of gettimeofday

2020-03-16 Thread Laurent Vivier
From: Richard Henderson The first argument, timeval, is allowed to be NULL. The second argument, timezone, was missing. While its use is deprecated, it is still present in the syscall. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Message-Id:

[PULL 37/38] linux-user, nios2: sync syscall numbers with kernel v5.5

2020-03-16 Thread Laurent Vivier
Use helper script scripts/gensyscalls.sh to generate the file. This adds TARGET_NR_llseek that was missing and remove syscalls 1024 to 1079. Add new syscalls from 288 (pkey_mprotect) to 434 (pidfd_open) Signed-off-by: Laurent Vivier Reviewed-by: Alistair Francis Message-Id: <20200316085620.309

[PATCH v1 02/28] tests/docker: Update VirGL git repository URL

2020-03-16 Thread Alex Bennée
From: Philippe Mathieu-Daudé freedesktop.org is moving to a GitLab instance, use the new url. - https://www.fooishbar.org/blog/gitlab-fdo-introduction/ - https://gitlab.freedesktop.org/freedesktop/freedesktop/-/wikis/home Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Messag

Re: [PATCH v2 3/8] ppc/spapr: Add FWNMI System Reset state

2020-03-16 Thread Mahesh J Salgaonkar
On 2020-03-17 00:26:08 Tue, Nicholas Piggin wrote: > The FWNMI option must deliver system reset interrupts to their > registered address, and there are a few constraints on the handler > addresses specified in PAPR. Add the system reset address state and > checks. > > Signed-off-by: Nicholas Piggi

[PULL 11/38] linux-user/syscall: Add support for clock_gettime64/clock_settime64

2020-03-16 Thread Laurent Vivier
From: Alistair Francis Add support for the clock_gettime64/clock_settime64 syscalls. If your host is 64-bit or is 32-bit with the *_time64 syscall then the timespec will correctly be a 64-bit time_t. Otherwise the host will return a 32-bit time_t which will be rounded to 64-bits. This will be in

[PULL 23/38] linux-user, s390x: remove syscall definitions for !TARGET_S390X

2020-03-16 Thread Laurent Vivier
We don't support other 32bit architecture. Update file to comply with coding style (TAB). Signed-off-by: Laurent Vivier Reviewed-by: Taylor Simpson Message-Id: <20200310103403.3284090-11-laur...@vivier.eu> Signed-off-by: Laurent Vivier --- linux-user/s390x/syscall_nr.h | 313 +-

[PULL 01/38] target/i386: Renumber EXCP_SYSCALL

2020-03-16 Thread Laurent Vivier
From: Richard Henderson We are not short of numbers for EXCP_*. There is no need to confuse things by having EXCP_VMEXIT and EXCP_SYSCALL overlap, even though the former is only used for system mode and the latter is only used for user mode. Reviewed-by: Paolo Bonzini Reviewed-by: Alex Bennée

[PATCH v1 04/28] tests/docker: Update VirGL to v0.8.0

2020-03-16 Thread Alex Bennée
From: Philippe Mathieu-Daudé Building the qemu:debian-amd64 fails when building VirGL: make[2]: Entering directory '/usr/src/virglrenderer/src/gallium/auxiliary' CC cso_cache/cso_cache.lo CC cso_cache/cso_hash.lo CC os/os_misc.lo CC util/u_debug.lo C

[PULL 29/38] linux-user, mips: add syscall table generation support

2020-03-16 Thread Laurent Vivier
Copy syscall.tbl and syscallhdr.sh from linux/arch/mips/kernel/syscalls/syscall_o32.tbl v5.5 Update syscallhdr.sh to generate QEMU syscall_nr.h Move the offset (4000) from the file to the Makefile.objs to be passed to syscallhdr.sh Rename on the fly fadvise64 to fadvise64_64. Signed-off-by: Laure

[PATCH v1 20/28] tests/tcg/aarch64: userspace system register test

2020-03-16 Thread Alex Bennée
This tests a bunch of registers that the kernel allows userspace to read including the CPUID registers. We need a SVE aware compiler as we are testing the id_aa64zfr0_el1 register in the set. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20190205190224.2198-7-alex.ben...

[PATCH v1 01/28] tests/docker: Install tools to cross-debug and build Linux kernels

2020-03-16 Thread Alex Bennée
From: Philippe Mathieu-Daudé We often run Linux kernels to test QEMU. We sometimes need to build them manually to use non-default features. We only miss the tiny 'bc' tool. The ncurses library is helpful to run 'make menuconfig'. Finally, gdb-multiarch allow us to debug a TCG guest when its arc

[PULL 02/38] linux-user/i386: Split out gen_signal

2020-03-16 Thread Laurent Vivier
From: Richard Henderson This is a bit tidier than open-coding the 5 lines necessary to initialize the target_siginfo_t. In addition, this zeros the remaining bytes of the target_siginfo_t, rather than passing in garbage. Reviewed-by: Paolo Bonzini Reviewed-by: Alex Bennée Reviewed-by: Philipp

[PULL 26/38] linux-user, x86_64, i386: cleanup TARGET_NR_arch_prctl

2020-03-16 Thread Laurent Vivier
Define do_arch_prctl() for i386 and x86_64, but return -TARGET_ENOSYS for i386. Signed-off-by: Laurent Vivier Reviewed-by: Taylor Simpson Message-Id: <20200310103403.3284090-14-laur...@vivier.eu> Signed-off-by: Laurent Vivier --- linux-user/i386/target_cpu.h | 4 ++-- linux-user/syscall.c

[PATCH v3 16/19] target/arm: Do not build TCG objects when TCG is off

2020-03-16 Thread Philippe Mathieu-Daudé
From: Samuel Ortiz We can now safely turn all TCG dependent build off when CONFIG_TCG is off. This allows building ARM binaries with --disable-tcg. Signed-off-by: Samuel Ortiz [PMD: Heavily rebased during 18 months] Signed-off-by: Philippe Mathieu-Daudé --- target/arm/Makefile.objs | 4 ++--

Re: [PATCH RESEND v2] block/nvme: introduce PMR support from NVMe 1.4 spec

2020-03-16 Thread Andrzej Jakowski
On 3/16/20 4:32 AM, Stefan Hajnoczi wrote: > On Wed, Mar 11, 2020 at 11:08:27PM -0700, Klaus Birkelund Jensen wrote: >> On Mar 11 15:54, Andrzej Jakowski wrote: >>> On 3/11/20 2:20 AM, Stefan Hajnoczi wrote: Please try: $ git grep pmem backends/hostmem-file.c is the backe

[PATCH v1 19/28] target/arm: don't bother with id_aa64pfr0_read for USER_ONLY

2020-03-16 Thread Alex Bennée
For system emulation we need to check the state of the GIC before we report the value. However this isn't relevant to exporting of the value to linux-user and indeed breaks the exported value as set by modify_arm_cp_regs. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v2 - exte

[PULL 20/38] linux-user, microblaze: add syscall table generation support

2020-03-16 Thread Laurent Vivier
Copy syscall.tbl and syscallhdr.sh from linux/arch/microblaze/kernel/syscalls v5.5 Update syscallhdr.sh to generate QEMU syscall_nr.h Signed-off-by: Laurent Vivier Reviewed-by: Taylor Simpson Message-Id: <20200310103403.3284090-8-laur...@vivier.eu> Signed-off-by: Laurent Vivier --- configure

[PATCH v3 15/19] target/arm: Make m_helper.c optional via CONFIG_ARM_V7M

2020-03-16 Thread Philippe Mathieu-Daudé
From: Thomas Huth We've already got the CONFIG_ARM_V7M switch, but it currently can not be disabled yet. The m_helper.c code should not be compiled into the binary if the switch is not enabled. We also have to provide some stubs in a separate file to make sure that we still can link the other cod

[PATCH v1 25/28] tests/tcg/aarch64: add test-sve-ioctl guest-debug test

2020-03-16 Thread Alex Bennée
This test exercises the gdbstub while runing the sve-iotcl test. I haven't plubmed it into make system as we need a way of verifying if gdb has the right support for SVE. Signed-off-by: Alex Bennée --- v4 - interrogate ZCR_EL1 directly as no longer have vg v5 - plumb in - skip if fails to

[PULL 13/38] linux-user/riscv: Update the syscall_nr's to the 5.5 kernel

2020-03-16 Thread Laurent Vivier
From: Alistair Francis Signed-off-by: Alistair Francis Reviewed-by: Laurent Vivier Message-Id: <8e512fa2dc885aafc4d9c4013ee033442827a4a0.1584051142.git.alistair.fran...@wdc.com> Signed-off-by: Laurent Vivier --- linux-user/riscv/syscall32_nr.h | 295 +++ linux-use

Re: [PATCH v3 1/4] scripts: add a script to generate syscall_nr.h

2020-03-16 Thread Laurent Vivier
Le 16/03/2020 à 17:21, Taylor Simpson a écrit : > > >> -Original Message- >> From: Laurent Vivier >> Sent: Monday, March 16, 2020 3:56 AM >> To: qemu-devel@nongnu.org >> Cc: Laurent Vivier ; Richard Henderson >> ; Riku Voipio ; Taylor >> Simpson ; Alistair Francis >> >> Subject: [PATCH

[PATCH v3 14/19] target/arm: Restrict ARMv7 M-profile cpus to TCG accel

2020-03-16 Thread Philippe Mathieu-Daudé
A KVM-only build won't be able to run M-profile cpus. Only enable the following ARMv7 M-Profile CPUs when TCG is available: - Cortex-M3 - Cortex-M4 - Cortex-M33 Signed-off-by: Philippe Mathieu-Daudé --- default-configs/arm-softmmu.mak | 8 -- target/arm/cpu.c| 176 -

[PATCH v1 28/28] gdbstub: Fix single-step issue by confirming 'vContSupported+' feature to gdb

2020-03-16 Thread Alex Bennée
From: Changbin Du Recently when debugging an arm32 system on qemu, I found sometimes the single-step command (stepi) is not working. This can be reproduced by below steps: 1) start qemu-system-arm -s -S .. and wait for gdb connection. 2) start gdb and connect to qemu. In my case, gdb gets a wro

[PULL 10/38] linux-user: Protect more syscalls

2020-03-16 Thread Laurent Vivier
From: Alistair Francis New y2038 safe 32-bit architectures (like RISC-V) don't support old syscalls with a 32-bit time_t. The kernel defines new *_time64 versions of these syscalls. Add some more #ifdefs to syscall.c in linux-user to allow us to compile without these old syscalls. Signed-off-by:

[PULL 04/38] linux-user: Add x86_64 vsyscall page to /proc/self/maps

2020-03-16 Thread Laurent Vivier
From: Richard Henderson The page isn't (necessarily) present in the host /proc/self/maps, and even if it might be it isn't present in page_flags, and even if it was it might not have the same set of page permissions. The easiest thing to do, particularly when it comes to the "[vsyscall]" note at

Re: [PATCH v9] s390x: protvirt: Fence huge pages

2020-03-16 Thread Christian Borntraeger
On 16.03.20 11:06, Janosch Frank wrote: > On 3/13/20 9:21 AM, Christian Borntraeger wrote: >> >> >> On 12.03.20 17:25, Janosch Frank wrote: >>> Let's bail out of the protected transition if we detect that huge >>> pages might be in use. >>> >>> Signed-off-by: Janosch Frank >>> --- >>> >>> I'd l

[PATCH v3 07/19] target/arm: Make cpu_register() available for other files

2020-03-16 Thread Philippe Mathieu-Daudé
From: Thomas Huth Make cpu_register() (renamed to arm_cpu_register()) available from internals.h so we can register CPUs also from other files in the future. Signed-off-by: Thomas Huth Reviewed-by: Richard Henderson Reviewed-by: Eric Auger Message-ID: <20190921150420.30743-2-th...@redhat.com>

[PULL 09/38] linux-user: Update TASK_UNMAPPED_BASE for aarch64

2020-03-16 Thread Laurent Vivier
From: Lirong Yuan This change updates TASK_UNMAPPED_BASE (the base address for guest programs) for aarch64. It is needed to allow qemu to work with Thread Sanitizer (TSan), which has specific boundary definitions for memory mappings on different platforms: https://github.com/llvm/llvm-project/

[PATCH v1 06/28] gdbstub: make GDBState static and have common init function

2020-03-16 Thread Alex Bennée
Instead of allocating make this entirely static. We shall reduce the size of the structure in later commits and dynamically allocate parts of it. We introduce an init and reset helper function to keep all the manipulation in one place. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Re

[PULL 15/38] linux-user, alpha: add syscall table generation support

2020-03-16 Thread Laurent Vivier
Copy syscall.tbl and syscallhdr.sh from linux/arch/alpha/kernel/syscalls v5.5 Update syscallhdr.sh to generate QEMU syscall_nr.h Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson Reviewed-by: Taylor Simpson Message-Id: <20200310103403.3284090-3-laur...@vivier.eu> Signed-off-by: Laure

[PULL 06/38] linux-user: Add AT_EXECFN auxval

2020-03-16 Thread Laurent Vivier
From: Lirong Yuan This change adds the support for AT_EXECFN auxval. Signed-off-by: Lirong Yuan Reviewed-by: Laurent Vivier Message-Id: <20200302193153.66415-1-yua...@google.com> Signed-off-by: Laurent Vivier --- linux-user/elfload.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) d

[PATCH 2/2] hw/rdma: avoid suspicious strncpy() use

2020-03-16 Thread Stefan Hajnoczi
gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1) with sanitizers enabled reports the following error: CC x86_64-softmmu/hw/rdma/vmw/pvrdma_dev_ring.o In file included from /usr/include/string.h:495, from include/qemu/osdep.h:101, from hw/rdma/vmw/pvrdma_dev_ring.

[PATCH v1 10/28] gdbstub: add helper for 128 bit registers

2020-03-16 Thread Alex Bennée
Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- v2 - take care of endianess of the whole 128 bit word --- include/exec/gdbstub.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h

[PULL 33/38] linux-user,mips: move content of mips_syscall_args

2020-03-16 Thread Laurent Vivier
Move content of mips_syscall_args to mips-syscall-args-o32.c.inc to ease automatic update. No functionnal change Signed-off-by: Laurent Vivier Reviewed-by: Taylor Simpson Message-Id: <20200310103403.3284090-21-laur...@vivier.eu> Signed-off-by: Laurent Vivier --- linux-user/mips/cpu_loop.c

[PATCH 0/2] gcc 9.2 strncpy(3) warnings fixes

2020-03-16 Thread Stefan Hajnoczi
I hit two strncpy(3) compiler warnings with gcc 9.2 and sanitizers enabled recently. Use QEMU's pstrcpy() function instead - it always NUL-terminates and therefore eliminates the concerns behind this compiler warning. Stefan Hajnoczi (2): migration: avoid suspicious strncpy() use hw/rdma: avo

[PULL 03/38] linux-user/i386: Emulate x86_64 vsyscalls

2020-03-16 Thread Laurent Vivier
From: Richard Henderson Notice the magic page during translate, much like we already do for the arm32 commpage. At runtime, raise an exception to return cpu_loop for emulation. Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson Message-Id: <20200213032223.14643-4-richard.hender...@li

[PATCH v1 00/28 for 5.0] testing and gdbstub

2020-03-16 Thread Alex Bennée
Hi, This is the last chance to get any reviews in before I send a pull request later today. To avoid having multiple PRs I've combined both the testing changes and the gdbstub updates. In the end I had to drop Gerd's vm updates as it cause problems with the acceptance testing. The following patch

[PULL 28/38] linux-user, x86_64: add syscall table generation support

2020-03-16 Thread Laurent Vivier
Copy syscall_64.tbl and syscallhdr.sh from linux/arch/x86/kernel/syscalls v5.5 Update syscallhdr.sh to generate QEMU syscall_nr.h Signed-off-by: Laurent Vivier Reviewed-by: Taylor Simpson Message-Id: <20200310103403.3284090-16-laur...@vivier.eu> Signed-off-by: Laurent Vivier --- configure

[PATCH v3 02/19] target/arm: Make set_feature() available for other files

2020-03-16 Thread Philippe Mathieu-Daudé
From: Thomas Huth Move the common set_feature() and unset_feature() functions from cpu.c and cpu64.c to internals.h. Signed-off-by: Thomas Huth Reviewed-by: Richard Henderson Reviewed-by: Eric Auger Message-ID: <20190921150420.30743-2-th...@redhat.com> [PMD: Split Thomas's patch in two: set_f

[PULL 00/38] Linux user for 5.0 patches

2020-03-16 Thread Laurent Vivier
The following changes since commit 373c7068dd610e97f0b551b5a6d0a27cd6da4506: qemu.nsi: Install Sphinx documentation (2020-03-09 16:45:00 +) are available in the Git repository at: git://github.com/vivier/qemu.git tags/linux-user-for-5.0-pull-request for you to fetch changes up to 63e05b

[PATCH v1 03/28] tests/docker: Remove obsolete VirGL --with-glx configure option

2020-03-16 Thread Alex Bennée
From: Philippe Mathieu-Daudé The GLX configure option has been removed in 71c75f201d [*]. We missed that when updating to v0.7.0 in commit fab3220f97. This silents: configure: creating ./config.status config.status: creating virglrenderer.pc ... configure: WARNING: unrecognized options:

[PULL 35/38] scripts: add a script to generate syscall_nr.h

2020-03-16 Thread Laurent Vivier
This script is needed for targets based on asm-generic syscall numbers generation Signed-off-by: Laurent Vivier Reviewed-by: Alistair Francis Reviewed-by: Taylor Simpson Reviewed-by: Richard Henderson Message-Id: <20200316085620.309769-2-laur...@vivier.eu> [lv: added file in MAINTAINERS] ---

[PATCH v3 01/19] target/arm: Rename KVM set_feature() as kvm_set_feature()

2020-03-16 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/arm/kvm32.c | 10 +- target/arm/kvm64.c | 16 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c index f271181ab8..0ab28b473a 100644 --- a/target/arm/kvm32.c +++ b/targe

[PATCH v3 12/19] target/arm: Restrict ARMv6 cpus to TCG accel

2020-03-16 Thread Philippe Mathieu-Daudé
KVM requires a cpu based on (at least) the ARMv7 architecture. Only enable the following ARMv6 CPUs when TCG is available: - ARM1136 - ARM1176 - ARM11MPCore - Cortex-M0 Signed-off-by: Philippe Mathieu-Daudé --- default-configs/arm-softmmu.mak | 2 - target/arm/cpu.c|

[PULL 31/38] linux-user, scripts: add a script to update syscall.tbl

2020-03-16 Thread Laurent Vivier
scripts/update-syscalltbl.sh has the list of syscall.tbl to update and can copy them from the linux source directory Signed-off-by: Laurent Vivier Reviewed-by: Taylor Simpson Reviewed-by: Richard Henderson Message-Id: <20200310103403.3284090-19-laur...@vivier.eu> Signed-off-by: Laurent Vivier

Re: [PATCH V2] vhost: correctly turn on VIRTIO_F_IOMMU_PLATFORM

2020-03-16 Thread Michael S. Tsirkin
On Fri, Mar 13, 2020 at 12:31:22PM -0400, Peter Xu wrote: > On Fri, Mar 13, 2020 at 11:29:59AM -0400, Michael S. Tsirkin wrote: > > On Fri, Mar 13, 2020 at 01:44:46PM +0100, Halil Pasic wrote: > > > [..] > > > > > > > > > > CCing Tom. @Tom does vhost-vsock work for you with SEV and current > > >

Re: [PATCH qemu] spapr/rtas: Reserve space for RTAS blob and log

2020-03-16 Thread Greg Kurz
On Mon, 16 Mar 2020 12:18:41 +1100 Alexey Kardashevskiy wrote: > At the moment SLOF reserves space for RTAS and instantiates the RTAS blob > which is 20 bytes binary blob calling an hypercall. The rest of the RTAS > area is a log which SLOF has no idea about but QEMU does. > > This moves RTAS si

[PULL 17/38] linux-user, m68k: add syscall table generation support

2020-03-16 Thread Laurent Vivier
Copy syscall.tbl and syscallhdr.sh from linux/arch/m68k/kernel/syscalls v5.5 Update syscallhdr.sh to generate QEMU syscall_nr.h Signed-off-by: Laurent Vivier Reviewed-by: Taylor Simpson Message-Id: <20200310103403.3284090-5-laur...@vivier.eu> Signed-off-by: Laurent Vivier --- configure

Re: [PATCH] hw/arm/fsl-imx7: Instantiate apbh_dma and ocotp as unimplemented devices

2020-03-16 Thread Peter Maydell
On Fri, 13 Mar 2020 at 16:15, Guenter Roeck wrote: > > Instantiating apbh_dma and ocotp as unimplemented devices prevents crashes > when booting Linux. > > apbh_dma: > > [ 14.046518] Unhandled fault: external abort on non-linefetch (0x808) at > 0xd0852008 > [ 14.047287] pgd = (ptrval) > [ 1

[PATCH v3 18/19] hw/arm: Do not build to 'virt' machine on Xen

2020-03-16 Thread Philippe Mathieu-Daudé
Xen on ARM does not use QEMU machines [*]. Disable the 'virt' machine there to avoid odd errors such: CC i386-softmmu/hw/cpu/a15mpcore.o hw/cpu/a15mpcore.c:28:10: fatal error: kvm_arm.h: No such file or directory [*] https://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensi

[PULL 08/38] linux-user: fix socket() strace

2020-03-16 Thread Laurent Vivier
print_socket_type() doesn't manage flags and the correct type cannot be displayed Signed-off-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200312165530.53450-1-laur...@vivier.eu> Signed-off-by: Laurent Vivier --- linux-user/strace.c | 8 +++- 1 file changed, 7 inser

Re: [PATCH v3 18/19] hw/arm: Do not build to 'virt' machine on Xen

2020-03-16 Thread Peter Maydell
On Mon, 16 Mar 2020 at 16:08, Philippe Mathieu-Daudé wrote: > > Xen on ARM does not use QEMU machines [*]. Disable the 'virt' > machine there to avoid odd errors such: > > CC i386-softmmu/hw/cpu/a15mpcore.o > hw/cpu/a15mpcore.c:28:10: fatal error: kvm_arm.h: No such file or directory >

Re: [PATCH 0/5] QEMU Gating CI

2020-03-16 Thread Aleksandar Markovic
On Mon, Mar 16, 2020 at 4:24 PM Alex Bennée wrote: > > > Daniel P. Berrangé writes: > > > On Thu, Mar 12, 2020 at 03:36:11PM -0400, Cleber Rosa wrote: > >> The idea about a public facing Gating CI for QEMU was lastly > >> summarized in an RFC[1]. Since then, it was decided that a > >> simpler ve

[PATCH v3 10/19] target/arm: Restrict ARMv4 cpus to TCG accel

2020-03-16 Thread Philippe Mathieu-Daudé
KVM requires a cpu based on (at least) the ARMv7 architecture. Only enable the following ARMv4 CPUs when TCG is available: - StrongARM (SA1100/1110) - OMAP1510 (TI925T) Signed-off-by: Philippe Mathieu-Daudé --- default-configs/arm-softmmu.mak | 2 - target/arm/cpu.c| 33 --

[PULL 07/38] linux-user: do prlimit selectively

2020-03-16 Thread Laurent Vivier
From: Tobias Koch Analogous to what commit 5dfa88f7 did for setrlimit, this commit selectively ignores limits for memory-related resources in prlimit64 calls. This is to prevent too restrictive limits from causing QEMU itself to malfunction. Signed-off-by: Tobias Koch Reviewed-by: Laurent Vivie

Re: [PATCH v3 19/34] qapi/schema: Call QAPIDoc.connect_member() in just one place

2020-03-16 Thread Marc-André Lureau
On Sun, Mar 15, 2020 at 4:00 PM Markus Armbruster wrote: > > The .connect_doc() of classes that have QAPISchemaMember connect them > to their documentation. Change them to delegate the actual work to > new QAPISchemaMember.connect_doc(). Matches the .connect_doc() that > already exist. > > Signe

Re: [PATCH] hw/arm/pxa2xx: Do not wire up OHCI for PXA255

2020-03-16 Thread Peter Maydell
On Fri, 13 Mar 2020 at 16:02, Guenter Roeck wrote: > > PXA255 does not support a USB OHCI controller, so don't wire it up. > > Signed-off-by: Guenter Roeck > --- > hw/arm/pxa2xx.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c > index 56a36202d7..336

[PATCH v3 19/19] .travis.yml: Add a KVM-only Aarch64 job

2020-03-16 Thread Philippe Mathieu-Daudé
Add a job to build QEMU on Aarch64 with TCG disabled, so this configuration won't bitrot over time. Signed-off-by: Philippe Mathieu-Daudé --- Job ran for 13 min 1 sec https://travis-ci.org/github/philmd/qemu/jobs/663122258 --- .travis.yml | 32 1 file changed, 32

[PATCH 1/2] migration: avoid suspicious strncpy() use

2020-03-16 Thread Stefan Hajnoczi
gcc (GCC) 9.2.1 20190827 (Red Hat 9.2.1-1) with sanitizers enabled reports the following error: CC migration/global_state.o In file included from /usr/include/string.h:495, from /home/stefanha/qemu/include/qemu/osdep.h:101, from migration/global_sta

Re: [PATCH v3 14/34] qapi/introspect: Rename *qlit* to reduce confusion

2020-03-16 Thread Marc-André Lureau
On Sun, Mar 15, 2020 at 4:19 PM Markus Armbruster wrote: > > We generate the value of qmp_schema_qlit from an expression tree. The > function doing that is named to_qlit(), and its inputs are accumulated > in QAPISchemaGenIntrospectVisitor._qlits. We call both its input and > its output "qlit".

[PATCH v3 05/19] target/arm: Restrict Virtualization Host Extensions instructions to TCG

2020-03-16 Thread Philippe Mathieu-Daudé
Under KVM the ARMv8.1-VHE instruction will trap. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/helper.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index a5280c091b..ce6778283d 100644 --- a/target/a

Re: [PATCH v2 1/8] ppc/spapr: Fix FWNMI machine check failure handling

2020-03-16 Thread Greg Kurz
On Tue, 17 Mar 2020 00:26:06 +1000 Nicholas Piggin wrote: > ppc_cpu_do_system_reset delivers a system rreset interrupt to the guest, > which is certainly not what is intended here. Panic the guest like other > failure cases here do. > > Signed-off-by: Nicholas Piggin > --- Makes sense. Review

[PATCH v3 09/19] target/arm: Move ARM_V7M Kconfig from hw/ to target/

2020-03-16 Thread Philippe Mathieu-Daudé
ARM_V7M is a concept tied to the architecture. Move it to the target/arm/ directory to keep the hardware/architecture separation clearer. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/Kconfig | 3 --- target/Kconfig | 2 +- target/arm/Kconfig | 2 ++ 3 files changed, 3 insertions(+),

[PATCH v3 00/19] Support disabling TCG on ARM (part 2)

2020-03-16 Thread Philippe Mathieu-Daudé
Cover from Samuel Ortiz from (part 1) [1]: This patchset allows for building and running ARM targets with TCG disabled. [...] The rationale behind this work comes from the NEMU project where we're trying to only support x86 and ARM 64-bit architectures, without including the TCG code ba

[PATCH v3 08/19] target/arm: Add semihosting stub to allow building without TCG

2020-03-16 Thread Philippe Mathieu-Daudé
Semihosting requires TCG. When configured with --disable-tcg, the build fails because the 'do_arm_semihosting' is missing. Instead of adding more few more #ifdeffery to the helper code, add a stub. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/arm-semi-stub.c | 13 + target/ar

Re: [PATCH v3 04/34] docs/devel/qapi-code-gen: Document 'features' introspection

2020-03-16 Thread Eric Blake
On 3/15/20 9:46 AM, Markus Armbruster wrote: Commit 6a8c0b5102 "qapi: Add feature flags to struct types" neglected to update section "Client JSON Protocol introspection", and commit 23394b4c39 "qapi: Add feature flags to commands" didn't either. Make up for that. Signed-off-by: Markus Armbruste

Re: [PATCH v3 10/34] tests/test-qmp-event: Check event is actually emitted

2020-03-16 Thread Marc-André Lureau
On Sun, Mar 15, 2020 at 3:55 PM Markus Armbruster wrote: > > Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau > --- > tests/test-qmp-event.c | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c > index d

Re: [PATCH 1/3] MAINTAINERS: Adjust maintainer's status for some MIPS items

2020-03-16 Thread Aurelien Jarno
On 2020-03-13 02:00, Aleksandar Markovic wrote: > From: Aleksandar Markovic > > Aurelien has been and will forever remain an idol in QEMU for > MIPS world. However, since he decided to move on to other projects, > acknowledge the reality, and formally releive him from maintainer's > duties for QE

[PATCH v3 04/19] target/arm: Restric the Address Translate operations to TCG accel

2020-03-16 Thread Philippe Mathieu-Daudé
Under KVM the ATS instruction will trap. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/helper.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 924deffd65..a5280c091b 100644 --- a/target/arm/helper.c

Re: [PATCH v3 08/34] tests/test-qmp-event: Simplify test data setup

2020-03-16 Thread Marc-André Lureau
On Sun, Mar 15, 2020 at 3:55 PM Markus Armbruster wrote: > > Building expected data with qdict_put() & friends is tedious to write > and hard to read. Parse them from string literals with > qdict_from_jsonf_nofail() instead. > > While there, use initializers instead of assignments for initializin

Re: [PATCH] hw/arm/pxa2xx: Do not wire up OHCI for PXA255

2020-03-16 Thread Guenter Roeck
On 3/16/20 8:35 AM, Peter Maydell wrote: > On Fri, 13 Mar 2020 at 16:02, Guenter Roeck wrote: >> >> PXA255 does not support a USB OHCI controller, so don't wire it up. >> >> Signed-off-by: Guenter Roeck >> --- >> hw/arm/pxa2xx.c | 3 --- >> 1 file changed, 3 deletions(-) >> >> diff --git a/hw/ar

Re: [PATCH v3 05/34] tests/test-qmp-cmds: Factor out qmp_dispatch() test helpers

2020-03-16 Thread Marc-André Lureau
Hi On Sun, Mar 15, 2020 at 3:48 PM Markus Armbruster wrote: > > Checking the value of qmp_dispatch() is repetitive. Factor out > helpers do_qmp_dispatch() and do_qmp_dispatch_error(). Without this, > the next commit would make things even more repetitive. > > Signed-off-by: Markus Armbruster >

Re: [PATCH v2 1/4] m25p80: Convert to support tracing

2020-03-16 Thread Peter Maydell
On Mon, 16 Mar 2020 at 15:11, Cédric Le Goater wrote: > > On 3/16/20 3:58 PM, Peter Maydell wrote: > > On Mon, 16 Mar 2020 at 14:14, Cédric Le Goater wrote: > >> > >> Hello, > >> > >> On 2/17/20 4:47 PM, Cédric Le Goater wrote: > >>> Hello all, > >>> > >>> On 2/6/20 7:32 PM, Guenter Roeck wrote:

Re: [PATCH v6 3/4] qcow2: add zstd cluster compression

2020-03-16 Thread Denis Plotnikov
On 16.03.2020 17:01, Eric Blake wrote: On 3/12/20 4:22 AM, Denis Plotnikov wrote: zstd significantly reduces cluster compression time. It provides better compression performance maintaining the same level of the compression ratio in comparison with zlib, which, at the moment, is the only comp

[Bug 1866870] Re: KVM Guest pauses after upgrade to Ubuntu 20.04

2020-03-16 Thread Andreas Hasenack
Also crashed with the packages from the other ppa: ubuntu@f1:~$ qemu-system-x86_64 --help 2>&1|head -n 1 QEMU emulator version 4.2.0 (Debian 1:4.2-3ubuntu3~exp1) ubuntu@f1:~$ qemu-system-x86_64 --enable-kvm -cpu Penryn,vmx=on -m 512 --nodefaults --nographic qemu-system-x86_64: warning: host does

Re: [PATCH v3 09/34] tests/test-qmp-event: Use qobject_is_equal()

2020-03-16 Thread Marc-André Lureau
On Sun, Mar 15, 2020 at 3:48 PM Markus Armbruster wrote: > > Locally defined helper qdict_cmp_simple() implements just enough of a > comparison to serve here. Replace it by qobject_is_equal(), which > implements all of it. > > Signed-off-by: Markus Armbruster Reviewed-by: Marc-André Lureau >

[PULL 32/38] linux-user: update syscall.tbl from linux 0bf999f9c5e7

2020-03-16 Thread Laurent Vivier
Run scripts/update-syscalltbl.sh with linux commit 0bf999f9c5e7 Signed-off-by: Laurent Vivier Reviewed-by: Taylor Simpson Message-Id: <20200310103403.3284090-20-laur...@vivier.eu> Signed-off-by: Laurent Vivier --- linux-user/arm/syscall.tbl| 2 ++ linux-user/hppa/syscall.tbl | 2

[PULL 25/38] linux-user, sparc, sparc64: add syscall table generation support

2020-03-16 Thread Laurent Vivier
Copy syscall.tbl and syscallhdr.sh from linux/arch/sparc/kernel/syscalls v5.5 Update syscallhdr.sh to generate QEMU syscall_nr.h Signed-off-by: Laurent Vivier Reviewed-by: Taylor Simpson Message-Id: <20200310103403.3284090-13-laur...@vivier.eu> Signed-off-by: Laurent Vivier --- configure

<    1   2   3   4   5   6   7   >