Re: [PATCH 3/5] virtio-net: add RSS support for Vhost backends

2022-04-14 Thread Jason Wang
在 2022/4/8 20:28, Maxime Coquelin 写道: This patch introduces new Vhost backend callbacks to support RSS, and makes them called in Virtio-net device. It will be used by Vhost-user backend implementation to support RSS feature. Signed-off-by: Maxime Coquelin --- hw/net/vhost_net-stub.c

Re: [PATCH 0/5] Vhost-user: add Virtio RSS support

2022-04-14 Thread Jason Wang
在 2022/4/8 20:28, Maxime Coquelin 写道: The goal of this series is to add support for Virtio RSS feature to the Vhost-user backend. First patches are preliminary reworks to support variable RSS key and indirection table length. eBPF change only adds checks on whether the key length is 40B, it

Re: [PATCH 2/5] virtio-net: prepare for variable RSS key and indir table lengths

2022-04-14 Thread Jason Wang
在 2022/4/8 20:28, Maxime Coquelin 写道: This patch is a preliminary rework to support RSS with Vhost-user backends. It enables supporting different types of hashes, key lengths and indirection table lengths. This patch does not introduces behavioral changes. Signed-off-by: Maxime Coquelin ---

Re: [PATCH] hw/riscv: virt: fix DT property mmu-type when CPU mmu option is disabled

2022-04-14 Thread Frank Chang
On Thu, Apr 14, 2022 at 11:57 PM Niklas Cassel via wrote: > The device tree property "mmu-type" is currently exported as either > "riscv,sv32" or "riscv,sv48". > > However, the riscv cpu device tree binding [1] has a specific value > "riscv,none" for a HART without a MMU. > > Set the device tree

Re: [PATCH] hw/riscv: virt: fix DT property mmu-type when CPU mmu option is disabled

2022-04-14 Thread Bin Meng
On Thu, Apr 14, 2022 at 11:55 PM Niklas Cassel via wrote: > > The device tree property "mmu-type" is currently exported as either > "riscv,sv32" or "riscv,sv48". > > However, the riscv cpu device tree binding [1] has a specific value > "riscv,none" for a HART without a MMU. > > Set the device

Re:

2022-04-14 Thread Alex Bennée
Eric Auger writes: > Hi Alex, > > On 4/7/22 5:00 PM, Alex Bennée wrote: >> When trying to work out what the virtio-net-tests where doing it was >> hard because the g_test_trap_subprocess redirects all output to >> /dev/null. Lift this restriction by using the appropriate flags so you >> can

RE: [RFC PATCH 0/4] 9pfs: Add 9pfs support for Windows host

2022-04-14 Thread Shi, Guohuai
> -Original Message- > From: Christian Schoenebeck > Sent: 2022年4月14日 19:24 > To: qemu-devel@nongnu.org; Shi, Guohuai > Cc: Bin Meng ; Greg Kurz > Subject: Re: [RFC PATCH 0/4] 9pfs: Add 9pfs support for Windows host > > [Please note: This e-mail is from an EXTERNAL e-mail address] >

Re: [PATCH v2 for-7.1 9/9] nbd: document what is protected by the CoMutexes

2022-04-14 Thread Eric Blake
On Thu, Apr 14, 2022 at 07:57:56PM +0200, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > block/nbd.c | 8 +++- > 1 file changed, 7 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266

Re: [PATCH v2 for-7.1 8/9] nbd: take receive_mutex when reading requests[].receiving

2022-04-14 Thread Eric Blake
On Thu, Apr 14, 2022 at 07:57:55PM +0200, Paolo Bonzini wrote: > requests[].receiving is set by nbd_receive_replies() under the receive_mutex; > Read it under the same mutex as well. Waking up receivers on errors happens > after each reply finishes processing, in nbd_co_receive_one_chunk(). > If

Re: [PATCH v2 for-7.1 7/9] nbd: move s->state under requests_lock

2022-04-14 Thread Eric Blake
On Thu, Apr 14, 2022 at 07:57:54PM +0200, Paolo Bonzini wrote: > Remove the confusing, and most likely wrong, atomics. The only function > that used to be somewhat in a hot path was nbd_client_connected(), > but it is not anymore after the previous patches. > > The same logic is used both to

Re: [PATCH v2 for-7.1 6/9] nbd: code motion and function renaming

2022-04-14 Thread Eric Blake
On Thu, Apr 14, 2022 at 07:57:53PM +0200, Paolo Bonzini wrote: > Prepare for the next patch, so that the diff is less confusing. > > nbd_client_connecting is moved closer to the definition point. > > nbd_client_connecting_wait() is kept only for the reconnection > logic; when it is used to check

Re: [PATCH v2 for-7.1 5/9] nbd: use a QemuMutex to synchronize yanking, reconnection and coroutines

2022-04-14 Thread Eric Blake
On Thu, Apr 14, 2022 at 07:57:52PM +0200, Paolo Bonzini wrote: > The condition for waiting on the s->free_sema queue depends on > both s->in_flight and s->state. The latter is currently using > atomics, but this is quite dubious and probably wrong. > > Because s->state is written in the main

Re: [PATCH v2 for-7.1 4/9] nbd: keep send_mutex/free_sema handling outside nbd_co_do_establish_connection

2022-04-14 Thread Eric Blake
On Thu, Apr 14, 2022 at 07:57:51PM +0200, Paolo Bonzini wrote: > Elevate s->in_flight early so that other incoming requests will wait > on the CoQueue in nbd_co_send_request; restart them after getting back > from nbd_reconnect_attempt. This could be after the reconnect timer or >

Re: [PATCH v2 for-7.1 1/9] nbd: safeguard against waking up invalid coroutine

2022-04-14 Thread Eric Blake
On Thu, Apr 14, 2022 at 07:57:48PM +0200, Paolo Bonzini wrote: > The .reply_possible field of s->requests is never set to false. This is > not a problem as it is only a safeguard to detect protocol errors, > but it's sloppy. In fact, the field is actually not necessary at all, > because

[PATCH v2 for-7.1 7/9] nbd: move s->state under requests_lock

2022-04-14 Thread Paolo Bonzini
Remove the confusing, and most likely wrong, atomics. The only function that used to be somewhat in a hot path was nbd_client_connected(), but it is not anymore after the previous patches. The same logic is used both to check if a request had to be reissued and also in

[PATCH v2 for-7.1 8/9] nbd: take receive_mutex when reading requests[].receiving

2022-04-14 Thread Paolo Bonzini
requests[].receiving is set by nbd_receive_replies() under the receive_mutex; Read it under the same mutex as well. Waking up receivers on errors happens after each reply finishes processing, in nbd_co_receive_one_chunk(). If there is no currently-active reply, there are two cases: * either

[PATCH v2 for-7.1 6/9] nbd: code motion and function renaming

2022-04-14 Thread Paolo Bonzini
Prepare for the next patch, so that the diff is less confusing. nbd_client_connecting is moved closer to the definition point. nbd_client_connecting_wait() is kept only for the reconnection logic; when it is used to check if a request has to be reissued, use the renamed function

[PATCH v2 for-7.1 5/9] nbd: use a QemuMutex to synchronize yanking, reconnection and coroutines

2022-04-14 Thread Paolo Bonzini
The condition for waiting on the s->free_sema queue depends on both s->in_flight and s->state. The latter is currently using atomics, but this is quite dubious and probably wrong. Because s->state is written in the main thread too, for example by the yank callback, it cannot be protected by a

[PATCH v2 for-7.1 9/9] nbd: document what is protected by the CoMutexes

2022-04-14 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- block/nbd.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/block/nbd.c b/block/nbd.c index 31c684772e..d0d94b40bd 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -81,12 +81,18 @@ typedef struct BDRVNBDState { NBDClientRequest

[PATCH v2 for-7.1 1/9] nbd: safeguard against waking up invalid coroutine

2022-04-14 Thread Paolo Bonzini
The .reply_possible field of s->requests is never set to false. This is not a problem as it is only a safeguard to detect protocol errors, but it's sloppy. In fact, the field is actually not necessary at all, because .coroutine is set to NULL in NBD_FOREACH_REPLY_CHUNK after receiving the last

[PATCH v2 for-7.1 3/9] nbd: remove peppering of nbd_client_connected

2022-04-14 Thread Paolo Bonzini
It is unnecessary to check nbd_client_connected() because every time s->state is moved out of NBD_CLIENT_CONNECTED the socket is shut down and all coroutines are resumed. The only case where it was actually needed is when the NBD server disconnects and there is no reconnect-delay. In that case,

[PATCH v2 for-7.1 4/9] nbd: keep send_mutex/free_sema handling outside nbd_co_do_establish_connection

2022-04-14 Thread Paolo Bonzini
Elevate s->in_flight early so that other incoming requests will wait on the CoQueue in nbd_co_send_request; restart them after getting back from nbd_reconnect_attempt. This could be after the reconnect timer or nbd_cancel_in_flight have cancelled the attempt, so there is no need anymore to cancel

[PATCH v2 for-7.1 0/9] nbd: actually make s->state thread-safe

2022-04-14 Thread Paolo Bonzini
The main point of this series is patch 7, which removes the dubious and probably wrong use of atomics in block/nbd.c. This in turn is enabled mostly by the cleanups in patches 3-5. Together, they introduce a QemuMutex that synchronizes the NBD client coroutines, the reconnect_delay timer and

[PATCH v2 for-7.1 2/9] nbd: mark more coroutine_fns

2022-04-14 Thread Paolo Bonzini
Several coroutine functions in block/nbd.c are not marked as such. This patch adds a few more markers; it is not exhaustive, but it focuses especially on: - places that wake other coroutines, because aio_co_wake() has very different semantics inside a coroutine (queuing after yield vs. entering

Re: [PATCH v2 27/39] util/log: Introduce qemu_set_log_filename_flags

2022-04-14 Thread Richard Henderson
On 4/14/22 07:56, Alex Bennée wrote: #ifdef CONFIG_TRACE_LOG -qemu_loglevel |= LOG_TRACE; +log_flags |= LOG_TRACE; #endif +qemu_loglevel = log_flags; + This looked weird - so should we consider a qatomic_set here to avoid an inconsistent set of flags being read non-atomically

Re: [RFC PATCH] tests/qtest: pass stdout/stderr down to subtests

2022-04-14 Thread Eric Auger
Hi Alex, On 4/7/22 5:00 PM, Alex Bennée wrote: > When trying to work out what the virtio-net-tests where doing it was > hard because the g_test_trap_subprocess redirects all output to > /dev/null. Lift this restriction by using the appropriate flags so you > can see something similar to what the

Re: [PATCH for-7.1] hw/block/fdc-sysbus: Always mark sysbus floppy controllers as not having DMA

2022-04-14 Thread Peter Maydell
On Tue, 12 Apr 2022 at 17:49, Peter Maydell wrote: > > The sysbus floppy controllers (devices sysbus-fdc and sun-fdtwo) > don't support DMA. The core floppy controller code expects this to > be indicated by setting FDCtrl::dma_chann to -1. This used to be > done in the device instance_init

[PATCH for-7.1 3/5] machine: add mem compound property

2022-04-14 Thread Paolo Bonzini
Make -m syntactic sugar for a compound property "-machine mem.{size,max-size,slots}". The new property does not have the magic conversion to megabytes of unsuffixed arguments, and also does not understand that "0" means the default size (you have to leave it out to get the default). This means

[PATCH for-7.1 1/5] machine: use QAPI struct for boot configuration

2022-04-14 Thread Paolo Bonzini
As part of converting -boot to a property with a QAPI type, define the struct and use it throughout QEMU to access boot configuration. machine_boot_parse takes care of doing the QemuOpts->QAPI conversion by hand, for now. Signed-off-by: Paolo Bonzini --- hw/arm/nseries.c| 2 +-

[PATCH for-7.1 2/5] machine: add boot compound property

2022-04-14 Thread Paolo Bonzini
Make -boot syntactic sugar for a compound property "-machine boot.{order,menu,...}". machine_boot_parse is replaced by the setter for the property. Signed-off-by: Paolo Bonzini --- hw/core/machine.c | 99 - include/hw/boards.h | 1 - softmmu/vl.c

[PATCH for-7.1 5/5] machine: move more memory validation to Machine object

2022-04-14 Thread Paolo Bonzini
This allows setting memory properties without going through vl.c, and have them validated just the same. Signed-off-by: Paolo Bonzini --- hw/core/machine.c | 21 +++-- softmmu/vl.c | 17 +++-- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git

[PATCH for-7.1 4/5] machine: make memory-backend a link property

2022-04-14 Thread Paolo Bonzini
Handle HostMemoryBackend creation and setting of ms->ram entirely in machine_run_board_init. Signed-off-by: Paolo Bonzini --- hw/core/machine.c | 70 ++--- hw/core/numa.c | 2 +- hw/sparc/sun4m.c| 5 ++-- include/hw/boards.h | 4 +--

[PATCH for-7.1 0/5] Move memory and boot to -machine

2022-04-14 Thread Paolo Bonzini
As the next step in turning command line options into shortcuts, this series does -boot and -m. It also makes -M memory-backend a link instead of special casing it in vl.c, and makes the MachineState validate memory configuration without needing help from vl.c. Paolo Bonzini (5): machine: use

Re: [PATCH for-7.1] hw/block/fdc-sysbus: Always mark sysbus floppy controllers as not having DMA

2022-04-14 Thread Philippe Mathieu-Daudé
On 12/4/22 18:49, Peter Maydell wrote: The sysbus floppy controllers (devices sysbus-fdc and sun-fdtwo) don't support DMA. The core floppy controller code expects this to be indicated by setting FDCtrl::dma_chann to -1. This used to be done in the device instance_init functions

Re: [PATCH v2 39/39] util/log: Support per-thread log files

2022-04-14 Thread Richard Henderson
On 4/14/22 08:35, Alex Bennée wrote: +/** + * valid_filename_template: + * + * Validate the filename template. Require %d if per_thread, allow it + * otherwise; require no other % within the template. + * Return 0 if invalid, 1 if stderr, 2 if strdup, 3 if pid printf. From a neatness point

Re: [PATCH] hw/arm/smmuv3: Pass the real perm to returned IOMMUTLBEntry in smmuv3_translate()

2022-04-14 Thread Eric Auger
Hi Chenxiang, On 4/7/22 9:57 AM, chenxiang via wrote: > From: Xiang Chen > > In function memory_region_iommu_replay(), it decides to notify() or not > according to the perm of returned IOMMUTLBEntry. But for smmuv3, the > returned perm is always IOMMU_NONE even if the translation success. I

Re: [PATCH v2 32/39] util/log: Rename logfilename to global_filename

2022-04-14 Thread Richard Henderson
On 4/14/22 08:18, Alex Bennée wrote: Richard Henderson writes: Rename to emphasize this is the file-scope global variable. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- util/log.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git

[PATCH] hw/riscv: virt: fix DT property mmu-type when CPU mmu option is disabled

2022-04-14 Thread Niklas Cassel via
The device tree property "mmu-type" is currently exported as either "riscv,sv32" or "riscv,sv48". However, the riscv cpu device tree binding [1] has a specific value "riscv,none" for a HART without a MMU. Set the device tree property "mmu-type" to "riscv,none" when the CPU mmu option is disabled

Re: [PATCH v2 39/39] util/log: Support per-thread log files

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Add a new log flag, tid, to turn this feature on. > Require the log filename to be set, and to contain %d. > > Do not allow tid to be turned off once it is on, nor let > the filename be change thereafter. This avoids the need > for signalling each thread to re-open

Re: [PATCH] tests/qtest: Move the fuzz tests to x86 only

2022-04-14 Thread Laurent Vivier
On 14/04/2022 15:01, Thomas Huth wrote: The fuzz tests are currently scheduled for all targets, but their setup code limits the run to "i386", so that these tests always show "SKIP" on other targets. Move it to the right x86 list in meson.build, then we can drop the architecture check during

Re: [PATCH v2 38/39] util/log: Limit RCUCloseFILE to file closing

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Use FILE* for global_file. We can perform an rcu_read on that > just as easily as RCUCloseFILE*. This simplifies a couple of > places, where previously we required taking the rcu_read_lock > simply to avoid racing to dereference RCUCloseFile->fd. > > Only allocate

Re: [PATCH v2 36/39] util/log: Combine two logfile closes

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Merge the close from the changed_name block with the close > from the !need_to_open_file block. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PATCH v2 37/39] util/log: Rename QemuLogFile to RCUCloseFILE

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > s/QemuLogFile/RCUCloseFILE/ > s/qemu_logfile_free/rcu_close_file/ > > Emphasize that this is only a carrier for passing a pointer > to call_rcu for closing, and not the real logfile. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson

Re: [PATCH v2 35/39] util/log: Hoist the eval of is_daemonized in qemu_set_log_internal

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Only call is_daemonized once. > We require the result on all paths after this point. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PATCH v2 34/39] util/log: Rename qemu_logfile_mutex to global_mutex

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Rename to emphasize this covers the file-scope global variables. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PATCH v2 33/39] util/log: Rename qemu_logfile to global_file

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Rename to emphasize this is the file-scope global variable. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PATCH v2 32/39] util/log: Rename logfilename to global_filename

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Rename to emphasize this is the file-scope global variable. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > util/log.c | 13 ++--- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/util/log.c

Re: [PATCH v2 30/39] softmmu: Use qemu_set_log_filename_flags

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Perform all logfile setup at startup in one step. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PATCH v2 31/39] util/log: Remove qemu_log_close

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > The only real use is in cpu_abort, where we have just > flushed the file via qemu_log_unlock, and are just about > to force-crash the application via abort. We do not > really need to close the FILE before the abort. > > The two uses in test-logging.c can be

Re: [PATCH v2 29/39] linux-user: Use qemu_set_log_filename_flags

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Perform all logfile setup in one step. > > Signed-off-by: Richard Henderson > --- > linux-user/main.c | 11 +-- > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/linux-user/main.c b/linux-user/main.c > index d263b2a669..0297ae8321 100644 >

Re: [PATCH v2 28/39] bsd-user: Use qemu_set_log_filename_flags

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Perform all logfile setup in one step. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PATCH v2 27/39] util/log: Introduce qemu_set_log_filename_flags

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Provide a function to set both filename and flags at > the same time. This is the common case at startup. > > Signed-off-by: Richard Henderson > --- > v2: Return bool, per recommendations in qapi/error.h (phil). > --- > include/qemu/log.h | 1 + > util/log.c

[PATCH] remove -writeconfig

2022-04-14 Thread Paolo Bonzini
Like -set and -readconfig, it would not really be too hard to extend -writeconfig to parsing mechanisms other than QemuOpts. However, the uses of -writeconfig are substantially more limited, as it is generally easier to write the configuration by hand in the first place. In addition, -writeconfig

Re: [PATCH v2 26/39] sysemu/os-win32: Test for and use _lock_file/_unlock_file

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > The bug referenced in os-win32.h was fixed in mingw-w64 v6. > > According to repology, version 5 used by ubuntu 18, which is > not yet out of support, so provide a meson link test for it. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex

Re: [PATCH v2 25/39] include/qemu/log: Move entire implementation out-of-line

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Move QemuLogFile, qemu_logfile, and all inline functions into qemu/log.c. > No need to expose these implementation details in the api. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée > --- > include/qemu/log.h| 38

Re: [PATCH v2 23/39] tests/unit: Do not reference QemuLogFile directly

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Use qemu_log_lock/unlock instead of the raw rcu_read. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PATCH 1/1] qemu-img: properly list formats which have consistency check implemented

2022-04-14 Thread Kevin Wolf
Am 07.04.2022 um 10:39 hat Denis V. Lunev geschrieben: > Simple grep for the .bdrv_co_check callback presence gives the following > list of block drivers > * QED > * VDI > * VHDX > * VMDK > * Parallels > which have this callback. The presense of the callback means that > consistency check is

Re: [PATCH v2 19/39] util/log: Remove qemu_log_flush

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > All uses flush output immediately before or after qemu_log_unlock. > Instead of a separate call, move the flush into qemu_log_unlock. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PATCH v2 22/39] linux-user: Expand log_page_dump inline

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > We have extra stuff to log at the same time. > Hoist the qemu_log_lock/unlock to the caller and use fprintf. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PATCH v2 19/39] util/log: Remove qemu_log_flush

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > All uses flush output immediately before or after qemu_log_unlock. > Instead of a separate call, move the flush into qemu_log_unlock. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PATCH v2 21/39] bsd-user: Expand log_page_dump inline

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > We have extra stuff to log at the same time. > Hoist the qemu_log_trylock/unlock to the caller and use fprintf. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PATCH v2 20/39] util/log: Drop call to setvbuf

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Now that the log buffer is flushed after every qemu_log_unlock, > which includes every call to qemu_log, we do not need to force > line buffering (or unbuffering for windows). Block buffer the > entire loggable unit. > > Signed-off-by: Richard Henderson

Re: [PATCH v2 18/39] util/log: Mark qemu_log_trylock as G_GNUC_WARN_UNUSED_RESULT

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Now that all uses have been updated, consider a missing > test of the result of qemu_log_trylock a bug and Werror. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PATCH v2 17/39] util/log: Drop return value from qemu_log

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > The only user of this feature, tcg_dump_ops, has been > converted to use fprintf directly. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

[PATCH v1] virtio/virtio.c: include virtio prefix in error message

2022-04-14 Thread Moteen Shah
From: Moteen Shah The error message in virtio_init_region_cache() is given a prefix virtio. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/230 Buglink: https://bugs.launchpad.net/qemu/+bug/1919021`` Signed-off-by: Moteen Shah --- hw/virtio/virtio.c | 6 +++--- 1 file changed, 3

Re: [PATCH v2 15/39] target/nios2: Remove log_cpu_state from reset

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > This is redundant with the logging done in cpu_common_reset. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PATCH v2 14/39] accel/tcg: Use cpu_dump_state between qemu_log_trylock/unlock

2022-04-14 Thread Alex Bennée
Richard Henderson writes: > Inside log_cpu_state, we perform qemu_log_trylock/unlock, which need > not be done if we have already performed the lock beforehand. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

[PATCH] tests/qtest: Move the fuzz tests to x86 only

2022-04-14 Thread Thomas Huth
The fuzz tests are currently scheduled for all targets, but their setup code limits the run to "i386", so that these tests always show "SKIP" on other targets. Move it to the right x86 list in meson.build, then we can drop the architecture check during runtime, too. Signed-off-by: Thomas Huth

Re: [PATCH] tests/qtest: Run the fuzz-sdcard-test only on i386 and x86_64

2022-04-14 Thread Thomas Huth
On 14/04/2022 14.28, Thomas Huth wrote: The fuzz-sdcard-test is currently scheduled for all targets, but the code limits itself to "i386". Move it to the right list in meson.build and allow it to be run on "x86_64", too. While we're at it, also clean up the wrong indentation in

Re: XIVE VFIO kernel resample failure in INTx mode under heavy load

2022-04-14 Thread Cédric Le Goater
After re-reading what I just wrote, I am leaning towards disabling use of KVM_CAP_IRQFD_RESAMPLE as it seems last worked on POWER8 and never since :) Did I miss something in the picture (hey Cedric)? How about disabling it like this? = diff --git a/hw/ppc/spapr_pci.c

Re: XIVE VFIO kernel resample failure in INTx mode under heavy load

2022-04-14 Thread Cédric Le Goater
Hello Alexey, Thanks for taking over. On 4/13/22 06:56, Alexey Kardashevskiy wrote: On 3/17/22 06:16, Cédric Le Goater wrote: Timothy, On 3/16/22 17:29, Cédric Le Goater wrote: Hello, I've been struggling for some time with what is looking like a potential bug in QEMU/KVM on the

[PATCH] tests/qtest: Run the fuzz-sdcard-test only on i386 and x86_64

2022-04-14 Thread Thomas Huth
The fuzz-sdcard-test is currently scheduled for all targets, but the code limits itself to "i386". Move it to the right list in meson.build and allow it to be run on "x86_64", too. While we're at it, also clean up the wrong indentation in fuzz-sdcard-test.c (it was using 3 spaces instead of 4 in

Re: Support for x86_64 on aarch64 emulation

2022-04-14 Thread Redha Gouicem
I will start working on a cleaner patch to allow the correct memory ordering enforcement to be implemented, as my current PoC is very hacky. I'll post it to the mailing list as soon as I'm done. Redha On 08/04/2022 17:27, Richard Henderson wrote: > On 4/8/22 05:21, Redha Gouicem wrote: >> We are

Re: [PATCH] docs: Correct the default thread-pool-size

2022-04-14 Thread Vivek Goyal
On Wed, Apr 13, 2022 at 12:20:54PM +0800, Liu Yiding wrote: > Refer to 26ec190964 virtiofsd: Do not use a thread pool by default > > Signed-off-by: Liu Yiding Looks good. Our default used to be --thread-pool-size=64. But we changed it to using no thread pool because on lower end of workloads it

[PATCH] tests/qtest: Enable more tests for the "mipsel" target

2022-04-14 Thread Thomas Huth
Allow the same set of tests for all MIPS targets, so that "mipsel" now gets some additional test coverage, too. While we're at it, simplify the definitions for qtests_mips64 and qtests_mips64el. Signed-off-by: Thomas Huth --- tests/qtest/endianness-test.c | 1 + tests/qtest/meson.build |

Re: [RFC PATCH 0/4] 9pfs: Add 9pfs support for Windows host

2022-04-14 Thread Christian Schoenebeck
On Mittwoch, 13. April 2022 05:30:57 CEST Shi, Guohuai wrote: > > We have 3 fs drivers: local, synth, proxy. I don't mind about proxy, it is > > in bad shape and we will probably deprecate it in near future anyway. > > But it would be good to have support for the synth driver, because we are > >

[RFC 15/18] vfio/iommufd: Implement iommufd backend

2022-04-14 Thread Yi Liu
Add the iommufd backend. The IOMMUFD container class is implemented based on the new /dev/iommu user API. This backend obviously depends on CONFIG_IOMMUFD. So far, the iommufd backend doesn't support live migration and cache coherency yet due to missing support in the host kernel meaning that

[RFC 11/18] vfio/ccw: Use vfio_[attach/detach]_device

2022-04-14 Thread Yi Liu
From: Eric Auger Let the vfio-ccw device use vfio_attach_device() and vfio_detach_device(), hence hiding the details of the used IOMMU backend. Also now all the devices have been migrated to use the new vfio_attach_device/vfio_detach_device API, let's turn the legacy functions into static

[RFC 10/18] vfio/ap: Use vfio_[attach/detach]_device

2022-04-14 Thread Yi Liu
From: Eric Auger Let the vfio-ap device use vfio_attach_device() and vfio_detach_device(), hence hiding the details of the used IOMMU backend. Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- hw/vfio/ap.c | 62 1 file changed, 9

[RFC 18/18] vfio/pci: Add an iommufd option

2022-04-14 Thread Yi Liu
From: Eric Auger This auto/on/off option allows the user to force a the select the iommu BE (iommufd or legacy). Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- hw/vfio/pci.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c

[RFC 17/18] vfio/as: Allow the selection of a given iommu backend

2022-04-14 Thread Yi Liu
From: Eric Auger Now we support two types of iommu backends, let's add the capability to select one of them. This is based on a VFIODevice auto/on/off iommu_be field. This field is likely to be forced to a given value or set by a device option. Signed-off-by: Eric Auger Signed-off-by: Yi Liu

[RFC 07/18] vfio: Add base object for VFIOContainer

2022-04-14 Thread Yi Liu
Qomify the VFIOContainer object which acts as a base class for a container. This base class is derived into the legacy VFIO container and later on, into the new iommufd based container. The base class implements generic code such as code related to memory_listener and address space management

[RFC 16/18] vfio/iommufd: Add IOAS_COPY_DMA support

2022-04-14 Thread Yi Liu
Compared with legacy vfio container BE, one of the benefits provided by iommufd is to reduce the redundant page pinning on kernel side through the usage of IOAS_COPY_DMA. For iommufd containers within the same address space, IOVA mappings can be copied from a source container to destination

[RFC 14/18] hw/iommufd: Creation

2022-04-14 Thread Yi Liu
Introduce iommufd utility library which can be compiled out with CONFIG_IOMMUFD configuration. This code is bound to be called by several subsystems: vdpa, and vfio. Co-authored-by: Eric Auger Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- MAINTAINERS | 7 ++

[RFC 09/18] vfio/platform: Use vfio_[attach/detach]_device

2022-04-14 Thread Yi Liu
From: Eric Auger Let the vfio-platform device use vfio_attach_device() and vfio_detach_device(), hence hiding the details of the used IOMMU backend. Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- hw/vfio/platform.c | 42 ++ 1 file changed, 2

[RFC 08/18] vfio/container: Introduce vfio_[attach/detach]_device

2022-04-14 Thread Yi Liu
From: Eric Auger We want the VFIO devices to be able to use two different IOMMU callbacks, the legacy VFIO one and the new iommufd one. Introduce vfio_[attach/detach]_device which aim at hiding the underlying IOMMU backend (IOCTLs, datatypes, ...). Once vfio_attach_device completes, the device

[RFC 12/18] vfio/container-obj: Introduce [attach/detach]_device container callbacks

2022-04-14 Thread Yi Liu
From: Eric Auger Let's turn attach/detach_device as container callbacks. That way, their implementation can be easily customized for a given backend. For the time being, only the legacy container is supported. Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- hw/vfio/as.c

[RFC 02/18] linux-headers: Import latest vfio.h and iommufd.h

2022-04-14 Thread Yi Liu
From: Eric Auger Imported from https://github.com/luxis1999/iommufd/tree/iommufd-v5.17-rc6 Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- linux-headers/linux/iommufd.h | 223 ++ linux-headers/linux/vfio.h| 84 + 2 files changed, 307

[RFC 04/18] vfio/pci: Use vbasedev local variable in vfio_realize()

2022-04-14 Thread Yi Liu
From: Eric Auger Using a VFIODevice handle local variable to improve the code readability. no functional change intended Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- hw/vfio/pci.c | 49 + 1 file changed, 25 insertions(+), 24

[RFC 05/18] vfio/common: Rename VFIOGuestIOMMU::iommu into ::iommu_mr

2022-04-14 Thread Yi Liu
Rename VFIOGuestIOMMU iommu field into iommu_mr. Then it becomes clearer it is an IOMMU memory region. no functional change intended Signed-off-by: Yi Liu --- hw/vfio/common.c | 16 include/hw/vfio/vfio-common.h | 2 +- 2 files changed, 9 insertions(+), 9

[RFC 13/18] vfio/container-obj: Introduce VFIOContainer reset callback

2022-04-14 Thread Yi Liu
From: Eric Auger Reset implementation depends on the container backend. Let's introduce a VFIOContainer class function and register a generic reset handler that will be able to call the right reset function depending on the container type. Also, let's move the registration/unregistration to a

[RFC 00/18] vfio: Adopt iommufd

2022-04-14 Thread Yi Liu
With the introduction of iommufd[1], the linux kernel provides a generic interface for userspace drivers to propagate their DMA mappings to kernel for assigned devices. This series does the porting of the VFIO devices onto the /dev/iommu uapi and let it coexist with the legacy implementation.

[RFC 03/18] hw/vfio/pci: fix vfio_pci_hot_reset_result trace point

2022-04-14 Thread Yi Liu
From: Eric Auger Properly output the errno string. Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- hw/vfio/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 67a183f17b..e26e65bb1f 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c

[RFC 01/18] scripts/update-linux-headers: Add iommufd.h

2022-04-14 Thread Yi Liu
From: Eric Auger Update the script to import iommufd.h Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index

Re: [PATCH] docs: Correct the default thread-pool-size

2022-04-14 Thread liuyd.f...@fujitsu.com
[+cc dgilb...@redhat.com stefa...@redhat.com] On 4/14/22 1:05 PM, liuyd.f...@fujitsu.com wrote: > [+cc vgo...@redhat.com] > > On 4/13/22 12:20 PM, Liu Yiding wrote: >> Refer to 26ec190964 virtiofsd: Do not use a thread pool by default >> >> Signed-off-by: Liu Yiding >> --- >>

[PATCH v5 3/3] tests/qtest/libqos: Add generic pci host bridge in arm-virt machine

2022-04-14 Thread Eric Auger
Up to now the virt-machine node contains a virtio-mmio node. However no driver produces any PCI interface node. Hence, PCI tests cannot be run with aarch64 binary. Add a GPEX driver node that produces a pci interface node. This latter then can be consumed by all the pci tests. One of the first

[PATCH v5 2/3] tests/qtest/libqos: Skip hotplug tests if pci root bus is not hotpluggable

2022-04-14 Thread Eric Auger
ARM does not not support hotplug on pcie.0. Add a flag on the bus which tells if devices can be hotplugged and skip hotplug tests if the bus cannot be hotplugged. This is a temporary solution to enable the other pci tests on aarch64. Signed-off-by: Eric Auger Acked-by: Thomas Huth Reviewed-by:

[PATCH v5 0/3] qtests/libqos: Allow PCI tests to be run with virt-machine

2022-04-14 Thread Eric Auger
Up to now the virt-machine node only contains a virtio-mmio driver node but no driver that eventually produces any pci-bus interface. Hence, PCI libqos tests cannot be run with aarch64 binary. This series brings the pieces needed to be able to run PCI tests with the aarch64 binary: a

[PATCH v5 1/3] tests/qtest/libqos/pci: Introduce pio_limit

2022-04-14 Thread Eric Auger
At the moment the IO space limit is hardcoded to QPCI_PIO_LIMIT = 0x1. When accesses are performed to a bar, the base address of this latter is compared against the limit to decide whether we perform an IO or a memory access. On ARM, we cannot keep this PIO limit as the arm-virt machine uses

Re: [PATCH v5 1/4] qapi/machine.json: Add cluster-id

2022-04-14 Thread wangyanan (Y)
On 2022/4/14 15:56, Gavin Shan wrote: Hi Yanan, On 4/14/22 10:27 AM, wangyanan (Y) wrote: On 2022/4/14 8:06, Gavin Shan wrote: On 4/13/22 7:49 PM, wangyanan (Y) wrote: On 2022/4/3 22:59, Gavin Shan wrote: This adds cluster-id in CPU instance properties, which will be used by arm/virt

  1   2   >