Re: [virtio-comment] [RFC] ivshmem v2: Shared memory device specification

2020-07-22 Thread Stefan Hajnoczi
On Fri, Jul 17, 2020 at 06:15:58PM +0200, Jan Kiszka wrote: > On 15.07.20 15:27, Stefan Hajnoczi wrote: > > On Mon, May 25, 2020 at 09:58:28AM +0200, Jan Kiszka wrote: Thanks for the responses. It would be great to update the spec with these clarifications. > > > If BAR 2 is not present, the shar

Re: [PATCH 0/2] virtio: non-legacy device handling

2020-07-22 Thread Cornelia Huck
On Mon, 20 Jul 2020 11:54:06 +0200 Halil Pasic wrote: > On Tue, 7 Jul 2020 12:54:44 +0200 > Cornelia Huck wrote: > > > As discussed in "virtio-fs: force virtio 1.x usage", it seems like > > a good idea to make sure that any new virtio device (which does not > > support legacy virtio) is indeed

Re: [PATCH 0/2] virtio: non-legacy device handling

2020-07-22 Thread Cornelia Huck
On Mon, 20 Jul 2020 11:07:51 +0200 David Hildenbrand wrote: > On 20.07.20 11:03, Michael S. Tsirkin wrote: > > On Mon, Jul 20, 2020 at 10:09:57AM +0200, David Hildenbrand wrote: > >> On 07.07.20 12:54, Cornelia Huck wrote: > >>> As discussed in "virtio-fs: force virtio 1.x usage", it seems li

Re: please try to avoid sending pullreqs late on release-candidate day

2020-07-22 Thread Markus Armbruster
Alex Bennée writes: > Kevin Wolf writes: > >> Am 21.07.2020 um 17:56 hat Peter Maydell geschrieben: >>> It is not helpful if everybody sends their pullrequests late >>> on the Tuesday afternoon, as there just isn't enough time in the >>> day to merge test and apply them all before I have to cut

Re: [PATCH v4 3/8] s390/sclp: rework sclp boundary and length checks

2020-07-22 Thread Cornelia Huck
On Tue, 21 Jul 2020 14:40:14 -0400 Collin Walling wrote: > On 7/21/20 4:41 AM, David Hildenbrand wrote: > > The options I would support are > > > > 1. "sccb_boundary_is_valid" which returns "true" if valid > > 2. "sccb_boundary_is_invalid" which returns "true" if invalid > > 3. "sccb_boundary_v

Re: [PATCH 1/2] configure: avx2 and avx512f detection for clang

2020-07-22 Thread Thomas Huth
On 23/07/2020 08.04, Shu-Chun Weng wrote: > Do we have the flexibility to do that for util/bufferiszero.c as well? > Otherwise, we are using different mechanisms to detect (compile test.c > with -mavx2) and actually use (GCC pragma & __attribute__((target(*) > the feature in production. That's

Re: [PATCH 1/2] configure: avx2 and avx512f detection for clang

2020-07-22 Thread Shu-Chun Weng
Do we have the flexibility to do that for util/bufferiszero.c as well? Otherwise, we are using different mechanisms to detect (compile test.c with -mavx2) and actually use (GCC pragma & __attribute__((target(*) the feature in production. Shu-Chun On Wed, Jul 22, 2020 at 9:55 PM Thomas Huth w

Re: [Bug 1888606] [NEW] Heap-use-after-free in virtio_gpu_ctrl_response

2020-07-22 Thread Li Qiang
Alexander Bulekov <1888...@bugs.launchpad.net> 于2020年7月23日周四 下午1:02写道: > > Public bug reported: > > Hello, > Here is a reproducer (build with --enable-sanitizers): > cat << EOF | ./i386-softmmu/qemu-system-i386 -nographic -M pc -nodefaults -m > 512M -device virtio-vga -qtest stdio > outl 0xcf8 0x8

[Bug 1888606] [NEW] Heap-use-after-free in virtio_gpu_ctrl_response

2020-07-22 Thread Alexander Bulekov
Public bug reported: Hello, Here is a reproducer (build with --enable-sanitizers): cat << EOF | ./i386-softmmu/qemu-system-i386 -nographic -M pc -nodefaults -m 512M -device virtio-vga -qtest stdio outl 0xcf8 0x80001018 outl 0xcfc 0xe080 outl 0xcf8 0x80001020 outl 0xcf8 0x80001004 outw 0xcfc 0

Re: [PATCH 1/2] configure: avx2 and avx512f detection for clang

2020-07-22 Thread Thomas Huth
On 23/07/2020 02.27, Shu-Chun Weng wrote: > Since clang does not support "#pragma GCC", the instruction sets are > always disabled. In this change, we > > 1. wrap "#pragma GCC" inside "#ifndef __clang__", > 2. only retain them around "#include <{e,i,s}mmintrin.h>" to work > around gcc bug, >

Re: [PATCH for-5.1] hw: Only compile the usb-dwc2 controller if it is really needed

2020-07-22 Thread Paul Zimmerman
Gerd, it's OK by me if you take Thomas's patch instead, I agree the changelog is better. It also has a fixes tag. Reviewed-by: Paul Zimmerman On Wed, Jul 22, 2020 at 9:29 PM Thomas Huth wrote: > On 22/07/2020 19.23, Philippe Mathieu-Daudé wrote: > > On 7/22/20 5:47 PM, Thomas Huth wrote: > >>

Re: [PATCH for-5.1] hw: Only compile the usb-dwc2 controller if it is really needed

2020-07-22 Thread Thomas Huth
On 22/07/2020 19.23, Philippe Mathieu-Daudé wrote: > On 7/22/20 5:47 PM, Thomas Huth wrote: >> The USB_DWC2 switch is currently "default y", so it is included in all >> qemu-system-* builds, even if it is not needed. Even worse, it does a >> "select USB", so USB devices are now showing up as availa

Re: [PATCH v2] virtio-balloon: always indicate S_DONE when migration fails

2020-07-22 Thread Michael S. Tsirkin
On Wed, Jul 22, 2020 at 02:11:52PM +0200, David Hildenbrand wrote: > On 22.07.20 14:05, David Hildenbrand wrote: > > On 22.07.20 14:04, Michael S. Tsirkin wrote: > >> On Mon, Jun 29, 2020 at 10:06:15AM +0200, David Hildenbrand wrote: > >>> If something goes wrong during precopy, before stopping the

Re: [PATCH] Fix vhost-user buffer over-read on ram hot-unplug

2020-07-22 Thread Raphael Norwitz
ping On Thu, Jul 16, 2020 at 10:21 PM Raphael Norwitz wrote: > > The VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS vhost-user protocol > feature introduced a shadow-table, used by the backend to dynamically > determine how a vdev's memory regions have changed since the last > vhost_user_set_mem_tabl

Re: [PATCH v2] virtio-balloon: always indicate S_DONE when migration fails

2020-07-22 Thread Michael S. Tsirkin
On Wed, Jul 22, 2020 at 02:05:19PM +0200, David Hildenbrand wrote: > On 22.07.20 14:04, Michael S. Tsirkin wrote: > > On Mon, Jun 29, 2020 at 10:06:15AM +0200, David Hildenbrand wrote: > >> If something goes wrong during precopy, before stopping the VM, we will > >> never send a S_DONE indication t

[PATCH 00/12] Add a General Virtual Device Fuzzer

2020-07-22 Thread Alexander Bulekov
This is a general virtual-device fuzzer, designed to fuzz devices over Port IO, MMIO, and DMA. To get started with this: 1. Build the fuzzers (see docs/devel/fuzzing.txt) Note: Build with --enable-sanitizers, or create a "dictionary file": echo kw1=\"\x84\x05\x5C\x5E\" > dict and pass

[Bug 1888601] [NEW] QEMU v5.1.0-rc0/rc1 hang with nested virtualization

2020-07-22 Thread Simon Kaegi
Public bug reported: We're running Kata Containers using QEMU and with v5.1.0rc0 and rc1 have noticed a problem at startup where QEMu appears to hang. We are not seeing this problem on our bare metal nodes and only on a VSI that supports nested virtualization. We unfortunately see nothing at all

[PATCH 12/12] scripts/oss-fuzz: Add crash trace minimization script

2020-07-22 Thread Alexander Bulekov
Once we find a crash, we can convert it into a QTest trace. Usually this trace will contain many operations that are unneeded to reproduce the crash. This script tries to minimize the crashing trace, by removing operations and trimming QTest bufwrite(write addr len data...) commands. Signed-off-by

[PATCH 11/12] scripts/oss-fuzz: Add script to reorder a general-fuzzer trace

2020-07-22 Thread Alexander Bulekov
The general-fuzzer uses hooks to fulfill DMA requests just-in-time. This means that if we try to use QTEST_LOG=1 to build a reproducer, the DMA writes will be logged _after_ the in/out/read/write that triggered the DMA read. To work work around this, the general-fuzzer annotates these just-in time

[PATCH 04/12] fuzz: Add DMA support to the generic-fuzzer

2020-07-22 Thread Alexander Bulekov
When a virtual-device tries to access some buffer in memory over DMA, we add call-backs into the fuzzer(next commit). The fuzzer checks verifies that the DMA request maps to a physical RAM address and fills the memory with fuzzer-provided data. The patterns that we use to fill this memory are speci

[PATCH 10/12] scripts/oss-fuzz: build the general-fuzzer configs

2020-07-22 Thread Alexander Bulekov
Build general-fuzzer wrappers for each configuration defined in general_fuzzer_configs.yml and move the actual general-fuzzer to a subdirectory, so oss-fuzz doesn't treat it as a standalone fuzzer. Signed-off-by: Alexander Bulekov --- scripts/oss-fuzz/build.sh | 8 +++- 1 file changed, 7 ins

[PATCH 09/12] scripts/oss-fuzz: Add general-fuzzer configs for oss-fuzz

2020-07-22 Thread Alexander Bulekov
Each of these entries is built into a wrapper binary that sets the needed environment variables and executes the general virtual-device fuzzer. In the future, we will need additional fields, such as arch=arm, timeout_per_testcase=0, reset=reboot, etc... Signed-off-by: Alexander Bulekov --- scrip

[PATCH 06/12] fuzz: Add fuzzer callbacks to DMA-read functions

2020-07-22 Thread Alexander Bulekov
We should be careful to not call any functions besides fuzz_dma_read_cb. Without --enable-fuzzing, fuzz_dma_read_cb is an empty inlined function. Signed-off-by: Alexander Bulekov --- I'd appreciate another set of eyes on this. Basically, we only care about DMA reads to RAM. This is why I assume s

[PATCH 03/12] fuzz: Add PCI features to the general fuzzer

2020-07-22 Thread Alexander Bulekov
This patch compares TYPE_PCI_DEVICE objects against the user-provided matching pattern. If there is a match, we use some hacks and leverage QOS to map each possible BAR for that device. Now fuzzed inputs might be converted to pci_read/write commands which target specific. This means that we can fuz

[PATCH 07/12] scripts/oss-fuzz: Add wrapper program for generic fuzzer

2020-07-22 Thread Alexander Bulekov
On oss-fuzz we need some sort of wrapper to specify command-line arguments or environment variables. When we had a similar problem with other targets that I fixed with 05509c8e6d ("fuzz: select fuzz target using executable name") by selecting the fuzz target based on the executable's name. In the f

[PATCH 08/12] scripts/oss-fuzz: Add general-fuzzer build script

2020-07-22 Thread Alexander Bulekov
This parses a yaml file containing general-fuzzer configs and builds a separate oss-fuzz wrapper binary for each one, changing some preprocessor macros for each configuration. To avoid dealing with escaping and stringifying, convert each string into a byte-array representation Signed-off-by: Alexa

[PATCH 05/12] fuzz: Declare DMA Read callback function

2020-07-22 Thread Alexander Bulekov
This patch declares the fuzz_dma_read_cb function and uses the preprocessor and linker(weak symbols) to handle these cases: When we build softmmu/all with --enable-fuzzing, there should be no strong symbol defined for fuzz_dma_read_cb, and we link against a weak stub function. When we build softm

[PATCH 02/12] fuzz: Add general virtual-device fuzzer

2020-07-22 Thread Alexander Bulekov
This is a generic fuzzer designed to fuzz a virtual device's MemoryRegions, as long as they exist within the Memory or Port IO (if it exists) AddressSpaces. The fuzzer's input is interpreted into a sequence of qtest commands (outb, readw, etc). The interpreted commands are separated by a magic seap

[PATCH 01/12] fuzz: Change the way we write qtest log to stderr

2020-07-22 Thread Alexander Bulekov
Telling QTest to log to /dev/fd/2, essentially results in dup(2). This is fine, if other code isn't logging to stderr. Otherwise, the order of the logs is mixed due to buffering issues, since two file-descriptors are used to write to the same file. We can avoid this, since just specifying "-qtest"

Re: [PATCH v3 1/8] target/arm: Move start-powered-off property to generic CPUState

2020-07-22 Thread Thiago Jung Bauermann
David Gibson writes: > On Wed, Jul 22, 2020 at 11:56:50PM -0300, Thiago Jung Bauermann wrote: >> There are other platforms which also have CPUs that start powered off, so >> generalize the start-powered-off property so that it can be used by them. >> >> Note that ARMv7MState also has a propert

Re: [PATCH v3 3/3] target/riscv: Fix the translation of physical address

2020-07-22 Thread Zong Li
On Wed, Jul 22, 2020 at 5:08 PM Alexander Richardson wrote: > > On Tue, 21 Jul 2020 at 13:43, Zong Li wrote: > > > > The real physical address should add the 12 bits page offset. It also > > causes the PMP wrong checking due to the minimum granularity of PMP is > > 4 byte, but we always get the p

Re: [PATCH v3 2/3] target/riscv/pmp.c: Fix the index offset on RV64

2020-07-22 Thread Zong Li
On Wed, Jul 22, 2020 at 12:58 PM Bin Meng wrote: > > Hi Zong, > > On Tue, Jul 21, 2020 at 8:41 PM Zong Li wrote: > > > > On RV64, the reg_index is 2 (pmpcfg2 CSR) after the seventh pmp > > entry, it is not 1 (pmpcfg1 CSR) like RV32. In the original > > implementation, the second parameter of pmp_

Re: [PATCH v2 1/9] target/arm: Move start-powered-off property to generic CPUState

2020-07-22 Thread Thiago Jung Bauermann
Hello David, David Gibson writes: > On Wed, Jul 22, 2020 at 12:50:08AM -0300, Thiago Jung Bauermann wrote: >> There are other platforms which also have CPUs that start powered off, so >> generalize the start-powered-off property so that it can be used by them. >> >> Note that ARMv7MState also

Re: [PATCH v3 1/8] target/arm: Move start-powered-off property to generic CPUState

2020-07-22 Thread David Gibson
On Wed, Jul 22, 2020 at 11:56:50PM -0300, Thiago Jung Bauermann wrote: > There are other platforms which also have CPUs that start powered off, so > generalize the start-powered-off property so that it can be used by them. > > Note that ARMv7MState also has a property of the same name but this pat

Re: [PATCH v3 5/8] mips/cps: Use start-powered-off CPUState property

2020-07-22 Thread David Gibson
On Wed, Jul 22, 2020 at 11:56:54PM -0300, Thiago Jung Bauermann wrote: > Instead of setting CPUState::halted to 1 in main_cpu_reset(), use the > start-powered-off property which makes cpu_common_reset() initialize it > to 1 in common code. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by:

Re: [PATCH v3 7/8] sparc/sun4m: Use start-powered-off CPUState property

2020-07-22 Thread David Gibson
On Wed, Jul 22, 2020 at 11:56:56PM -0300, Thiago Jung Bauermann wrote: > Instead of setting CPUState::halted to 1 in secondary_cpu_reset(), use the > start-powered-off property which makes cpu_common_reset() initialize it > to 1 in common code. > > This makes secondary_cpu_reset() unnecessary, so

Re: [PATCH v3 6/8] sparc/sun4m: Remove main_cpu_reset()

2020-07-22 Thread David Gibson
On Wed, Jul 22, 2020 at 11:56:55PM -0300, Thiago Jung Bauermann wrote: > We rely on cpu_common_reset() to set cs->halted to 0, so main_cpu_reset() > is pointless. > > Suggested-by: Philippe Mathieu-Daudé > Signed-off-by: Thiago Jung Bauermann Revieed-by: David Gibson > --- > hw/sparc/sun4m.c

Re: [PATCH v3 3/8] ppc/spapr: Use start-powered-off CPUState property

2020-07-22 Thread David Gibson
On Wed, Jul 22, 2020 at 11:56:52PM -0300, Thiago Jung Bauermann wrote: 65;6003;1c> PowerPC sPAPR CPUs start in the halted state, and spapr_reset_vcpu() > attempts to implement this by setting CPUState::halted to 1. But that's too > late for the case of hotplugged CPUs in a machine configure with 2

Re: [PATCH v3 4/8] ppc/e500: Use start-powered-off CPUState property

2020-07-22 Thread David Gibson
On Wed, Jul 22, 2020 at 11:56:53PM -0300, Thiago Jung Bauermann wrote: > Instead of setting CPUState::halted to 1 in ppce500_cpu_reset_sec(), use > the start-powered-off property which makes cpu_common_reset() initialize it > to 1 in common code. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-o

Re: [PATCH v3 2/8] target/arm: Move setting of CPU halted state to generic code

2020-07-22 Thread David Gibson
On Wed, Jul 22, 2020 at 11:56:51PM -0300, Thiago Jung Bauermann wrote: > This change is in a separate patch because it's not so obvious that it > won't cause a regression. > > Suggested-by: Eduardo Habkost > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Thiago Jung Bauermann Reviewed-by

[PATCH v3 7/8] sparc/sun4m: Use start-powered-off CPUState property

2020-07-22 Thread Thiago Jung Bauermann
Instead of setting CPUState::halted to 1 in secondary_cpu_reset(), use the start-powered-off property which makes cpu_common_reset() initialize it to 1 in common code. This makes secondary_cpu_reset() unnecessary, so remove it. Also remove setting of cs->halted from cpu_devinit(), which seems out

[PATCH v3 6/8] sparc/sun4m: Remove main_cpu_reset()

2020-07-22 Thread Thiago Jung Bauermann
We rely on cpu_common_reset() to set cs->halted to 0, so main_cpu_reset() is pointless. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Thiago Jung Bauermann --- hw/sparc/sun4m.c | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) NB: I was only able to test that this patch

[RFC PATCH v3 8/8] target/s390x: Use start-powered-off CPUState property

2020-07-22 Thread Thiago Jung Bauermann
Instead of setting CPUState::halted to 1 in s390_cpu_initfn(), use the start-powered-off property which makes cpu_common_reset() initialize it to 1 in common code. Note that this changes behavior by setting cs->halted to 1 on reset, which didn't happen before. Signed-off-by: Thiago Jung Bauermann

[PATCH v3 3/8] ppc/spapr: Use start-powered-off CPUState property

2020-07-22 Thread Thiago Jung Bauermann
PowerPC sPAPR CPUs start in the halted state, and spapr_reset_vcpu() attempts to implement this by setting CPUState::halted to 1. But that's too late for the case of hotplugged CPUs in a machine configure with 2 or more threads per core. By then, other parts of QEMU have already caused the vCPU to

[PATCH v3 4/8] ppc/e500: Use start-powered-off CPUState property

2020-07-22 Thread Thiago Jung Bauermann
Instead of setting CPUState::halted to 1 in ppce500_cpu_reset_sec(), use the start-powered-off property which makes cpu_common_reset() initialize it to 1 in common code. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thiago Jung Bauermann --- hw/ppc/e500.c | 10 +++--- 1 file changed, 7

[PATCH v3 0/8] Generalize start-powered-off property from ARM

2020-07-22 Thread Thiago Jung Bauermann
The ARM code has a start-powered-off property in ARMCPU, which is a subclass of CPUState. This property causes arm_cpu_reset() to set CPUState::halted to 1, signalling that the CPU should start in a halted state. Other architectures also have code which aim to achieve the same effect, but without u

[PATCH v3 5/8] mips/cps: Use start-powered-off CPUState property

2020-07-22 Thread Thiago Jung Bauermann
Instead of setting CPUState::halted to 1 in main_cpu_reset(), use the start-powered-off property which makes cpu_common_reset() initialize it to 1 in common code. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thiago Jung Bauermann --- hw/mips/cps.c | 6 +++--- 1 file changed, 3 insertions(

[PATCH v3 1/8] target/arm: Move start-powered-off property to generic CPUState

2020-07-22 Thread Thiago Jung Bauermann
There are other platforms which also have CPUs that start powered off, so generalize the start-powered-off property so that it can be used by them. Note that ARMv7MState also has a property of the same name but this patch doesn't change it because that class isn't a subclass of CPUState so it woul

[PATCH v3 2/8] target/arm: Move setting of CPU halted state to generic code

2020-07-22 Thread Thiago Jung Bauermann
This change is in a separate patch because it's not so obvious that it won't cause a regression. Suggested-by: Eduardo Habkost Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thiago Jung Bauermann --- hw/core/cpu.c| 2 +- target/arm/cpu.c | 1 - 2 files changed, 1 insertion(+), 2 deleti

Re: [PATCH 2/2] e1000e: make TX reentrant

2020-07-22 Thread Jason Wang
On 2020/7/22 下午8:53, Michael Tokarev wrote: FWIW, this is not "making TX reentrant", it is about forbidding reentrancy instead :) /mjt Indeed, I will rename the title. Thanks

Re: [PATCH 2/2] e1000e: make TX reentrant

2020-07-22 Thread Jason Wang
On 2020/7/22 下午7:24, Li Qiang wrote: Jason Wang 于2020年7月22日周三 下午4:58写道: In loopback mode, e1000e RX can DMA into TX doorbell which requires TX to be reentrant. This patch make e1000e's TX routine reentrant by introducing a per device boolean for recording whether or not a TX rountine is being

Re: [RFC v2 16/76] target/riscv: rvv-0.9: add VMA and VTA

2020-07-22 Thread Frank Chang
On Thu, Jul 23, 2020 at 2:00 AM Richard Henderson < richard.hender...@linaro.org> wrote: > On 7/22/20 2:15 AM, frank.ch...@sifive.com wrote: > > -static void vext_clear(void *tail, uint32_t cnt, uint32_t tot) > > +static void vext_clear(void *tail, uint32_t vta, uint32_t cnt, uint32_t > tot) > >

Re: [RFC v2 15/76] target/riscv: rvv-0.9: add fractional LMUL

2020-07-22 Thread Frank Chang
On Thu, Jul 23, 2020 at 1:30 AM Richard Henderson < richard.hender...@linaro.org> wrote: > On 7/22/20 2:15 AM, frank.ch...@sifive.com wrote: > > FIELD(VTYPE, VLMUL, 0, 2) > > FIELD(VTYPE, VSEW, 2, 3) > > -FIELD(VTYPE, VEDIV, 5, 2) > > -FIELD(VTYPE, RESERVED, 7, sizeof(target_ulong) * 8 - 9) > >

Re: [PATCH] hw/misc/edu: support pci device state migration

2020-07-22 Thread Zeng Guang
On 7/22/2020 4:37 PM, Peter Maydell wrote: On Wed, 22 Jul 2020 at 09:31, Zeng Guang wrote: Currently edu device doesn't support live migration. Part of PCI configuration information would be lost after migration. PCI device state in source VM: Bus 0, device 3, function 0: Class

Re: [PATCH v2 4/9] ppc/e500: Use start-powered-off CPUState property

2020-07-22 Thread David Gibson
On Wed, Jul 22, 2020 at 12:50:11AM -0300, Thiago Jung Bauermann wrote: > Instead of setting CPUState::halted to 1 in ppce500_cpu_reset_sec(), use > the start-powered-off property which makes cpu_common_reset() initialize it > to 1 in common code. > > Signed-off-by: Thiago Jung Bauermann Reviewed

Re: [PATCH v2 2/9] target/arm: Move setting of CPU halted state to generic code

2020-07-22 Thread David Gibson
On Wed, Jul 22, 2020 at 12:50:09AM -0300, Thiago Jung Bauermann wrote: > This change is in a separate patch because it's not so obvious that it > won't cause a regression. > > Suggested-by: Eduardo Habkost > Signed-off-by: Thiago Jung Bauermann Reviewed-by: David Gibson > --- > hw/core/cpu.c

Re: [PATCH v2 5/9] mips/cps: Use start-powered-off CPUState property

2020-07-22 Thread David Gibson
On Wed, Jul 22, 2020 at 12:50:12AM -0300, Thiago Jung Bauermann wrote: > Instead of setting CPUState::halted to 1 in main_cpu_reset(), use the > start-powered-off property which makes cpu_common_reset() initialize it > to 1 in common code. > > Signed-off-by: Thiago Jung Bauermann Reviewed-by: Da

Re: [PATCH v2 1/9] target/arm: Move start-powered-off property to generic CPUState

2020-07-22 Thread David Gibson
On Wed, Jul 22, 2020 at 12:50:08AM -0300, Thiago Jung Bauermann wrote: > There are other platforms which also have CPUs that start powered off, so > generalize the start-powered-off property so that it can be used by them. > > Note that ARMv7MState also has a property of the same name but this pat

Re: [PATCH v2 6/9] sparc/sun4m: Use start-powered-off CPUState property

2020-07-22 Thread David Gibson
On Wed, Jul 22, 2020 at 12:50:13AM -0300, Thiago Jung Bauermann wrote: > Instead of setting CPUState::halted to 1 in secondary_cpu_reset(), use the > start-powered-off property which makes cpu_common_reset() initialize it > to 1 in common code. > > Signed-off-by: Thiago Jung Bauermann Reviewed-b

Re: [PATCH] ppc/xive: Fix some typos in comments

2020-07-22 Thread David Gibson
On Wed, Jul 22, 2020 at 07:43:54PM -0400, Gustavo Romero wrote: > Fix some typos in comments about code modeling coalescing points in the > XIVE routing engine (IVRE). > > Signed-off-by: Gustavo Romero Applied to ppc-for-5.2. > --- > hw/intc/xive.c | 6 +++--- > 1 file changed, 3 insertions(+)

Re: [RFC PATCH v2 9/9] target/s390x: Use start-powered-off CPUState property

2020-07-22 Thread Thiago Jung Bauermann
Eduardo Habkost writes: > On Wed, Jul 22, 2020 at 12:50:16AM -0300, Thiago Jung Bauermann wrote: >> Instead of setting CPUState::halted to 1 in s390_cpu_initfn(), use the >> start-powered-off property which makes cpu_common_reset() initialize it to >> 1 in common code. >> >> Signed-off-by: Thia

Re: [RFC PATCH v2 9/9] target/s390x: Use start-powered-off CPUState property

2020-07-22 Thread Thiago Jung Bauermann
Philippe Mathieu-Daudé writes: > On 7/22/20 5:50 AM, Thiago Jung Bauermann wrote: >> Instead of setting CPUState::halted to 1 in s390_cpu_initfn(), use the >> start-powered-off property which makes cpu_common_reset() initialize it to >> 1 in common code. >> >> Signed-off-by: Thiago Jung Bauerm

Re: [RFC PATCH v2 8/9] sparc/sun4m: Use one cpu_reset() function for main and secondary CPUs

2020-07-22 Thread Thiago Jung Bauermann
Philippe Mathieu-Daudé writes: > On 7/22/20 5:50 AM, Thiago Jung Bauermann wrote: >> If we rely on cpu_common_reset() setting CPUState::halted according to the >> start-powered-off property, both reset functions become equivalent and we >> can use only one. >> >> Signed-off-by: Thiago Jung Baue

[PATCH] ppc/xive: Fix some typos in comments

2020-07-22 Thread Gustavo Romero
Fix some typos in comments about code modeling coalescing points in the XIVE routing engine (IVRE). Signed-off-by: Gustavo Romero --- hw/intc/xive.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/intc/xive.c b/hw/intc/xive.c index 9a16243..9b55e03 100644 --- a/hw/in

Re: [RFC PATCH v2 7/9] sparc/sun4m: Don't set CPUState::halted in cpu_devinit()

2020-07-22 Thread Thiago Jung Bauermann
Philippe Mathieu-Daudé writes: > On 7/22/20 5:50 AM, Thiago Jung Bauermann wrote: >> Remove setting of cs->halted from cpu_devinit(), which seems out of place >> when compared to similar code in other architectures (e.g., ppce500_init() >> in hw/ppc/e500.c). >> >> Signed-off-by: Thiago Jung Bau

Re: [PATCH v2 5/9] mips/cps: Use start-powered-off CPUState property

2020-07-22 Thread Thiago Jung Bauermann
Philippe Mathieu-Daudé writes: > On 7/22/20 5:50 AM, Thiago Jung Bauermann wrote: >> Instead of setting CPUState::halted to 1 in main_cpu_reset(), use the >> start-powered-off property which makes cpu_common_reset() initialize it >> to 1 in common code. >> >> Signed-off-by: Thiago Jung Bauerma

Re: [PATCH v2 3/9] ppc/spapr: Use start-powered-off CPUState property

2020-07-22 Thread Thiago Jung Bauermann
Philippe Mathieu-Daudé writes: > On 7/22/20 5:50 AM, Thiago Jung Bauermann wrote: >> PowerPC sPAPR CPUs start in the halted state, and spapr_reset_vcpu() >> attempts to implement this by setting CPUState::halted to 1. But that's too >> late for the case of hotplugged CPUs in a machine configure

Re: [PATCH v2 1/9] target/arm: Move start-powered-off property to generic CPUState

2020-07-22 Thread Thiago Jung Bauermann
Philippe Mathieu-Daudé writes: > Hi Thiago, > > On 7/22/20 5:50 AM, Thiago Jung Bauermann wrote: >> There are other platforms which also have CPUs that start powered off, so >> generalize the start-powered-off property so that it can be used by them. >> >> Note that ARMv7MState also has a prope

[PATCH 1/2] configure: avx2 and avx512f detection for clang

2020-07-22 Thread Shu-Chun Weng
Since clang does not support "#pragma GCC", the instruction sets are always disabled. In this change, we 1. wrap "#pragma GCC" inside "#ifndef __clang__", 2. only retain them around "#include <{e,i,s}mmintrin.h>" to work around gcc bug, 3. and annotate each function with `__attribute__((tar

[PATCH 0/2] Instruction set detection for clang.

2020-07-22 Thread Shu-Chun Weng
Currently when configuring QEMU with clang, AVX2, AVX512F, ATOMIC64, and ATOMIC128 are all disabled because the detection code is GCC-only. With these two patches, I am able to configure, build, and run tests with clang with all of the above enabled. Shu-Chun Weng (2): configure: avx2 and avx512

[PATCH 2/2] configure: atomic64/128 detection for clang

2020-07-22 Thread Shu-Chun Weng
The public interface for __atomic_* and __sync_* do not contain the explicit *_{number} versions: https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html https://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html They appear to be GCC's internal symbols which happen to work. How

[PATCH 3/6] linux-user: Update SO_TIMESTAMP to SO_TIMESTAMP_OLD/NEW

2020-07-22 Thread Shu-Chun Weng
Both guest options map to host SO_TIMESTAMP while keeping a bit in fd_trans to remember if the guest expects the old or the new format. Added a multiarch test to verify. Signed-off-by: Shu-Chun Weng --- linux-user/alpha/sockbits.h| 8 +- linux-user/fd-trans.h | 4

[PATCH 1/6] linux-user: Support F_ADD_SEALS and F_GET_SEALS fcntls

2020-07-22 Thread Shu-Chun Weng
Signed-off-by: Shu-Chun Weng --- linux-user/syscall.c | 10 ++ linux-user/syscall_defs.h | 14 -- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1211e759c2..f97337b0b4 100644 --- a/linux-user/syscall.c +++

[PATCH 4/6] linux-user: setsockopt() SO_TIMESTAMPNS and SO_TIMESTAMPING

2020-07-22 Thread Shu-Chun Weng
This change supports SO_TIMESTAMPNS_OLD/NEW and SO_TIMESTAMPING_OLD/NEW for setsocketopt() with SOL_SOCKET. Based on the SO_TIMESTAMP_OLD/NEW framework. The three pairs share the same flag `SOCK_TSTAMP_NEW` in linux kernel for deciding if the old or the new format is used. Signed-off-by: Shu-Chun

[PATCH 2/6] linux-user: add missing UDP and IPv6 get/setsockopt options

2020-07-22 Thread Shu-Chun Weng
UDP: SOL_UDP manipulate options at UDP level. All six options currently defined in linux source include/uapi/linux/udp.h take integer values. IPv6: IPV6_ADDR_PREFERENCES (RFC5014: Source address selection) was not supported. Signed-off-by: Shu-Chun Weng --- linux-user/syscall.c | 10 --

[PATCH 6/6] linux-user: Add support for SIOCETHTOOL ioctl

2020-07-22 Thread Shu-Chun Weng
The ioctl numeric values are platform-independent and determined by the file include/uapi/linux/sockios.h in Linux kernel source code: #define SIOCETHTOOL 0x8946 These ioctls get (or set) various structures pointed by the field ifr_data in the structure ifreq depending on the first 4 bytes of

[PATCH 0/6] fcntl, sockopt, and ioctl options

2020-07-22 Thread Shu-Chun Weng
Hi Laurent, This is a series of 6 patches in 4 groups, putting into a single thread for easier tracking. [PATCH 1/6] linux-user: Support F_ADD_SEALS and F_GET_SEALS fcntls An incidental follow up on https://lists.nongnu.org/archive/html/qemu-devel/2019-09/msg01925.html [PATCH 2/6] linux-user

[PATCH 5/6] thunk: supports flexible arrays

2020-07-22 Thread Shu-Chun Weng
Flexible arrays may appear in the last field of a struct and are heavily used in the ioctl(SIOCETHTOOL) system call on Linux. E.g. struct ethtool_regs { __u32 cmd; __u32 version; /* driver-specific, indicates different chips/revs */ __u32 len; /* bytes */ __u8da

Re: What is TYPE_TPM_TIS_ISA? (Not an ISA Device)

2020-07-22 Thread Stefan Berger
On 7/22/20 1:55 AM, Markus Armbruster wrote: pm socket --tpmstate dir=tpm --ctrl type=unixio,path=tpm/swtpm-soc running in another terminal. 3/ no machine plug it using isa_register_ioport() (it is not registered to the ISA memory space) There's no requirement for an ISA device to have IO

Re: [PATCH for-5.1] libvhost-user: Add missing GCC_FMT_ATTR and fix format errors

2020-07-22 Thread Marc-André Lureau
On Thu, Jul 23, 2020 at 12:54 AM Stefan Weil wrote: > Signed-off-by: Stefan Weil > Reviewed-by: Marc-André Lureau --- > contrib/libvhost-user/libvhost-user.c | 9 + > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/contrib/libvhost-user/libvhost-user.c > b/contrib/li

Re: [RFC PATCH-for-5.1 2/2] tpm: List the available TPM backends

2020-07-22 Thread Stefan Berger
On 7/22/20 7:23 AM, Philippe Mathieu-Daudé wrote: When an incorrect backend is selected, tpm_display_backend_drivers() is supposed to list the available backends. However the error is directly propagated, and we never display the list. The user only gets "Parameter 'type' expects a TPM backend ty

Re: [Bug 1884831] Re: qemu-nbd fails to discard bigger chunks

2020-07-22 Thread Eric Blake
On 6/23/20 4:35 PM, Eric Blake wrote: Let's get nbd.ko out of the picture. The problem can be reproduced in user space (here, where I built qemu-nbd to log trace messages to stderr): $ truncate --size=3G file $ qemu-nbd -f raw file --trace=nbd_\* $ nbdsh -u nbd://localhost:10810 -c 'h.trim(3*10

[PATCH for-5.1] nbd: Fix large trim/zero requests

2020-07-22 Thread Eric Blake
Although qemu as NBD client limits requests to <2G, the NBD protocol allows clients to send requests almost all the way up to 4G. But because our block layer is not yet 64-bit clean, we accidentally wrap such requests into a negative size, and fail with EIO instead of performing the intended opera

Re: 5.1.0-rc1 regression: reset fails with kvm and -cpu host

2020-07-22 Thread Eduardo Habkost
On Wed, Jul 22, 2020 at 04:47:32PM -0400, Eduardo Habkost wrote: > On Wed, Jul 22, 2020 at 08:05:01PM +0200, Jan Kiszka wrote: > > On 22.07.20 19:35, Eduardo Habkost wrote: > > > Hi Jan, > > > > > > What was the last version where it worked for you? Does using > > > "-cpu host,-vmx" help? > > >

[PATCH for-5.1] Fix grammar in documentation

2020-07-22 Thread Stefan Weil
Signed-off-by: Stefan Weil --- docs/system/build-platforms.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/system/build-platforms.rst b/docs/system/build-platforms.rst index c2b92a9698..9734eba2f1 100644 --- a/docs/system/build-platforms.rst +++ b/docs/system/bu

[PATCH for-5.1] libvhost-user: Add missing GCC_FMT_ATTR and fix format errors

2020-07-22 Thread Stefan Weil
Signed-off-by: Stefan Weil --- contrib/libvhost-user/libvhost-user.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c index d315db1396..6e659aff37 100644 --- a/contrib/libvhost-user/libvhost

Re: 5.1.0-rc1 regression: reset fails with kvm and -cpu host

2020-07-22 Thread Eduardo Habkost
On Wed, Jul 22, 2020 at 08:05:01PM +0200, Jan Kiszka wrote: > On 22.07.20 19:35, Eduardo Habkost wrote: > > Hi Jan, > > > > What was the last version where it worked for you? Does using > > "-cpu host,-vmx" help? > > Yeah, -vmx does indeed help. > > I didn't have the time to bisect yet. Just ch

[PATCH for-5.1] sd/milkymist-memcard: Fix format string

2020-07-22 Thread Stefan Weil
Signed-off-by: Stefan Weil --- hw/sd/milkymist-memcard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/milkymist-memcard.c b/hw/sd/milkymist-memcard.c index afdb8aa0c0..11f61294fc 100644 --- a/hw/sd/milkymist-memcard.c +++ b/hw/sd/milkymist-memcard.c @@ -281,7 +281,7 @

[PATCH v3 1/5] linux-user: Make cpu_env accessible in strace.c

2020-07-22 Thread Filip Bozuta
Variable "cpu_env" is used in file "syscall.c" to store the information about the cpu environment. This variable is used because values of some syscalls can vary between cpu architectures. This patch makes the "cpu_env" accessible in "strace.c" so it can enable aproppriate "-strace" argument printi

[PATCH v3 4/5] linux-user: Add an api to print enumareted argument values with strace

2020-07-22 Thread Filip Bozuta
This patch introduces a type 'struct enums' and function 'print_enums()' that can be used to print enumerated argument values of some syscalls in strace. This can be used in future strace implementations. Also, macros 'ENUM_GENERIC()', 'ENUM_TARGET()' and 'ENUM_END', are introduced to enable autom

[PATCH v3 5/5] linux-user: Add strace support for printing arguments of some clock and time functions

2020-07-22 Thread Filip Bozuta
This patch implements strace argument printing functionality for following syscalls: * clock_getres, clock_gettime, clock_settime - clock and time functions int clock_getres(clockid_t clockid, struct timespec *res) int clock_gettime(clockid_t clockid, struct timespec *tp)

[PATCH v3 3/5] linux-user: Add strace support for printing arguments of syscalls used to lock and unlock memory

2020-07-22 Thread Filip Bozuta
This patch implements strace argument printing functionality for following syscalls: * mlock, munlock, mlockall, munlockall - lock and unlock memory int mlock(const void *addr, size_t len) int munlock(const void *addr, size_t len) int mlockall(int flags) int munlo

[PATCH v3 0/5] Add strace support for printing arguments for a group of selected syscalls

2020-07-22 Thread Filip Bozuta
This series covers strace support for following syscalls: *truncate() *munlock() *clock_gettimeofday() *ftruncate()*munlockall() *clock_getitimer() *getsid() *clock_getres() *clock_setitimer() *mlock()*clock_gettime() *mlockall() *clock_s

[PATCH v3 2/5] linux-user: Add strace support for printing arguments of truncate()/ftruncate() and getsid()

2020-07-22 Thread Filip Bozuta
This patch implements strace argument printing functionality for following syscalls: * truncate, ftruncate - truncate a file to a specified length int truncate/truncate64(const char *path, off_t length) int ftruncate/ftruncate64(int fd, off_t length) man page: https:/

Re: [RFC v2 21/76] target/riscv: rvv-0.9: configure instructions

2020-07-22 Thread Richard Henderson
On 7/22/20 2:15 AM, frank.ch...@sifive.com wrote: > +float vflmul = flmul_table[lmul]; > + > +if ((sew > cpu->cfg.elen) > +|| vill > +|| vflmul < ((float)sew / cpu->cfg.elen) Hmm. I suppose this is fairly compact. Expanding this to integer code would take something like

Re: [RFC v2 19/76] target/riscv: rvv-0.9: add narrower_nanbox_fpr helper

2020-07-22 Thread Richard Henderson
On 7/22/20 2:15 AM, frank.ch...@sifive.com wrote: > From: Frank Chang > > For floating-point operations, the scalar can be taken from a scalar > f register. If FLEN > SEW, the value in the f registers is checked for > a valid NaN-boxed value, in which case the least-significant SEW bits > of the

Re: [PATCH for-5.1 2/3] virtiofsd: add container-friendly -o chroot sandboxing option

2020-07-22 Thread Dr. David Alan Gilbert
* Stefan Hajnoczi (stefa...@redhat.com) wrote: > virtiofsd cannot run in an unprivileged container because CAP_SYS_ADMIN > is required to create namespaces. > > Introduce a weaker sandbox that is sufficient in container environments > because the container runtime already sets up namespaces. Use c

Re: [PATCH v2 06/12] accel/tcg: better handle memory constrained systems

2020-07-22 Thread Richard Henderson
On 7/22/20 9:44 AM, Daniel P. Berrangé wrote: > OpenStack uses TCG in alot of their CI infrastructure for example > and runs multiple VMs. If there's 4 VMs, that's another 4 GB of > RAM usage just silently added on top of the explicit -m value. > > I wouldn't be surprised if this pushes CI into OO

Re: https booting

2020-07-22 Thread Laszlo Ersek
On 07/22/20 16:13, Daniel P. Berrangé wrote: > On Wed, Jul 22, 2020 at 03:55:38PM +0200, Gerd Hoffmann wrote: How does edk2 handle the root ca problem? >>> >>> There are two fw_cfg paths >>> >>> - etc/edk2/https/ciphers >>> - etc/edk2/https/cacerts >>> >>> The first sets the cipher algorit

Re: https booting

2020-07-22 Thread Laszlo Ersek
On 07/22/20 14:08, Gerd Hoffmann wrote: > How does edk2 handle the root ca problem? It has no builtin CA certificate. HTTPS boot will not work until at least one trusted CA cert is imported. The setup TUI offers an option to import CA cert(s) from local files (which must be on such filesystems t

  1   2   3   4   >