Re: [PATCH v31 00/22] Add RX archtecture support

2020-02-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200223065102.61652-1-ys...@users.sourceforge.jp/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [PATCH v31 00/22] Add RX archtecture support Message-id:

Re: [PATCH v31 00/22] Add RX archtecture support

2020-02-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200223065102.61652-1-ys...@users.sourceforge.jp/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [PATCH v31 00/22] Add RX archtecture support Message-id:

Re: [PATCH v31 00/22] Add RX archtecture support

2020-02-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200223065102.61652-1-ys...@users.sourceforge.jp/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [PATCH v31 00/22] Add RX archtecture support Message-id:

Re: [PATCH] hw/ide: Remove status register read side effect

2020-02-22 Thread jasper.lowell
I'm having another look at the SET_FEATURE Solaris 10 error. I've enabled tracing and I see the following. The pci_cfg_read that shows up at the end continues a few thousand times(?) but I've omitted it. This appears to time out or something and then Solaris gives up on the device.

Re: [PATCH v31 00/22] Add RX archtecture support

2020-02-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200223065102.61652-1-ys...@users.sourceforge.jp/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [PATCH v31 00/22] Add RX archtecture support Message-id:

[PATCH v31 22/22] qemu-doc.texi: Add RX section.

2020-02-22 Thread Yoshinori Sato
Describe emulated target specification. And two examples. Signed-off-by: Yoshinori Sato --- qemu-doc.texi | 44 1 file changed, 44 insertions(+) diff --git a/qemu-doc.texi b/qemu-doc.texi index 33b9597b1d..d80a9c64f7 100644 --- a/qemu-doc.texi +++

[PATCH v31 07/22] target/rx: RX disassembler

2020-02-22 Thread Yoshinori Sato
Signed-off-by: Yoshinori Sato Reviewed-by: Richard Henderson Tested-by: Philippe Mathieu-Daudé Message-Id: <20190607091116.49044-5-ys...@users.sourceforge.jp> Signed-off-by: Richard Henderson --- include/disas/dis-asm.h |5 + target/rx/disas.c | 1480

[PATCH v31 04/22] target/rx: TCG translation

2020-02-22 Thread Yoshinori Sato
This part only supported RXv1 instructions. Instruction manual. https://www.renesas.com/us/en/doc/products/mpumcu/doc/rx_family/r01us0032ej0120_rxsm.pdf Signed-off-by: Yoshinori Sato Reviewed-by: Richard Henderson Tested-by: Philippe Mathieu-Daudé Message-Id:

[PATCH v31 20/22] Add rx-softmmu

2020-02-22 Thread Yoshinori Sato
Tested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Yoshinori Sato Message-Id: <20190607091116.49044-17-ys...@users.sourceforge.jp> Signed-off-by: Richard Henderson pick ed65c02993 target/rx: Add RX to SysEmuTarget pick 01372568ae tests: Add rx to

[PATCH v31 15/22] hw/timer: RX62N internal timer modules

2020-02-22 Thread Yoshinori Sato
renesas_tmr: 8bit timer modules. renesas_cmt: 16bit compare match timer modules. This part use many renesas's CPU. Hardware manual. https://www.renesas.com/us/en/doc/products/mpumcu/doc/rx_family/r01uh0033ej0140_rx62n.pdf Signed-off-by: Yoshinori Sato Reviewed-by: Alex Bennée Reviewed-by:

[PATCH v31 14/22] hw/intc: RX62N interrupt controller (ICUa)

2020-02-22 Thread Yoshinori Sato
This implementation supported only ICUa. Hardware manual. https://www.renesas.com/us/en/doc/products/mpumcu/doc/rx_family/r01uh0033ej0140_rx62n.pdf Signed-off-by: Yoshinori Sato Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id:

[PATCH v31 05/22] target/rx: TCG helper

2020-02-22 Thread Yoshinori Sato
Signed-off-by: Yoshinori Sato Message-Id: <20190616142836.10614-3-ys...@users.sourceforge.jp> Reviewed-by: Richard Henderson Message-Id: <20190607091116.49044-3-ys...@users.sourceforge.jp> Tested-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson [PMD: Removed tlb_fill, extracted

[PATCH v31 17/22] hw/rx: RX Target hardware definition

2020-02-22 Thread Yoshinori Sato
rx62n - RX62N cpu. rx-virt - RX QEMU virtual target. Signed-off-by: Yoshinori Sato Message-Id: <20190616142836.10614-17-ys...@users.sourceforge.jp> Tested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20190607091116.49044-9-ys...@users.sourceforge.jp>

[PATCH v31 16/22] hw/char: RX62N serial communication interface (SCI)

2020-02-22 Thread Yoshinori Sato
This module supported only non FIFO type. Hardware manual. https://www.renesas.com/us/en/doc/products/mpumcu/doc/rx_family/r01uh0033ej0140_rx62n.pdf Signed-off-by: Yoshinori Sato Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id:

[PATCH v31 13/22] target/rx: Dump bytes for each insn during disassembly

2020-02-22 Thread Yoshinori Sato
From: Richard Henderson There are so many different forms of each RX instruction that it will be very useful to be able to look at the bytes to see on which path a bug may lie. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato Signed-off-by: Yoshinori Sato Message-Id:

[PATCH v31 19/22] hw/rx: Restrict the RX62N microcontroller to the RX62N CPU core

2020-02-22 Thread Yoshinori Sato
From: Philippe Mathieu-Daudé While the VIRT machine can use different microcontrollers, the RX62N microcontroller is tied to the RX62N CPU core. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Yoshinori Sato --- hw/rx/rx-virt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH v31 06/22] target/rx: CPU definition

2020-02-22 Thread Yoshinori Sato
Signed-off-by: Yoshinori Sato Message-Id: <20190616142836.10614-4-ys...@users.sourceforge.jp> Reviewed-by: Richard Henderson Message-Id: <20190607091116.49044-4-ys...@users.sourceforge.jp> Signed-off-by: Richard Henderson [PMD: Use newer QOM style, split cpu-qom.h, restrict access to extable

[PATCH v31 18/22] hw/rx: Honor -accel qtest

2020-02-22 Thread Yoshinori Sato
From: Richard Henderson Issue an error if no kernel, no bios, and not qtest'ing. Fixes make check-qtest-rx: test/qom-test. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Yoshinori Sato Message-Id: <20190607091116.49044-16-ys...@users.sourceforge.jp> Tested-by: Philippe Mathieu-Daudé

[PATCH v31 00/22] Add RX archtecture support

2020-02-22 Thread Yoshinori Sato
Hello. This patch series is added Renesas RX target emulation. Changes for v30. Follow master changes. Fix checkpatch error. Changes for v29. Add target description XML. It required gdb-9.1. Follow git master changes. Changes for v28. Allow -m option. With this option, 16 Mbytes or more can be

[PATCH v31 09/22] target/rx: Replace operand with prt_ldmi in disassembler

2020-02-22 Thread Yoshinori Sato
From: Richard Henderson This has consistency with prt_ri(). It loads all data before beginning output. It uses exactly one call to prt() to emit the full instruction. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato Signed-off-by: Yoshinori Sato Message-Id:

[PATCH v31 21/22] BootLinuxConsoleTest: Test the RX-Virt machine

2020-02-22 Thread Yoshinori Sato
From: Philippe Mathieu-Daudé Add two tests for the rx-virt machine, based on the recommended test setup from Yoshinori Sato: https://lists.gnu.org/archive/html/qemu-devel/2019-05/msg03586.html - U-Boot prompt - Linux kernel with Sash shell These are very quick tests: $ avocado run -t

[PATCH v31 11/22] target/rx: Emit all disassembly in one prt()

2020-02-22 Thread Yoshinori Sato
From: Richard Henderson Many of the multi-part prints have been eliminated by previous patches. Eliminate the rest of them. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato Signed-off-by: Yoshinori Sato Message-Id: <20190607091116.49044-22-ys...@users.sourceforge.jp>

[PATCH v31 02/22] qemu/bitops.h: Add extract8 and extract16

2020-02-22 Thread Yoshinori Sato
Signed-off-by: Yoshinori Sato Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20190607091116.49044-10-ys...@users.sourceforge.jp> Tested-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/qemu/bitops.h | 38

[PATCH v31 10/22] target/rx: Use prt_ldmi for XCHG_mr disassembly

2020-02-22 Thread Yoshinori Sato
From: Richard Henderson Note that the ld == 3 case handled by prt_ldmi is decoded as XCHG_rr and cannot appear here. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato Signed-off-by: Yoshinori Sato Message-Id: <20190607091116.49044-21-ys...@users.sourceforge.jp> Tested-by:

[PATCH v31 03/22] hw/registerfields.h: Add 8bit and 16bit register macros

2020-02-22 Thread Yoshinori Sato
From: Philippe Mathieu-Daudé Some RX peripheral using 8bit and 16bit registers. Added 8bit and 16bit APIs. Signed-off-by: Yoshinori Sato Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20190607091116.49044-11-ys...@users.sourceforge.jp> Tested-by: Philippe

[PATCH v31 08/22] target/rx: Disassemble rx_index_addr into a string

2020-02-22 Thread Yoshinori Sato
From: Richard Henderson We were eliding all zero indexes. It is only ld==0 that does not have an index in the instruction. This also allows us to avoid breaking the final print into multiple pieces. Reviewed-by: Yoshinori Sato Signed-off-by: Yoshinori Sato Message-Id:

[PATCH v31 01/22] MAINTAINERS: Add RX

2020-02-22 Thread Yoshinori Sato
Signed-off-by: Yoshinori Sato Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20190607091116.49044-18-ys...@users.sourceforge.jp> Signed-off-by: Richard Henderson --- MAINTAINERS | 19 +++ 1 file changed, 19 insertions(+) diff --git

[PATCH v31 12/22] target/rx: Collect all bytes during disassembly

2020-02-22 Thread Yoshinori Sato
From: Richard Henderson Collected, to be used in the next patch. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato Signed-off-by: Yoshinori Sato Message-Id: <20190607091116.49044-23-ys...@users.sourceforge.jp> Tested-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson

Re: [PATCH v2] riscv: sifive_u: Add a "serial" property for board serial number

2020-02-22 Thread Bin Meng
On Sun, Feb 16, 2020 at 9:55 PM Bin Meng wrote: > > At present the board serial number is hard-coded to 1, and passed > to OTP model during initialization. Firmware (FSBL, U-Boot) uses > the serial number to generate a unique MAC address for the on-chip > ethernet controller. When multiple QEMU

Re: [PATCH v2 17/19] tcg: save vaddr temp for plugin usage

2020-02-22 Thread Emilio G. Cota
On Thu, Feb 13, 2020 at 22:51:07 +, Alex Bennée wrote: > From: Richard Henderson > > While do_gen_mem_cb does copy (via extu_tl_i64) vaddr into a new temp > this won't help if the vaddr temp gets clobbered by the actual > load/store op. To avoid this clobbering we explicitly copy vaddr >

Re: [PATCH v2 12/13] hw/arm/raspi: Add the Raspberry Pi B+ machine

2020-02-22 Thread Niek Linnenbank
Hey Philippe, Very nice to see that the Raspberry 1 will be supported again, thanks for contributing this! I tried to bring up the machine using raspbian 2019-09-26. It ran throught the early kernel initialisation but for me it gets stuck at this point: ./arm-softmmu/qemu-system-arm -M raspi1b

Re: [PATCH] hw/ide: Remove status register read side effect

2020-02-22 Thread BALATON Zoltan
On Sat, 22 Feb 2020, BALATON Zoltan wrote: On Sat, 22 Feb 2020, Mark Cave-Ayland wrote: On 21/02/2020 06:50, jasper.low...@bt.com wrote: The Linux libATA API documentation mentions that on some hardware, reading the status register has the side effect of clearing the interrupt condition. When

Re: [PATCH] hw/ide: Remove status register read side effect

2020-02-22 Thread BALATON Zoltan
On Sat, 22 Feb 2020, Mark Cave-Ayland wrote: On 21/02/2020 06:50, jasper.low...@bt.com wrote: The Linux libATA API documentation mentions that on some hardware, reading the status register has the side effect of clearing the interrupt condition. When emulating the generic Sun4u machine running

Re: [PATCH 0/3] hw: More dma_memory_read/write() API cleanup

2020-02-22 Thread Mark Cave-Ayland
On 21/02/2020 13:25, Philippe Mathieu-Daudé wrote: > Following up "global exec/memory/dma APIs cleanup" > https://www.mail-archive.com/qemu-devel@nongnu.org/msg681475.html > > Few more cleanups in PCNET & SCSI ESP devices. > > Philippe Mathieu-Daudé (3): > hw/dma/sparc32_dma: Make

Re: [PATCH] hw/ide: Remove status register read side effect

2020-02-22 Thread Mark Cave-Ayland
On 21/02/2020 06:50, jasper.low...@bt.com wrote: > The Linux libATA API documentation mentions that on some hardware, > reading the status register has the side effect of clearing the > interrupt condition. When emulating the generic Sun4u machine running > Solaris 10, the Solaris 10 CMD646

Re: [PATCH] hw/ide: Remove status register read side effect

2020-02-22 Thread BALATON Zoltan
On Sat, 22 Feb 2020, jasper.low...@bt.com wrote: This patch doesn't solve all the problems for Solaris 10. It gets further in the boot process but it is still unable to mount the file system. I suspect that there are more bugs in the IDE/CMD646 emulation. I'm going to continue looking into it.

Re: [RFC PATCH v3 00/27] Add subcluster allocation to qcow2

2020-02-22 Thread Alberto Garcia
On Fri 21 Feb 2020 06:10:52 PM CET, Max Reitz wrote: > So now I wonder on what your plans are after this series. Apart from some fixes here and there, there are some things that I would live to solve: - I'm not 100% happy with the separation between QCow2ClusterType and QCow2SubclusterType.

Re: [PATCH] hw/ide: Remove status register read side effect

2020-02-22 Thread BALATON Zoltan
On Sat, 22 Feb 2020, jasper.low...@bt.com wrote: I haven't found any documentation that mention that side effect either. As you say, it only mentions that you should set the bit to clear. While the side effect of clearing interrupts by reading the status register doesn't appear to be in

Re: [PATCH 1/2] riscv: roms: Add 32-bit OpenSBI firmware image for sifive_u

2020-02-22 Thread Bin Meng
Hi Philippe, On Fri, Feb 21, 2020 at 4:54 PM Philippe Mathieu-Daudé wrote: > > On 2/21/20 6:54 AM, Anup Patel wrote: > > On Fri, Feb 21, 2020 at 8:08 AM Bin Meng wrote: > >> > >> Hi Philippe, > >> > >> On Fri, Feb 21, 2020 at 1:31 AM Philippe Mathieu-Daudé > >> wrote: > >>> > >>> Hi Bin, > >>>

Re: [PATCH v3 0/3] Dump QCOW2 metadata

2020-02-22 Thread Eric Blake
On 2/20/20 6:28 AM, Kevin Wolf wrote: Am 20.02.2020 um 12:58 hat Max Reitz geschrieben: On 14.01.20 09:22, Andrey Shinkevich wrote: The information about QCOW2 metadata allocations in an image ELF-file is helpful for finding issues with the image data integrity. Sorry that I’m replying only

Re: [PATCH] target: i386: Check float overflow about register stack

2020-02-22 Thread Chen Gang
On 2020/2/22 下午3:37, Paolo Bonzini wrote: > On 22/02/20 03:10, Chen Gang wrote: >> Set C1 to 1 if stack overflow occurred; set to 0 otherwise". >> >> In helper_fxam_ST0, I guess, we need "env->fpus |= 0x200" (but I don't >> know wheter it will be conflict with SIGND(temp)). And we have to still >>

Re: [PATCH] hw/ide: Remove status register read side effect

2020-02-22 Thread BALATON Zoltan
On Sat, 22 Feb 2020, jasper.low...@bt.com wrote: I think the reason why the Solaris 10 driver crashes fatally whereas Linux and OpenBSD ignore the side effect is because when clearing interrupts, Solaris 10 expects the interrupt bit to be set and checks this. Linux and OpenBSD appear to clear it

Re: [PULL 24/31] fuzz: support for fork-based fuzzing.

2020-02-22 Thread Eric Blake
On 2/22/20 2:50 AM, Stefan Hajnoczi wrote: From: Alexander Bulekov fork() is a simple way to ensure that state does not leak in between fuzzing runs. Unfortunately, the fuzzer mutation engine relies on bitmaps which contain coverage information for each fuzzing run, and these bitmaps should be

Re: [PATCH v1 2/2] linux-user/riscv: Update the syscall_nr's to the 5.5 kernel

2020-02-22 Thread Laurent Vivier
Le 21/02/2020 à 00:18, Alistair Francis a écrit : > Signed-off-by: Alistair Francis > --- > linux-user/riscv/syscall_nr.h | 160 +- > 1 file changed, 158 insertions(+), 2 deletions(-) Could you avoid to add blanck lines: this makes review more difficult and patch

[PATCH 3/3] qemu-img: Deprecate use of -b without -F

2020-02-22 Thread Eric Blake
Creating an image that requires format probing of the backing image is inherently unsafe (we've had several CVEs over the years based on probes leaking information to the guest on a subsequent boot). If our probing algorithm ever changes, or if other tools like libvirt determine a different probe

[PATCH 0/3] Tighten qemu-img rules on missing backing format

2020-02-22 Thread Eric Blake
In the past, we have had CVEs caused by qemu probing one image type when an image started out as another but the guest was able to modify content. The solution to those CVEs was to encode backing format information into qcow2, to ensure that once we make a decision, we don't have to probe any

[PATCH 2/3] block: Add support to warn on backing file change without format

2020-02-22 Thread Eric Blake
For now, this is a mechanical addition; all callers pass false. But the next patch will use it to improve 'qemu-img rebase -u' when selecting a backing file with no format. Signed-off-by: Eric Blake --- block.c | 14 +++--- block/qcow2.c | 2 +- block/stream.c

RE: [RFC v3 3/3] ACPI/unit-test: Add a new test for pxb-pcie for arm

2020-02-22 Thread miaoyubo
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Friday, February 21, 2020 7:19 PM > To: miaoyubo > Cc: peter.mayd...@linaro.org; shannon.zha...@gmail.com; Xiexiangyou > ; imamm...@redhat.com; > qemu-devel@nongnu.org > Subject: Re: [RFC v3 3/3]

RE: [RFC v3 2/3] acpi:pci-expender-bus: Add pxb support for arm

2020-02-22 Thread miaoyubo
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Friday, February 21, 2020 7:18 PM > To: miaoyubo > Cc: peter.mayd...@linaro.org; shannon.zha...@gmail.com; Xiexiangyou > ; imamm...@redhat.com; > qemu-devel@nongnu.org > Subject: Re: [RFC v3 2/3]

Re: [PULL 00/31] Block patches

2020-02-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200222085030.1760640-1-stefa...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [PULL 00/31] Block patches Message-id: 20200222085030.1760640-1-stefa...@redhat.com Type: series ===

[PULL 29/31] fuzz: add virtio-net fuzz target

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov The virtio-net fuzz target feeds inputs to all three virtio-net virtqueues, and uses forking to avoid leaking state between fuzz runs. Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi Reviewed-by: Darren Kenny Message-id:

[PULL 26/31] fuzz: add target/fuzz makefile rules

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov Signed-off-by: Alexander Bulekov Reviewed-by: Darren Kenny Reviewed-by: Stefan Hajnoczi Message-id: 20200220041118.23264-18-alx...@bu.edu Signed-off-by: Stefan Hajnoczi --- Makefile| 15 ++- Makefile.target | 16 2 files changed,

[PULL 31/31] fuzz: add documentation to docs/devel/

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi Reviewed-by: Darren Kenny Message-id: 20200220041118.23264-23-alx...@bu.edu Signed-off-by: Stefan Hajnoczi --- docs/devel/fuzzing.txt | 116 + 1 file changed, 116

[PULL 28/31] fuzz: add i440fx fuzz targets

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov These three targets should simply fuzz reads/writes to a couple ioports, but they mostly serve as examples of different ways to write targets. They demonstrate using qtest and qos for fuzzing, as well as using rebooting and forking to reset state, or not resetting it at

[PULL 21/31] fuzz: add fuzzer skeleton

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov tests/fuzz/fuzz.c serves as the entry point for the virtual-device fuzzer. Namely, libfuzzer invokes the LLVMFuzzerInitialize and LLVMFuzzerTestOneInput functions, both of which are defined in this file. This change adds a "FuzzTarget" struct, along with the

[PULL 15/31] libqtest: add a layer of abstraction to send/recv

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov This makes it simple to swap the transport functions for qtest commands to and from the qtest client. For example, now it is possible to directly pass qtest commands to a server handler that exists within the same process, without the standard way of writing to a file

[PULL 25/31] fuzz: add support for qos-assisted fuzz targets

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi Reviewed-by: Darren Kenny Message-id: 20200220041118.23264-17-alx...@bu.edu Signed-off-by: Stefan Hajnoczi --- tests/qtest/fuzz/Makefile.include | 2 + tests/qtest/fuzz/qos_fuzz.c | 234

[PULL 24/31] fuzz: support for fork-based fuzzing.

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov fork() is a simple way to ensure that state does not leak in between fuzzing runs. Unfortunately, the fuzzer mutation engine relies on bitmaps which contain coverage information for each fuzzing run, and these bitmaps should be copied from the child to the parent(where

[PULL 30/31] fuzz: add virtio-scsi fuzz target

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov The virtio-scsi fuzz target sets up and fuzzes the available virtio-scsi queues. After an element is placed on a queue, the fuzzer can select whether to perform a kick, or continue adding elements. Signed-off-by: Alexander Bulekov Reviewed-by: Darren Kenny Message-id:

[PULL 11/31] softmmu: split off vl.c:main() into main.c

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov A program might rely on functions implemented in vl.c, but implement its own main(). By placing main into a separate source file, there are no complaints about duplicate main()s when linking against vl.o. For example, the virtual-device fuzzer uses a main() provided by

[PULL 20/31] libqos: move useful qos-test funcs to qos_external

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov The moved functions are not specific to qos-test and might be useful elsewhere. For example the virtual-device fuzzer makes use of them for qos-assisted fuzz-targets. Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé

[PULL 22/31] exec: keep ram block across fork when using qtest

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov Ram blocks were marked MADV_DONTFORK breaking fuzzing-tests which execute each test-input in a forked process. Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi Reviewed-by: Darren Kenny Message-id: 20200220041118.23264-14-alx...@bu.edu Signed-off-by:

[PULL 18/31] libqos: rename i2c_send and i2c_recv

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov The names i2c_send and i2c_recv collide with functions defined in hw/i2c/core.c. This causes an error when linking against libqos and softmmu simultaneously (for example when using qtest inproc). Rename the libqos functions to avoid this. Signed-off-by: Alexander Bulekov

[PULL 09/31] aio-posix: make AioHandler dispatch O(1) with epoll

2020-02-22 Thread Stefan Hajnoczi
File descriptor monitoring is O(1) with epoll(7), but aio_dispatch_handlers() still scans all AioHandlers instead of dispatching just those that are ready. This makes aio_poll() O(n) with respect to the total number of registered handlers. Add a local ready_list to aio_poll() so that each nested

[PULL 27/31] fuzz: add configure flag --enable-fuzzing

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Darren Kenny Message-id: 20200220041118.23264-19-alx...@bu.edu Signed-off-by: Stefan Hajnoczi --- configure | 39 +++ 1

[PULL 16/31] libqtest: make bufwrite rely on the TransportOps

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov When using qtest "in-process" communication, qtest_sendf directly calls a function in the server (qtest.c). Previously, bufwrite used socket_send, which bypasses the TransportOps enabling the call into qtest.c. This change replaces the socket_send calls with ops->send,

[PULL 17/31] qtest: add in-process incoming command handler

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov The handler allows a qtest client to send commands to the server by directly calling a function, rather than using a file/CharBackend Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi Reviewed-by: Darren Kenny Message-id:

[PULL 23/31] main: keep rcu_atfork callback enabled for qtest

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov The qtest-based fuzzer makes use of forking to reset-state between tests. Keep the callback enabled, so the call_rcu thread gets created within the child process. Signed-off-by: Alexander Bulekov Reviewed-by: Darren Kenny Acked-by: Stefan Hajnoczi Message-id:

[PULL 07/31] qemu/queue.h: add QLIST_SAFE_REMOVE()

2020-02-22 Thread Stefan Hajnoczi
QLIST_REMOVE() assumes the element is in a list. It also leaves the element's linked list pointers dangling. Introduce a safe version of QLIST_REMOVE() and convert open-coded instances of this pattern. Signed-off-by: Stefan Hajnoczi Reviewed-by: Sergio Lopez Message-id:

[PULL 13/31] fuzz: add FUZZ_TARGET module type

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi Reviewed-by: Darren Kenny Message-id: 20200220041118.23264-5-alx...@bu.edu Signed-off-by: Stefan Hajnoczi --- include/qemu/module.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PULL 05/31] aio-posix: fix use after leaving scope in aio_poll()

2020-02-22 Thread Stefan Hajnoczi
epoll_handler is a stack variable and must not be accessed after it goes out of scope: if (aio_epoll_check_poll(ctx, pollfds, npfd, timeout)) { AioHandler epoll_handler; ... add_pollfd(_handler); ret = aio_epoll(ctx, pollfds, npfd, timeout); }

[PULL 19/31] libqos: split qos-test and libqos makefile vars

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov Most qos-related objects were specified in the qos-test-obj-y variable. qos-test-obj-y also included qos-test.o which defines a main(). This made it difficult to repurpose qos-test-obj-y to link anything beside tests/qos-test against libqos. This change separates objects

[PULL 14/31] qtest: add qtest_server_send abstraction

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov qtest_server_send is a function pointer specifying the handler used to transmit data to the qtest client. In the standard configuration, this calls the CharBackend handler, but now it is possible for other types of handlers, e.g direct-function calls if the qtest client

[PULL 12/31] module: check module wasn't already initialized

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov The virtual-device fuzzer must initialize QOM, prior to running vl:qemu_init, so that it can use the qos_graph to identify the arguments required to initialize a guest for libqos-assisted fuzzing. This change prevents errors when vl:qemu_init tries to (re)initialize the

[PULL 03/31] rcu_queue: add QSLIST functions

2020-02-22 Thread Stefan Hajnoczi
From: Paolo Bonzini QSLIST is the only family of lists for which we do not have RCU-friendly accessors, add them. Signed-off-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Message-id: 20200220103828.24525-1-pbonz...@redhat.com Signed-off-by: Stefan Hajnoczi --- include/qemu/queue.h |

[PULL 08/31] aio-posix: make AioHandler deletion O(1)

2020-02-22 Thread Stefan Hajnoczi
It is not necessary to scan all AioHandlers for deletion. Keep a list of deleted handlers instead of scanning the full list of all handlers. The AioHandler->deleted field can be dropped. Let's check if the handler has been inserted into the deleted list instead. Add a new QLIST_IS_INSERTED()

[PULL 10/31] softmmu: move vl.c to softmmu/

2020-02-22 Thread Stefan Hajnoczi
From: Alexander Bulekov Move vl.c to a separate directory, similar to linux-user/ Update the chechpatch and get_maintainer scripts, since they relied on /vl.c for top_of_tree checks. Signed-off-by: Alexander Bulekov Reviewed-by: Darren Kenny Message-id: 20200220041118.23264-2-alx...@bu.edu

[PULL 06/31] aio-posix: don't pass ns timeout to epoll_wait()

2020-02-22 Thread Stefan Hajnoczi
Don't pass the nanosecond timeout into epoll_wait(), which expects milliseconds. The epoll_wait() timeout value does not matter if qemu_poll_ns() determined that the poll fd is ready, but passing a value in the wrong units is still ugly. Pass a 0 timeout to epoll_wait() instead. Signed-off-by:

[PULL 00/31] Block patches

2020-02-22 Thread Stefan Hajnoczi
The following changes since commit 9ac5df20f51fabcba0d902025df4bd7ea987c158: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200221-1' into staging (2020-02-21 16:18:38 +) are available in the Git repository at: https://github.com/stefanha/qemu.git

[PULL 01/31] virtio: increase virtqueue size for virtio-scsi and virtio-blk

2020-02-22 Thread Stefan Hajnoczi
From: Denis Plotnikov The goal is to reduce the amount of requests issued by a guest on 1M reads/writes. This rises the performance up to 4% on that kind of disk access pattern. The maximum chunk size to be used for the guest disk accessing is limited with seg_max parameter, which represents

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

2020-02-22 Thread Stefan Hajnoczi
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 that only scheduled or deleted BHs are enqueued. Only BHs that

[PULL 02/31] aio-posix: avoid reacquiring rcu_read_lock() when polling

2020-02-22 Thread Stefan Hajnoczi
The first rcu_read_lock/unlock() is expensive. Nested calls are cheap. This optimization increases IOPS from 73k to 162k with a Linux guest that has 2 virtio-blk,num-queues=1 and 99 virtio-blk,num-queues=32 devices. Signed-off-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini Message-id:

Re: [PATCH v7 01/11] qapi/error: add (Error **errp) cleaning APIs

2020-02-22 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > 21.02.2020 19:34, Markus Armbruster wrote: >> Vladimir Sementsov-Ogievskiy writes: >> >>> 21.02.2020 10:38, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: > Add functions to clean Error **errp: call corresponding Error *err

Re: [RFC v3.1 00/22] intel_iommu: expose Shared Virtual Addressing to VMs

2020-02-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/1582358843-51931-1-git-send-email-yi.l@intel.com/ Hi, This series failed the docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST

[RFC v3.1 12/22] intel_iommu: add PASID cache management infrastructure

2020-02-22 Thread Liu Yi L
This patch adds a PASID cache management infrastructure based on new added structure VTDPASIDAddressSpace, which is used to track the PASID usage and future PASID tagged DMA address translation support in vIOMMU. struct VTDPASIDAddressSpace { VTDBus *vtd_bus; uint8_t devfn;

[RFC v3.1 20/22] intel_iommu: propagate PASID-based iotlb invalidation to host

2020-02-22 Thread Liu Yi L
This patch propagates PASID-based iotlb invalidation to host. Intel VT-d 3.0 supports nested translation in PASID granular. Guest SVA support could be implemented by configuring nested translation on specific PASID. This is also known as dual stage DMA translation. Under such configuration,

[RFC v3.1 14/22] intel_iommu: bind/unbind guest page table to host

2020-02-22 Thread Liu Yi L
This patch captures the guest PASID table entry modifications and propagates the changes to host to setup dual stage DMA translation. The guest page table is configured as 1st level page table (GVA->GPA) whose translation result would further go through host VT-d 2nd level page table(GPA->HPA)

[RFC v3.1 18/22] vfio/common: add support for flush iommu stage-1 cache

2020-02-22 Thread Liu Yi L
This patch adds flush_stage1_cache() definition in HostIOMMUOps. And adds corresponding implementation in VFIO. This is to expose a way for vIOMMU to flush stage-1 cache in host side since guest owns stage-1 translation structures in dual stage DMA translation. Cc: Kevin Tian Cc: Jacob Pan Cc:

[RFC v3.1 15/22] intel_iommu: replay guest pasid bindings to host

2020-02-22 Thread Liu Yi L
This patch adds guest pasid bindings replay for domain selective pasid cache invalidation(dsi) and global pasid cache invalidation by walking guest pasid table. Reason: Guest OS may flush the pasid cache with a larger granularity. e.g. guest does a svm_bind() but flush the pasid cache with global

[RFC v3.1 04/22] hw/iommu: introduce HostIOMMUContext

2020-02-22 Thread Liu Yi L
Currently, many platform vendors provide the capability of dual stage DMA address translation in hardware. For example, nested translation on Intel VT-d scalable mode, nested stage translation on ARM SMMUv3, and etc. In dual stage DMA address translation, there are two stages address translation,

[RFC v3.1 06/22] vfio/pci: init HostIOMMUContext per-container

2020-02-22 Thread Liu Yi L
After confirming dual stage DMA translation support with kernel by checking VFIO_TYPE1_NESTING_IOMMU, VFIO inits HostIOMMUContet instance and exposes it to PCI layer. Thus vIOMMU emualtors may make use of such capability by leveraging the ops provided by HostIOMMUContext. Cc: Kevin Tian Cc:

[RFC v3.1 02/22] header file update VFIO/IOMMU vSVA APIs

2020-02-22 Thread Liu Yi L
The kernel uapi/linux/iommu.h header file includes the extensions for vSVA support. e.g. bind gpasid, iommu fault report related user structures and etc. Note: this should be replaced with a full header files update when the vSVA uPAPI is stable. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc:

[RFC v3.1 19/22] intel_iommu: process PASID-based iotlb invalidation

2020-02-22 Thread Liu Yi L
This patch adds the basic PASID-based iotlb (piotlb) invalidation support. piotlb is used during walking Intel VT-d 1st level page table. This patch only adds the basic processing. Detailed handling will be added in next patch. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo

[RFC v3.1 13/22] vfio: add bind stage-1 page table support

2020-02-22 Thread Liu Yi L
This patch adds bind_stage1_pgtbl() definition in HostIOMMUOops, also adds corresponding implementation in VFIO. This is to expose a way for vIOMMU to setup dual stage DMA translation for passthru devices on hardware. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Eric Auger Cc: Yi Sun Cc:

[RFC v3.1 10/22] intel_iommu: add virtual command capability support

2020-02-22 Thread Liu Yi L
This patch adds virtual command support to Intel vIOMMU per Intel VT-d 3.1 spec. And adds two virtual commands: allocate pasid and free pasid. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Peter Xu

[RFC v3.1 07/22] vfio: get nesting iommu cap info from Kernel

2020-02-22 Thread Liu Yi L
VFIO exposes host IOMMU dual-stage DMA translation programming capability to userspace by VFIO_TYPE1_NESTING_IOMMU type. However, userspace needs more info on the nesting type. e.g. the supported stage 1 format and PASID alloc/free request availability. This patch gets the iommu nesting cap info

[RFC v3.1 11/22] intel_iommu: process pasid cache invalidation

2020-02-22 Thread Liu Yi L
This patch adds PASID cache invalidation handling. When guest enabled PASID usages (e.g. SVA), guest software should issue a proper PASID cache invalidation when caching-mode is exposed. This patch only adds the draft handling of pasid cache invalidation. Detailed handling will be added in

[RFC v3.1 21/22] intel_iommu: process PASID-based Device-TLB invalidation

2020-02-22 Thread Liu Yi L
This patch adds an empty handling for PASID-based Device-TLB invalidation. For now it is enough as it is not necessary to propagate it to host for passthru device and also there is no emulated device has device tlb. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Cc: Paolo Bonzini Cc:

[RFC v3.1 22/22] intel_iommu: modify x-scalable-mode to be string option

2020-02-22 Thread Liu Yi L
Intel VT-d 3.0 introduces scalable mode, and it has a bunch of capabilities related to scalable mode translation, thus there are multiple combinations. While this vIOMMU implementation wants simplify it for user by providing typical combinations. User could config it by "x-scalable-mode" option.

[RFC v3.1 00/22] intel_iommu: expose Shared Virtual Addressing to VMs

2020-02-22 Thread Liu Yi L
Shared Virtual Addressing (SVA), a.k.a, Shared Virtual Memory (SVM) on Intel platforms allows address space sharing between device DMA and applications. SVA can reduce programming complexity and enhance security. This QEMU series is intended to expose SVA usage to VMs. i.e. Sharing guest

  1   2   >