Re: [PATCH 5/8] util/compatfd.c: Replaced a malloc with GLib's variant

2021-03-14 Thread Mahmoud Mandour
> > If it's unrelated, then maybe better do it in a separate patch. > I thought so but I didn't know whether it was a so-small change that it didn't require its own patch or not. I will amend that. Since this is only a very small allocation, I think it would be better to > use g_malloc() here and

Re: Questions about timer interrupt handling in QEMU

2021-03-14 Thread Pavel Dovgalyuk
On 14.03.2021 12:04, Arnabjyoti Kalita wrote: Hello all, This is a continuation of some of the questions I had about the clock record-replay handling process in QEMU. My previous post is here - https://www.mail-archive.com/qemu-discuss@nongnu.org/msg06231.html

Re: [PATCH v3] multi-process: Initialize variables declared with g_auto*

2021-03-14 Thread Miroslav Rezanina
On Mon, Mar 15, 2021 at 02:20:10PM +0800, Zenghui Yu wrote: > On 2021/3/15 13:48, Miroslav Rezanina wrote: > > Missing declaration without initialization in hw/s390x/s390-pci-vfio.c > > othwerwise correct. Will you send v4 with missing initialization or > > should I send then as another patch? > >

Re: [PATCH v3] multi-process: Initialize variables declared with g_auto*

2021-03-14 Thread Zenghui Yu
On 2021/3/15 13:48, Miroslav Rezanina wrote: Missing declaration without initialization in hw/s390x/s390-pci-vfio.c othwerwise correct. Will you send v4 with missing initialization or should I send then as another patch? I'd prefer the latter so that subsystem maintainers can take the separate

[PATCH 1/7] block/nbd: avoid touching freed connect_thread

2021-03-14 Thread Roman Kagan
When the NBD connection is being torn down, the connection thread gets canceled and "detached", meaning it is about to get freed. If this happens while the connection coroutine yielded waiting for the connection thread to complete, when it resumes it may access the invalidated connection thread da

[PATCH 4/7] block/nbd: transfer reconnection stuff across aio_context switch

2021-03-14 Thread Roman Kagan
Make varios pieces of reconnection logic correctly survive the transition of the BDRVNBDState from one aio_context to another. In particular, - cancel the reconnect_delay_timer and rearm it in the new context; - cancel the sleep of the connection_co between reconnect attempt so that it continue

Re: [PATCH 5/8] util/compatfd.c: Replaced a malloc with GLib's variant

2021-03-14 Thread Thomas Huth
On 14/03/2021 04.23, Mahmoud Mandour wrote: Replaced a malloc() call and its respective free() call with GLib's g_try_malloc() and g_free(). Also, did slight styling changes that were producing style errors when using the checkpatch.pl script against the file. If it's unrelated, then maybe bet

[PATCH 2/7] block/nbd: use uniformly nbd_client_connecting_wait

2021-03-14 Thread Roman Kagan
Use nbd_client_connecting_wait uniformly all over the block/nbd.c. While at this, drop the redundant check for nbd_client_connecting_wait in reconnect_delay_timer_init, as all its callsites do this check too. Signed-off-by: Roman Kagan --- block/nbd.c | 34 +++--- 1

[PATCH 5/7] block/nbd: better document a case in nbd_co_establish_connection

2021-03-14 Thread Roman Kagan
Cosmetic: adjust the comment and the return value in nbd_co_establish_connection where it's entered while the connection thread is still running. Signed-off-by: Roman Kagan --- block/nbd.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index

[PATCH 7/7] block/nbd: stop manipulating in_flight counter

2021-03-14 Thread Roman Kagan
As the reconnect logic no longer interferes with drained sections, it appears unnecessary to explicitly manipulate the in_flight counter. Fixes: 5ad81b4946 ("nbd: Restrict connection_co reentrance") Signed-off-by: Roman Kagan --- block/nbd.c | 6 -- nbd/client.c | 2 -- 2 files changed, 8 d

[PATCH 3/7] block/nbd: assert attach/detach runs in the proper context

2021-03-14 Thread Roman Kagan
Document (via a comment and an assert) that nbd_client_detach_aio_context and nbd_client_attach_aio_context_bh run in the desired aio_context. Signed-off-by: Roman Kagan --- block/nbd.c | 12 1 file changed, 12 insertions(+) diff --git a/block/nbd.c b/block/nbd.c index 1d8edb5b21..

[PATCH 6/7] block/nbd: decouple reconnect from drain

2021-03-14 Thread Roman Kagan
The reconnection logic doesn't need to stop while in a drained section. Moreover it has to be active during the drained section, as the requests that were caught in-flight with the connection to the server broken can only usefully get drained if the connection is restored. Otherwise such requests

[PATCH 0/7] block/nbd: decouple reconnect from drain

2021-03-14 Thread Roman Kagan
The reconnection logic doesn't need to stop while in a drained section. Moreover it has to be active during the drained section, as the requests that were caught in-flight with the connection to the server broken can only usefully get drained if the connection is restored. Otherwise such requests

Re: [PATCH v2] replay: notify CPU on event

2021-03-14 Thread Pavel Dovgalyuk
ping On 16.02.2021 12:34, Pavel Dovgalyuk wrote: This patch enables vCPU notification to wake it up when new async event comes in replay mode. The motivation of this patch is the following. Consider recorded block async event. It is saved into the log with one of the checkpoints. This checkpoin

Re: [PATCH] hw/virtio: enable ioeventfd configuring for mmio

2021-03-14 Thread Pavel Dovgalyuk
ping On 24.02.2021 16:33, Pavel Dovgalyuk wrote: This patch adds ioeventfd flag for virtio-mmio configuration. It allows switching ioeventfd on and off. Signed-off-by: Pavel Dovgalyuk --- hw/virtio/virtio-mmio.c | 11 ++- include/hw/virtio/virtio-mmio.h |5 + 2 fi

Re: [PATCH] replay: don't wait in run_on_cpu

2021-03-14 Thread Pavel Dovgalyuk
ping On 11.03.2021 10:14, Pavel Dovgalyuk wrote: In record/replay mode waiting for vCPU to execute the task scheduled by run_on_cpu may lead to deadlock, because when run_on_cpu is executed in main_loop (e.g., in loadvm processing) it holds replay mutex. This patch allows running scheduled task

Re: [PATCH v3] multi-process: Initialize variables declared with g_auto*

2021-03-14 Thread Miroslav Rezanina
On Fri, Mar 12, 2021 at 07:21:43PM +0800, Zenghui Yu wrote: > Quote docs/devel/style.rst (section "Automatic memory deallocation"): > > * Variables declared with g_auto* MUST always be initialized, > otherwise the cleanup function will use uninitialized stack memory > > Initialize @name properl

Re: [PULL 00/16] Net patches

2021-03-14 Thread Thomas Huth
On 14/03/2021 12.37, Peter Maydell wrote: On Fri, 12 Mar 2021 at 06:16, Jason Wang wrote: The following changes since commit f4abdf32714d1845b7c01ec136dd2b04c2f7db47: Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-docs-xen-updates-100321-2' into staging (2021-03-11 16:20

Re: [RFC] nbd: decouple reconnect from drain

2021-03-14 Thread Roman Kagan
On Fri, Mar 12, 2021 at 03:35:25PM +0300, Vladimir Sementsov-Ogievskiy wrote: > 10.03.2021 12:32, Roman Kagan wrote: > > NBD connect coroutine takes an extra in_flight reference as if it's a > > request handler. This prevents drain from completion until the > > connection coroutine is releases the

Re: [PATCH] utils: Use fma in qemu_strtosz

2021-03-14 Thread Thomas Huth
On 15/03/2021 00.48, Richard Henderson wrote: Use fma to simulatneously scale and round up fraction. The libm function will always return a properly rounded double precision value, which will eliminate any extra precision the x87 co-processor may give us, which will keep the output predictable v

Re: [RFC PATCH 4/8] qtest/fuzz: Restrict CPU I/O instructions

2021-03-14 Thread Thomas Huth
On 15/03/2021 00.29, Philippe Mathieu-Daudé wrote: Restrict CPU I/O instructions to architectures providing I/O bus. Signed-off-by: Philippe Mathieu-Daudé --- tests/qtest/fuzz/generic_fuzz.c | 16 ++-- tests/qtest/fuzz/qtest_wrappers.c | 4 2 files changed, 14 insertions

Re: [PATCH] Hexagon (target/hexagon) fix typo in comment

2021-03-14 Thread no-reply
Patchew URL: https://patchew.org/QEMU/1615784115-26559-1-git-send-email-tsimp...@quicinc.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 1615784115-26559-1-git-send-email-tsimp...@quicinc.com Subject: [PATCH] Hexag

[PATCH] Hexagon (target/hexagon) fix typo in comment

2021-03-14 Thread Taylor Simpson
Signed-of-by: Taylor Simpson --- target/hexagon/op_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index 9f19007..7361a07 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -297,7 +297,7

Re: [PATCH V3 1/8] hw/block/nvme: support namespace detach

2021-03-14 Thread Keqian Zhu
Hi, I don't dig into code logic, just some nit below. On 2021/3/1 0:10, Minwoo Im wrote: > Given that now we have nvme-subsys device supported, we can manage > namespace allocated, but not attached: detached. This patch introduced s/introduced/introduces > a parameter for nvme-ns device named '

[PATCH] Hexagon (target/hexagon) remove unnecessary semicolons

2021-03-14 Thread Taylor Simpson
Address feedback from Richard Henderson < Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/hexagon/gen_tcg.h b/target/hexagon/gen_tcg.h index e044dea..a30048e 100644 --- a/target/hexagon/gen_tcg.h +++ b/targ

[PATCH] Hexagon (target/hexagon) TCG generation cleanup

2021-03-14 Thread Taylor Simpson
Simplify TCG generation of hex_reg_written Address feedback from Richard Henderson < Signed-off-by: Taylor Simpson --- target/hexagon/genptr.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target/hexagon/genptr.c b/target/hexagon/genptr.c index 7481f4c..0ad63f

[PATCH] Hexagon (target/hexagon) remove unnecessary checks in find_iclass_slots

2021-03-14 Thread Taylor Simpson
Address feedback from Richard Henderson < Signed-off-by: Taylor Simpson --- target/hexagon/iclass.c | 4 1 file changed, 4 deletions(-) diff --git a/target/hexagon/iclass.c b/target/hexagon/iclass.c index 378d8a6..6091286 100644 --- a/target/hexagon/iclass.c +++ b/target/hexagon/iclass.c @

[PATCH] Hexagon (target/hexagon) change DECODE_MAPPED_REG operand name to OPNUM

2021-03-14 Thread Taylor Simpson
Address feedback from Richard Henderson < Signed-off-by: Taylor Simpson --- target/hexagon/decode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/hexagon/decode.c b/target/hexagon/decode.c index c9bacaa..1c9c074 100644 --- a/target/hexagon/decode.c +++ b/target/h

[PATCH] Hexagon (target/hexagon) translation changes

2021-03-14 Thread Taylor Simpson
Change cpu_ldl_code to translator_ldl Don't end the TB after every packet when HEX_DEBUG is on Make gen_check_store_width a simple call Address feedback from Richard Henderson < Signed-off-by: Taylor Simpson --- target/hexagon/translate.c | 26 +- 1 file changed, 9 inser

Re: [PULL 00/16] Net patches

2021-03-14 Thread Jason Wang
> 2021年3月14日 下午7:37,Peter Maydell 写道: > > On Fri, 12 Mar 2021 at 06:16, Jason Wang > wrote: >> >> The following changes since commit f4abdf32714d1845b7c01ec136dd2b04c2f7db47: >> >> Merge remote-tracking branch >> 'remotes/stsquad/tags/pull-testing-docs-xen-updat

[Bug 1919036] Re: Assertion failure in fifo8_push_all() through am53c974

2021-03-14 Thread Cheolwoo,Myung
Hello Mark, I tested on fixed version, and checked that it does not trigger the assertion failure. Thanks, - Cheolwoo Myung -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1919036 Title: Assertion

[Bug 1907909] Re: assertion failure in am53c974

2021-03-14 Thread Alexander Bulekov
It looks like this reproducer triggers the same bug as #1919036, as of 3f8d1885e -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1907909 Title: assertion failure in am53c974 Status in QEMU: New

[Bug 1909247] Re: QEMU: use after free vulnerability in esp_do_dma() in hw/scsi/esp.c

2021-03-14 Thread Alexander Bulekov
Looks the same, or very similar to this one: /* * Autogenerated Fuzzer Test Case * * This work is licensed under the terms of the GNU GPL, version 2 or * later. See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" #include "libqos/libqtest.h" /* * cat << EOF | ./qemu

[Bug 1919035] Re: Assertion failure in fifo8_pop_buf() through am53c974

2021-03-14 Thread Alexander Bulekov
QTest reproducer: /* * Autogenerated Fuzzer Test Case * * This work is licensed under the terms of the GNU GPL, version 2 or * later. See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" #include "libqos/libqtest.h" /* * cat << EOF | ./qemu-system-i386 -display none

RE: [PATCH v8 26/35] Hexagon (target/hexagon) TCG generation

2021-03-14 Thread Taylor Simpson
> -Original Message- > From: Richard Henderson > Sent: Saturday, March 13, 2021 7:40 PM > To: Taylor Simpson ; qemu-devel@nongnu.org > Cc: phi...@redhat.com; alex.ben...@linaro.org; laur...@vivier.eu; > a...@rev.ng; Brian Cain > Subject: Re: [PATCH v8 26/35] Hexagon (target/hexagon) TCG

RE: [PATCH v8 29/35] Hexagon (target/hexagon) translation

2021-03-14 Thread Taylor Simpson
> -Original Message- > From: Richard Henderson > Sent: Saturday, March 13, 2021 7:44 PM > To: Taylor Simpson ; qemu-devel@nongnu.org > Cc: phi...@redhat.com; alex.ben...@linaro.org; laur...@vivier.eu; > a...@rev.ng; Brian Cain > Subject: Re: [PATCH v8 29/35] Hexagon (target/hexagon) tran

[Bug 1919036] Re: Assertion failure in fifo8_push_all() through am53c974

2021-03-14 Thread Alexander Bulekov
QTest Reproducer: /* * Autogenerated Fuzzer Test Case * * This work is licensed under the terms of the GNU GPL, version 2 or * later. See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" #include "libqos/libqtest.h" /* * cat << EOF | ./qemu-system-i386 -display none

[Bug 1910723] Re: NULL pointer dereference issues in am53c974 SCSI host bus adapter

2021-03-14 Thread Alexander Bulekov
QTest Reproducer for the first: /* * Autogenerated Fuzzer Test Case * * This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" #include "libqos/libqtest.h" /* * cat << EOF | ./qemu-system-i386

[Bug 1910723] Re: NULL pointer dereference issues in am53c974 SCSI host bus adapter

2021-03-14 Thread Alexander Bulekov
QTest Reproducer for the second: /* * Autogenerated Fuzzer Test Case * * This work is licensed under the terms of the GNU GPL, version 2 or * later. See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" #include "libqos/libqtest.h" /* * cat << EOF | ./qemu-system-i386

RE: [PATCH v8 27/35] Hexagon (target/hexagon) TCG for instructions with multiple definitions

2021-03-14 Thread Taylor Simpson
> -Original Message- > From: Richard Henderson > Sent: Sunday, March 14, 2021 1:02 PM > To: Taylor Simpson ; qemu-devel@nongnu.org > Cc: phi...@redhat.com; alex.ben...@linaro.org; laur...@vivier.eu; > a...@rev.ng; Brian Cain > Subject: Re: [PATCH v8 27/35] Hexagon (target/hexagon) TCG f

Re: [PATCH] fuzz: check machine, before PC-specific code

2021-03-14 Thread Alexander Bulekov
On 210315 0031, Philippe Mathieu-Daudé wrote: > On 3/15/21 12:13 AM, Alexander Bulekov wrote: > > On 210314 1910, Alexander Bulekov wrote: > >> We enumerate PCI devices on PC machines, but this breaks the fuzzer for > >> non-PC machines and architectures. Add checks to avoid this. > >> > >> Reporte

Re: [RFC PATCH 4/8] qtest/fuzz: Restrict CPU I/O instructions

2021-03-14 Thread Alexander Bulekov
On 210315 0029, Philippe Mathieu-Daudé wrote: > Restrict CPU I/O instructions to architectures providing > I/O bus. > > Signed-off-by: Philippe Mathieu-Daudé > --- > tests/qtest/fuzz/generic_fuzz.c | 16 ++-- > tests/qtest/fuzz/qtest_wrappers.c | 4 > 2 files changed, 14 inse

[PATCH] utils: Use fma in qemu_strtosz

2021-03-14 Thread Richard Henderson
Use fma to simulatneously scale and round up fraction. The libm function will always return a properly rounded double precision value, which will eliminate any extra precision the x87 co-processor may give us, which will keep the output predictable vs other hosts. Adding DBL_EPSILON while scaling

[PULL 3/4] target/avr: Fix some comment spelling errors

2021-03-14 Thread Philippe Mathieu-Daudé
From: Lichang Zhao I found that there are many spelling errors in the comments of qemu/target/avr. I used spellcheck to check the spelling errors and found some errors in the folder. Signed-off-by: Lichang Zhao Reviewed-by: David Edmondson Reviewed-by: Philippe Mathieu-Daude Message-Id: <2020

[PULL 1/4] hw/misc/led: Add yellow LED

2021-03-14 Thread Philippe Mathieu-Daudé
Add the yellow "lime" LED. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Michael Rolnik Message-Id: <20210313165445.2113938-2-f4...@amsat.org> --- include/hw/misc/led.h | 1 + hw/misc/led.c | 1 + 2 files changed, 2 insertions(+) diff --git a/includ

[PULL 4/4] target/avr: Fix interrupt execution

2021-03-14 Thread Philippe Mathieu-Daudé
From: Ivanov Arkasha Only one interrupt is in progress at the moment. It is only necessary to set to reset interrupt_request after all interrupts have been executed. Signed-off-by: Ivanov Arkasha Message-Id: <20210312164754.18437-1-arkaisp2...@gmail.com> Signed-off-by: Philippe Mathieu-Daudé R

[PULL 2/4] hw/avr/arduino: List board schematic links

2021-03-14 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Michael Rolnik Message-Id: <20210313165445.2113938-3-f4...@amsat.org> --- hw/avr/arduino.c | 20 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/hw/avr/arduino.c b/hw/avr/arduin

[PULL 0/4] AVR patches for 2021-03-15

2021-03-14 Thread Philippe Mathieu-Daudé
The following changes since commit 6157b0e19721aadb4c7fdcfe57b2924af6144b14: Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-request' into staging (2021-03-14 17:47:49 +) are available in the Git repository at: https://github.com/philmd/qemu.git tags/avr-2021

Re: [PATCH 00/11] AVR patch queue for QEMU 6.0

2021-03-14 Thread Philippe Mathieu-Daudé
On 3/13/21 5:54 PM, Philippe Mathieu-Daudé wrote: > Hi, > > This series contains all the AVR patches I could find on the list. > > Niteesh, I fixed minor issues. Do you mind reviewing on top? > > Pull request planned for Monday if no problem arises. > > Thanks, > > Phil. > > G S Niteesh Babu

Re: [PATCH 03/11] hw/avr: Add limited support for avr gpio registers

2021-03-14 Thread Philippe Mathieu-Daudé
On 3/14/21 11:26 AM, Mark Cave-Ayland wrote: > On 13/03/2021 16:54, Philippe Mathieu-Daudé wrote: > >> From: Heecheol Yang >> >> Add some of these features for AVR GPIO: >> >>    - GPIO I/O : PORTx registers >>    - Data Direction : DDRx registers >>    - DDRx toggling : PINx registers >> >> Foll

Re: [Virtio-fs] [PATCH 1/3] virtiofsd: Don't allow empty paths in lookup_name()

2021-03-14 Thread Vivek Goyal
On Fri, Mar 12, 2021 at 03:10:01PM +0100, Greg Kurz wrote: > When passed an empty filename, lookup_name() returns the inode of > the parent directory, unless the parent is the root in which case > the st_dev doesn't match and lo_find() returns NULL. This is > because lookup_name() passes AT_EMPTY_P

Re: [Virtio-fs] [PATCH 3/3] virtiofsd: Don't allow empty filenames

2021-03-14 Thread Vivek Goyal
On Fri, Mar 12, 2021 at 03:10:03PM +0100, Greg Kurz wrote: > POSIX.1-2017 clearly stipulates that empty filenames aren't > allowed ([1] and [2]). Since virtiofsd is supposed to mirror > the host file system hierarchy and the host can be assumed to > be linux, we don't really expect clients to pass

Re: [Virtio-fs] [PATCH 2/3] virtiofsd: Convert some functions to return bool

2021-03-14 Thread Vivek Goyal
On Fri, Mar 12, 2021 at 03:10:02PM +0100, Greg Kurz wrote: > Both currently only return 0 or 1. > > Signed-off-by: Greg Kurz Looks good to me. Reviewed-by: Vivek Goyal Vivek > --- > tools/virtiofsd/passthrough_ll.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --gi

Re: [PATCH] fuzz: check machine, before PC-specific code

2021-03-14 Thread Philippe Mathieu-Daudé
On 3/15/21 12:13 AM, Alexander Bulekov wrote: > On 210314 1910, Alexander Bulekov wrote: >> We enumerate PCI devices on PC machines, but this breaks the fuzzer for >> non-PC machines and architectures. Add checks to avoid this. >> >> Reported-by: Philippe Mathieu-Daudé >> Signed-off-by: Alexander

[RFC PATCH 8/8] softmmu: Restrict CPU I/O instructions

2021-03-14 Thread Philippe Mathieu-Daudé
Restrict CPU I/O instructions to architectures providing I/O bus. Signed-off-by: Philippe Mathieu-Daudé --- softmmu/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/softmmu/meson.build b/softmmu/meson.build index ebf063b8990..3df196917a0 100644 --- a/softmmu/meson.

[RFC PATCH 7/8] monitor: Restrict CPU I/O instructions

2021-03-14 Thread Philippe Mathieu-Daudé
Restrict CPU I/O instructions to architectures providing I/O bus. Signed-off-by: Philippe Mathieu-Daudé --- monitor/misc.c | 4 hmp-commands.hx | 2 ++ 2 files changed, 6 insertions(+) diff --git a/monitor/misc.c b/monitor/misc.c index d40c7d5afc0..b59f11433eb 100644 --- a/monitor/misc.c

[RFC PATCH 5/8] qtest/libqos: Restrict CPU I/O instructions

2021-03-14 Thread Philippe Mathieu-Daudé
Restrict CPU I/O instructions to architectures providing I/O bus. Signed-off-by: Philippe Mathieu-Daudé --- tests/qtest/libqos/fw_cfg.h | 3 +++ tests/qtest/libqos/fw_cfg.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/tests/qtest/libqos/fw_cfg.h b/tests/qtest/libqos/fw_cfg.h index c6a7

[RFC PATCH 6/8] qtest: Restrict CPU I/O instructions

2021-03-14 Thread Philippe Mathieu-Daudé
Restrict CPU I/O instructions to architectures providing I/O bus. Signed-off-by: Philippe Mathieu-Daudé --- softmmu/qtest.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/softmmu/qtest.c b/softmmu/qtest.c index ff253068657..51fe256297a 100644 --- a/softmmu/qtest.c

[RFC PATCH 4/8] qtest/fuzz: Restrict CPU I/O instructions

2021-03-14 Thread Philippe Mathieu-Daudé
Restrict CPU I/O instructions to architectures providing I/O bus. Signed-off-by: Philippe Mathieu-Daudé --- tests/qtest/fuzz/generic_fuzz.c | 16 ++-- tests/qtest/fuzz/qtest_wrappers.c | 4 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/qtest/fuzz/gener

[RFC PATCH 2/8] exec: Extract CPU I/O instructions to "cpu-io.h"

2021-03-14 Thread Philippe Mathieu-Daudé
Not all architectures use an I/O bus. Extract the CPU I/O instruction helpers into a specific unit named cpu-io.c (and its equivalent "cpu-io.h" header). Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-io.h | 30 +++ include/exec/ioport.h | 7 --- hw/i

[RFC PATCH 3/8] target: Introduce TARGET_HAS_IOPORT

2021-03-14 Thread Philippe Mathieu-Daudé
Have target architectures providing CPU access to I/O bus define TARGET_HAS_IOPORT. Signed-off-by: Philippe Mathieu-Daudé --- default-configs/targets/avr-softmmu.mak| 1 + default-configs/targets/i386-softmmu.mak | 1 + default-configs/targets/x86_64-softmmu.mak | 1 + 3 files changed, 3 i

[RFC PATCH 1/8] softmmu/physmem: Rename io_mem_unassigned -> unassigned_mr

2021-03-14 Thread Philippe Mathieu-Daudé
'io_mem_unassigned' memory region is not specific to I/O, rename it using a more generic 'unassigned_mr', matching the '_mr' suffix pattern used in various places in the code base. Signed-off-by: Philippe Mathieu-Daudé --- softmmu/physmem.c | 12 ++-- 1 file changed, 6 insertions(+), 6 d

[RFC PATCH 0/8] softmmu: Restrict CPU I/O instructions

2021-03-14 Thread Philippe Mathieu-Daudé
An attempt to restrict CPU I/O instructions to targets where it makes sense. If it does, I'll send the next series which restrict the I/O address space to X86/AVR. Based-on: <20210314225308.2582284-1-f4...@amsat.org> Philippe Mathieu-Daudé (8): softmmu/physmem: Rename io_mem_unassigned -> unass

Re: [PATCH] qtest/libqos/meson: Restrict architecture specific objects

2021-03-14 Thread Alexander Bulekov
On 210314 2353, Philippe Mathieu-Daudé wrote: > Various libqos files are architecture specific. > Restrict the ARM/PPC/X86 units to their targets. > > Signed-off-by: Philippe Mathieu-Daudé > --- I thought qos-test is reused for all the machines, and all the arch checking is done at runtime. Also

Re: [PATCH] fuzz: check machine, before PC-specific code

2021-03-14 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20210314231015.29166-1-alx...@bu.edu/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20210314231015.29166-1-alx...@bu.edu Subject: [PATCH] fuzz: check machine, before PC-specific co

Re: [PATCH v2 1/3] memory: add a sparse memory device for fuzzing

2021-03-14 Thread Alexander Bulekov
On 210313 1818, Alexander Bulekov wrote: > For testing, it can be useful to simulate an enormous amount of memory > (e.g. 2^64 RAM). This adds an MMIO device that acts as sparse memory. > When something writes a nonzero value to a sparse-mem address, we > allocate a block of memory. This block is k

Re: [PATCH] fuzz: check machine, before PC-specific code

2021-03-14 Thread Alexander Bulekov
On 210314 1910, Alexander Bulekov wrote: > We enumerate PCI devices on PC machines, but this breaks the fuzzer for > non-PC machines and architectures. Add checks to avoid this. > > Reported-by: Philippe Mathieu-Daudé > Signed-off-by: Alexander Bulekov > --- > tests/qtest/fuzz/generic_fuzz.c |

[PATCH] fuzz: check machine, before PC-specific code

2021-03-14 Thread Alexander Bulekov
We enumerate PCI devices on PC machines, but this breaks the fuzzer for non-PC machines and architectures. Add checks to avoid this. Reported-by: Philippe Mathieu-Daudé Signed-off-by: Alexander Bulekov --- tests/qtest/fuzz/generic_fuzz.c | 11 --- 1 file changed, 8 insertions(+), 3 dele

[PATCH] qtest/libqos/meson: Restrict architecture specific objects

2021-03-14 Thread Philippe Mathieu-Daudé
Various libqos files are architecture specific. Restrict the ARM/PPC/X86 units to their targets. Signed-off-by: Philippe Mathieu-Daudé --- tests/qtest/libqos/meson.build | 51 ++ 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/tests/qtest/libqos/me

Re: [PATCH v3] fuzz: map all BARs and enable PCI devices

2021-03-14 Thread Philippe Mathieu-Daudé
On 12/21/20 7:12 PM, Alexander Bulekov wrote: > Prior to this patch, the fuzzer found inputs to map PCI device BARs and > enable the device. While it is nice that the fuzzer can do this, it > added significant overhead, since the fuzzer needs to map all the > BARs (regenerating the memory topology)

Re: [RFC PATCH 0/6] vhost-user: Shutdown/Flush slave channel properly

2021-03-14 Thread Vivek Goyal
On Sun, Mar 14, 2021 at 06:21:04PM -0400, Michael S. Tsirkin wrote: > On Mon, Jan 25, 2021 at 01:01:09PM -0500, Vivek Goyal wrote: > > Hi, > > > > We are working on DAX support in virtiofs and have some patches out of > > the tree hosted here. > > > > https://gitlab.com/virtio-fs/qemu/-/commits/v

Re: [RFC PATCH 0/6] vhost-user: Shutdown/Flush slave channel properly

2021-03-14 Thread Michael S. Tsirkin
On Mon, Jan 25, 2021 at 01:01:09PM -0500, Vivek Goyal wrote: > Hi, > > We are working on DAX support in virtiofs and have some patches out of > the tree hosted here. > > https://gitlab.com/virtio-fs/qemu/-/commits/virtio-fs-dev ping anyone wants to pick this up and post a non-rfc version? > The

Re: [PATCH v2 00/29] tcg: Workaround macOS 11.2 mprotect bug

2021-03-14 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20210314212724.1917075-1-richard.hender...@linaro.org/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20210314212724.1917075-1-richard.hender...@linaro.org Subject: [PATCH v2 00/29

Re: [PATCH v2 22/29] tcg: Return the map protection from alloc_code_gen_buffer

2021-03-14 Thread Philippe Mathieu-Daudé
On 3/14/21 10:27 PM, Richard Henderson wrote: > Change the interface from a boolean error indication to a > negative error vs a non-negative protection. For the moment > this is only interface change, not making use of the new data. > > Signed-off-by: Richard Henderson > --- > tcg/region.c | 63

[PATCH v2 25/29] util/osdep: Add qemu_mprotect_rw

2021-03-14 Thread Richard Henderson
For --enable-tcg-interpreter on Windows, we will need this. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/qemu/osdep.h | 1 + util/osdep.c | 9 + 2 files changed, 10 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index

Re: [PATCH v2 29/29] tcg: Move tcg_init_ctx and tcg_ctx from accel/tcg/

2021-03-14 Thread Philippe Mathieu-Daudé
On 3/14/21 10:27 PM, Richard Henderson wrote: > These variables belong to the jit side, not the user side. > > Since tcg_init_ctx is no longer used outside of tcg/, move > the declaration to tcg/internal.h. > > Suggested-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > inc

Re: [PATCH] include/ui/console.h: Delete is_surface_bgr()

2021-03-14 Thread Philippe Mathieu-Daudé
On 3/14/21 5:39 PM, Peter Maydell wrote: > The function is_surface_bgr() is no longer used anywhere, > so we can delete it. > > Signed-off-by: Peter Maydell > --- > include/ui/console.h | 10 -- > 1 file changed, 10 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

[PATCH v2 29/29] tcg: Move tcg_init_ctx and tcg_ctx from accel/tcg/

2021-03-14 Thread Richard Henderson
These variables belong to the jit side, not the user side. Since tcg_init_ctx is no longer used outside of tcg/, move the declaration to tcg/internal.h. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 1 - tcg/internal.h| 1 + a

[PATCH v2 28/29] tcg: When allocating for !splitwx, begin with PROT_NONE

2021-03-14 Thread Richard Henderson
There's a change in mprotect() behaviour [1] in the latest macOS on M1 and it's not yet clear if it's going to be fixed by Apple. In this case, instead of changing permissions of N guard pages, we change permissions of N rwx regions. The same number of syscalls are required either way. [1] https

[PATCH v2 26/29] tcg: Round the tb_size default from qemu_get_host_physmem

2021-03-14 Thread Richard Henderson
If qemu_get_host_physmem returns an odd number of pages, then physmem / 8 will not be a multiple of the page size. The following was observed on a gitlab runner: ERROR qtest-arm/boot-serial-test - Bail out! ERROR:../util/osdep.c:80:qemu_mprotect__osdep: \ assertion failed: (!(size & ~qemu_real_

[PATCH v2 16/29] tcg: Replace region.end with region.total_size

2021-03-14 Thread Richard Henderson
A size is easier to work with than an end point, particularly during initial buffer allocation. Signed-off-by: Richard Henderson --- tcg/region.c | 29 + 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/tcg/region.c b/tcg/region.c index ae22308290..8e4d

[PATCH v2 19/29] tcg: Tidy split_cross_256mb

2021-03-14 Thread Richard Henderson
Return output buffer and size via output pointer arguments, rather than returning size via tcg_ctx->code_gen_buffer_size. Signed-off-by: Richard Henderson --- tcg/region.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tcg/region.c b/tcg/region.c index 23b345

[PATCH v2 18/29] tcg: Tidy tcg_n_regions

2021-03-14 Thread Richard Henderson
Compute the value using straight division and bounds, rather than a loop. Pass in tb_size rather than reading from tcg_init_ctx.code_gen_buffer_size, Signed-off-by: Richard Henderson --- tcg/region.c | 29 - 1 file changed, 12 insertions(+), 17 deletions(-) diff --g

[PATCH v2 13/29] accel/tcg: Pass down max_cpus to tcg_init

2021-03-14 Thread Richard Henderson
Start removing the include of hw/boards.h from tcg/. Pass down the max_cpus value from tcg_init_machine, where we have the MachineState already. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 +- tcg/internal.h | 2 +- accel/tcg/tcg-all.c

[PATCH v2 11/29] tcg: Create tcg_init

2021-03-14 Thread Richard Henderson
Perform both tcg_context_init and tcg_region_init. Do not leave this split to the caller. Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 3 +-- tcg/internal.h| 1 + accel/tcg/translate-all.c | 3 +-- tcg/tcg.c | 9 - 4 files changed, 11 inser

[PATCH v2 10/29] accel/tcg: Rename tcg_init to tcg_init_machine

2021-03-14 Thread Richard Henderson
We shortly want to use tcg_init for something else. Since the hook is called init_machine, match that. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/tcg-all.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accel/tcg/tcg-all.c b/accel

[PATCH v2 09/29] accel/tcg: Move alloc_code_gen_buffer to tcg/region.c

2021-03-14 Thread Richard Henderson
Buffer management is integral to tcg. Do not leave the allocation to code outside of tcg/. This is code movement, with further cleanups to follow. Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 +- accel/tcg/translate-all.c | 414 + tcg

[PATCH v2 27/29] tcg: Merge buffer protection and guard page protection

2021-03-14 Thread Richard Henderson
Do not handle protections on a case-by-case basis in the various alloc_code_gen_buffer instances; do it within a single loop in tcg_region_init. Signed-off-by: Richard Henderson --- tcg/region.c | 40 +--- 1 file changed, 29 insertions(+), 11 deletions(-) dif

[PATCH v2 07/29] tcg: Split out region.c

2021-03-14 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/internal.h | 37 tcg/region.c| 570 tcg/tcg.c | 545 + tcg/meson.build | 1 + 4 files changed, 611 insertions(+), 542 deletions(-) create mode

[PATCH v2 21/29] tcg: Allocate code_gen_buffer into struct tcg_region_state

2021-03-14 Thread Richard Henderson
Do not mess around with setting values within tcg_init_ctx. Put the values into 'region' directly, which is where they will live for the lifetime of the program. Signed-off-by: Richard Henderson --- tcg/region.c | 64 ++-- 1 file changed, 27 insert

[PATCH v2 24/29] tcg: Do not set guard pages in the rx buffer

2021-03-14 Thread Richard Henderson
We only need guard pages in the rw buffer to avoid buffer overruns. Let the rx buffer keep large pages all the way through. Signed-off-by: Richard Henderson --- tcg/region.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tcg/region.c b/tcg/region.c index 994c083343..2

[PATCH v2 05/29] tcg: Split out tcg_region_initial_alloc

2021-03-14 Thread Richard Henderson
This has only one user, and currently needs an ifdef, but will make more sense after some code motion. Signed-off-by: Richard Henderson --- tcg/tcg.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 2b631fccdf..3316a22bde 100644 --- a

[PATCH v2 23/29] tcg: Sink qemu_madvise call to common code

2021-03-14 Thread Richard Henderson
Move the call out of the N versions of alloc_code_gen_buffer and into tcg_region_init. Signed-off-by: Richard Henderson --- tcg/region.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tcg/region.c b/tcg/region.c index 3ca0d01fa4..994c083343 100644 --- a/tcg/re

[PATCH v2 22/29] tcg: Return the map protection from alloc_code_gen_buffer

2021-03-14 Thread Richard Henderson
Change the interface from a boolean error indication to a negative error vs a non-negative protection. For the moment this is only interface change, not making use of the new data. Signed-off-by: Richard Henderson --- tcg/region.c | 63 +++- 1 fil

[PATCH v2 20/29] tcg: Move in_code_gen_buffer and tests to region.c

2021-03-14 Thread Richard Henderson
Shortly, the full code_gen_buffer will only be visible to region.c, so move in_code_gen_buffer out-of-line. Move the debugging versions of tcg_splitwx_to_{rx,rw} to region.c as well, so that the compiler gets to see the implementation of in_code_gen_buffer. This leaves exactly one use of in_code_

[PATCH v2 15/29] tcg: Move MAX_CODE_GEN_BUFFER_SIZE to tcg-target.h

2021-03-14 Thread Richard Henderson
Remove the ifdef ladder and move each define into the appropriate header file. Signed-off-by: Richard Henderson --- v2: Retain comment about M_C_G_B_S constraint (balaton) --- tcg/aarch64/tcg-target.h | 1 + tcg/arm/tcg-target.h | 1 + tcg/i386/tcg-target.h| 2 ++ tcg/mips/tcg-target.

[PATCH v2 17/29] tcg: Rename region.start to region.after_prologue

2021-03-14 Thread Richard Henderson
Give the field a name reflecting its actual meaning. Signed-off-by: Richard Henderson --- tcg/region.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tcg/region.c b/tcg/region.c index 8e4dd0480b..23261561a1 100644 --- a/tcg/region.c +++ b/tcg/region.c @@ -46,

[PATCH v2 02/29] meson: Split out fpu/meson.build

2021-03-14 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- meson.build | 4 +--- fpu/meson.build | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 fpu/meson.build diff --git a/meson.build b/meson.build index 742f45c8d8..bfa24b836e 100644 --- a/meson.b

[PATCH v2 12/29] accel/tcg: Merge tcg_exec_init into tcg_init_machine

2021-03-14 Thread Richard Henderson
There is only one caller, and shortly we will need access to the MachineState, which tcg_init_machine already has. Signed-off-by: Richard Henderson --- accel/tcg/internal.h | 2 ++ include/sysemu/tcg.h | 2 -- accel/tcg/tcg-all.c | 14 +- accel/tcg/translate-all.c |

[PATCH v2 08/29] accel/tcg: Inline cpu_gen_init

2021-03-14 Thread Richard Henderson
It consists of one function call and has only one caller. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index b905

  1   2   >