[PATCH v11 21/21] job: remove unused functions

2022-08-26 Thread Emanuele Giuseppe Esposito
These public functions are not used anywhere, thus can be dropped. Also, since this is the final job API that doesn't use AioContext lock and replaces it with job_lock, adjust all remaining function documentation to clearly specify if the job lock is taken or not. Also document the locking require

[PATCH v11 11/21] jobs: group together API calls under the same job lock

2022-08-26 Thread Emanuele Giuseppe Esposito
Now that the API offers also _locked() functions, take advantage of it and give also the caller control to take the lock and call _locked functions. This makes sense especially when we have for loops, because it makes no sense to have: for(job = job_next(); ...) where each job_next() takes the l

[PATCH v11 20/21] blockjob: remove unused functions

2022-08-26 Thread Emanuele Giuseppe Esposito
These public functions are not used anywhere, thus can be dropped. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf --- blockjob.c | 16 ++-- include/block/blockjob.h | 31 --- 2 files changed,

[PATCH v11 09/21] jobs: use job locks also in the unit tests

2022-08-26 Thread Emanuele Giuseppe Esposito
Add missing job synchronization in the unit tests, with explicit locks. We are deliberately using _locked functions wrapped by a guard instead of a normal call because the normal call will be removed in future, as the only usage is limited to the tests. In other words, if a function like job_paus

[PATCH v11 13/21] jobs: protect job.aio_context with BQL and job_mutex

2022-08-26 Thread Emanuele Giuseppe Esposito
In order to make it thread safe, implement a "fake rwlock", where we allow reads under BQL *or* job_mutex held, but writes only under BQL *and* job_mutex. The only write we have is in child_job_set_aio_ctx, which always happens under drain (so the job is paused). For this reason, introduce job_set

Re: [PATCH v6 07/10] parallels: Move check of cluster outside image to a separate function

2022-08-26 Thread Alexander Ivanov
On 26.08.2022 15:08, Denis V. Lunev wrote: On 25.08.2022 16:31, Alexander Ivanov wrote: We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper. Signed-off-by: Alexander Ivanov ---   block/para

[PATCH v11 18/21] job.c: enable job lock/unlock and remove Aiocontext locks

2022-08-26 Thread Emanuele Giuseppe Esposito
Change the job_{lock/unlock} and macros to use job_mutex. Now that they are not nop anymore, remove the aiocontext to avoid deadlocks. Therefore: - when possible, remove completely the aiocontext lock/unlock pair - if it is used by some other function too, reduce the locking section as much as

Re: [PATCH 40/51] chardev/char-file: Add FILE_SHARE_WRITE when openning the file for win32

2022-08-26 Thread Marc-André Lureau
Hi On Fri, Aug 26, 2022 at 5:16 PM Bin Meng wrote: > On Thu, Aug 25, 2022 at 3:59 PM Marc-André Lureau > wrote: > > > > Hi > > > > On Wed, Aug 24, 2022 at 1:43 PM Bin Meng wrote: > > > > > > From: Xuzhou Cheng > > > > > > The combination of GENERIC_WRITE and FILE_SHARE_READ options does > > >

[PATCH v11 06/21] job: move and update comments from blockjob.c

2022-08-26 Thread Emanuele Giuseppe Esposito
This comment applies more on job, it was left in blockjob as in the past the whole job logic was implemented there. Note: at this stage, job_{lock/unlock} and job lock guard macros are *nop*. No functional change intended. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Vladimir Sementso

Re: [PATCH v6 08/10] parallels: Move check of leaks to a separate function

2022-08-26 Thread Denis V. Lunev
On 25.08.2022 16:31, Alexander Ivanov wrote: We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper. Signed-off-by: Alexander Ivanov --- block/parallels.c | 84 +

Re: [PATCH 09/51] fsdev/virtfs-proxy-helper: Use g_mkdir_with_parents()

2022-08-26 Thread Christian Schoenebeck
On Freitag, 26. August 2022 14:38:27 CEST Bin Meng wrote: > On Fri, Aug 26, 2022 at 7:16 PM Christian Schoenebeck > > wrote: > > On Freitag, 26. August 2022 12:30:20 CEST Bin Meng wrote: > > > On Fri, Aug 26, 2022 at 6:09 PM Christian Schoenebeck > > > > > > wrote: > > > > On Mittwoch, 24. Augu

Re: [PATCH v6 07/10] parallels: Move check of cluster outside image to a separate function

2022-08-26 Thread Denis V. Lunev
On 26.08.2022 15:23, Alexander Ivanov wrote: On 26.08.2022 15:08, Denis V. Lunev wrote: On 25.08.2022 16:31, Alexander Ivanov wrote: We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper. Sign

Re: [RFC PATCH 1/2] softmmu/memory: add missing begin/commit callback calls

2022-08-26 Thread Emanuele Giuseppe Esposito
Am 18/08/2022 um 21:34 schrieb Peter Xu: > On Tue, Aug 16, 2022 at 06:12:49AM -0400, Emanuele Giuseppe Esposito wrote: >> kvm listeners now need ->commit callback in order to actually send >> the ioctl to the hypervisor. Therefore, add missing callers around >> address_space_set_flatview(), whic

Re: [PATCH 0/1] Update vfio-user module to the latest

2022-08-26 Thread Jag Raman
On Aug 7, 2022, at 6:39 AM, John Levon mailto:le...@movementarian.org>> wrote: On Fri, Aug 05, 2022 at 09:24:56AM +0100, Daniel P. Berrangé wrote: For the RFC QEMU user space eBPF support, https://lore.kernel.org/all/20220617073630.535914-6-chen.zh...@intel.com/T/ Maybe introduce the libubpf.s

Re: [RFC PATCH 2/2] kvm/kvm-all.c: listener should delay kvm_vm_ioctl to the commit phase

2022-08-26 Thread Emanuele Giuseppe Esposito
Am 22/08/2022 um 11:08 schrieb Cornelia Huck: > On Tue, Aug 16 2022, Emanuele Giuseppe Esposito wrote: > >> Instead of sending a single ioctl every time ->region_* or ->log_* >> callbacks are called, "queue" all memory regions in a list that will >> be emptied only when committing. >> >> This

Re: [RFC PATCH 2/2] kvm/kvm-all.c: listener should delay kvm_vm_ioctl to the commit phase

2022-08-26 Thread Emanuele Giuseppe Esposito
Am 22/08/2022 um 16:10 schrieb Peter Xu: > On Thu, Aug 18, 2022 at 09:55:20PM -0300, Leonardo Bras Soares Passos wrote: >> On Thu, Aug 18, 2022 at 5:05 PM Peter Xu wrote: >>> >>> On Tue, Aug 16, 2022 at 06:12:50AM -0400, Emanuele Giuseppe Esposito wrote: +static void kvm_memory_region_node

[PATCH for-7.2 v4 00/21] QMP/HMP: add 'dumpdtb' and 'info fdt' commands

2022-08-26 Thread Daniel Henrique Barboza
Hi, In this new version we have changes based on review comments from v3. I've also added a new patch (21) that adds an extra parameter called 'textformat' to the dumpdtb QMP command. Using this parameter will write the FDT in text format, using DTS compatible formatting like the 'info fdt' comma

[PATCH for-7.2 v4 03/21] hw/nios2: set machine->fdt in nios2_load_dtb()

2022-08-26 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for all nios2 machines that uses nios2_load_dtb(). Cc: Chris Wulff Cc: Marek Vasut Signed-off-by: Daniel Henrique Barboza --- hw/nios2/boot.c | 11 ++- hw/nios2/meson.build | 2 +- 2 files changed, 11 insertions(+

[PATCH for-7.2 v4 02/21] hw/microblaze: set machine->fdt in microblaze_load_dtb()

2022-08-26 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for all microblaze machines that uses microblaze_load_dtb(). Cc: Edgar E. Iglesias Signed-off-by: Daniel Henrique Barboza --- hw/microblaze/boot.c | 11 ++- hw/microblaze/meson.build | 2 +- 2 files changed, 11 ins

[PATCH for-7.2 v4 07/21] hw/ppc: set machine->fdt in xilinx_load_device_tree()

2022-08-26 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for the virtex_ml507 machine. Cc: Edgar E. Iglesias Signed-off-by: Daniel Henrique Barboza --- hw/ppc/virtex_ml507.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/

[PATCH for-7.2 v4 01/21] hw/arm: do not free machine->fdt in arm_load_dtb()

2022-08-26 Thread Daniel Henrique Barboza
At this moment, arm_load_dtb() can free machine->fdt when binfo->dtb_filename is NULL. If there's no 'dtb_filename', 'fdt' will be retrieved by binfo->get_dtb(). If get_dtb() returns machine->fdt, as is the case of machvirt_dtb() from hw/arm/virt.c, fdt now has a pointer to machine->fdt. And, in th

[PATCH for-7.2 v4 08/21] hw/ppc: set machine->fdt in pegasos2_machine_reset()

2022-08-26 Thread Daniel Henrique Barboza
We'll introduce QMP/HMP commands that requires machine->fdt to be set properly. Cc: BALATON Zoltan Cc: qemu-...@nongnu.org Signed-off-by: Daniel Henrique Barboza --- hw/ppc/pegasos2.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c index 61f42639

[PATCH for-7.2 v4 06/21] hw/ppc: set machine->fdt in sam460ex_load_device_tree()

2022-08-26 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for the sam460ex machine. Cc: BALATON Zoltan Signed-off-by: Daniel Henrique Barboza --- hw/ppc/sam460ex.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index 035

[PATCH for-7.2 v4 16/21] device_tree.c: support string array prop in fdt_format_node()

2022-08-26 Thread Daniel Henrique Barboza
To support printing string properties in 'info fdt' we need to determine whether a void data might contain a string array. We do that by casting the void data to a string array and: - check if the array finishes with a null character - check if there's no empty string in the middle of the array (

[PATCH for-7.2 v4 11/21] hw/riscv: set machine->fdt in sifive_u_machine_init()

2022-08-26 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for the sifive_u machine. Cc: Alistair Francis Cc: Bin Meng Cc: Palmer Dabbelt Reviewed-by: Alistair Francis Signed-off-by: Daniel Henrique Barboza --- hw/riscv/sifive_u.c | 6 ++ 1 file changed, 6 insertions(+) diff --g

[PATCH for-7.2 v4 04/21] hw/ppc: set machine->fdt in ppce500_load_device_tree()

2022-08-26 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for the e500 machine. Cc: Cédric Le Goater Signed-off-by: Daniel Henrique Barboza --- hw/ppc/e500.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 32495d0123

[PATCH for-7.2 v4 12/21] hw/riscv: set machine->fdt in spike_board_init()

2022-08-26 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for the spike machine. Cc: Palmer Dabbelt Cc: Alistair Francis Cc: Bin Meng Reviewed-by: Alistair Francis Signed-off-by: Daniel Henrique Barboza --- hw/riscv/spike.c | 9 + 1 file changed, 9 insertions(+) diff --git

[PATCH for-7.2 v4 17/21] device_tree.c: support remaining FDT prop types

2022-08-26 Thread Daniel Henrique Barboza
When printing a blob with 'dtc' using the '-O dts' option there are 3 distinct data types being printed: strings, arrays of uint32s and regular byte arrays. Previous patch added support to print strings. Let's add the remaining formats. We want to resemble the format that 'dtc -O dts' uses, so eve

[PATCH for-7.2 v4 05/21] hw/ppc: set machine->fdt in bamboo_load_device_tree()

2022-08-26 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for the bamboo machine. Cc: Cédric Le Goater Signed-off-by: Daniel Henrique Barboza --- hw/ppc/ppc440_bamboo.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc44

[PATCH for-7.2 v4 14/21] qmp/hmp, device_tree.c: introduce dumpdtb

2022-08-26 Thread Daniel Henrique Barboza
To save the FDT blob we have the '-machine dumpdtb=' property. With this property set, the machine saves the FDT in and exit. The created file can then be converted to plain text dts format using 'dtc'. There's nothing particularly sophisticated into saving the FDT that can't be done with the mac

[PATCH for-7.2 v4 13/21] hw/xtensa: set machine->fdt in xtfpga_init()

2022-08-26 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for all xtensa machines that uses a FDT. Signed-off-by: Daniel Henrique Barboza --- hw/xtensa/meson.build | 2 +- hw/xtensa/xtfpga.c| 9 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/xtensa/meson

[PATCH 03/13] linux-user: Add faccessat2() syscall

2022-08-26 Thread Helge Deller
Add implementation and strace output for faccessat2(). Signed-off-by: Helge Deller --- linux-user/strace.c| 2 +- linux-user/strace.list | 3 +++ linux-user/syscall.c | 12 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace

[PATCH for-7.2 v4 09/21] hw/ppc: set machine->fdt in pnv_reset()

2022-08-26 Thread Daniel Henrique Barboza
This will enable support for 'dumpdtb' and 'info fdt' HMP commands for all powernv machines. Cc: Cédric Le Goater Cc: Frederic Barrat Signed-off-by: Daniel Henrique Barboza --- hw/ppc/pnv.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c i

[PATCH for-7.2 v4 15/21] qmp/hmp, device_tree.c: introduce 'info fdt' command

2022-08-26 Thread Daniel Henrique Barboza
Reading the FDT requires that the user saves the fdt_blob and then use 'dtc' to read the contents. Saving the file and using 'dtc' is a strong use case when we need to compare two FDTs, but it's a lot of steps if you want to do quick check on a certain node or property. 'info fdt' retrieves FDT no

[PATCH for-7.2 v4 21/21] qmp/hmp, device_tree.c: add textformat dumpdtb option

2022-08-26 Thread Daniel Henrique Barboza
The QMP/HMP 'dumpdtb' command is saving the FDT blob to be decoded using 'dtc' like the '-machine dumpdtb' always did. However, after adding support for the 'info fdt' command, we're now able to format a full FDT in text format - which is what 'info fdt /' already does. Let's extend the 'dumpdtb'

[PATCH 07/13] linux-user/hppa: Dump IIR on register dump

2022-08-26 Thread Helge Deller
Include the IIR register (which holds the opcode of the failing instruction) when dumping the hppa registers. Signed-off-by: Helge Deller --- target/hppa/helper.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/hppa/helper.c b/target/hppa/helper.c index e2758d8df

[PATCH for-7.2 v4 10/21] hw/ppc: set machine->fdt in spapr machine

2022-08-26 Thread Daniel Henrique Barboza
The pSeries machine never bothered with the common machine->fdt attribute. We do all the FDT related work using spapr->fdt_blob. We're going to introduce HMP commands to read and save the FDT, which will rely on setting machine->fdt properly to work across all machine archs/types. Let's set machi

[PATCH for-7.2 v4 19/21] device_tree.c: add fdt_format_property() helper

2022-08-26 Thread Daniel Henrique Barboza
We want to be able to also print properties with 'info fdt'. Create a helper to format properties based on the already existing code from fdt_format_node(). Signed-off-by: Daniel Henrique Barboza --- softmmu/device_tree.c | 35 --- 1 file changed, 20 insertions(+

[PATCH 04/13] linux-user: Add pidfd_open(), pidfd_send_signal() and pidfd_getfd() syscalls

2022-08-26 Thread Helge Deller
I noticed those were missing when running the glib2.0 testsuite. Add the syscalls including the strace output. Signed-off-by: Helge Deller --- linux-user/strace.c| 28 linux-user/strace.list | 9 + linux-user/syscall.c | 34

[PATCH 00/13] linux-user: Add more syscalls, enhance tracing & logging enhancements

2022-08-26 Thread Helge Deller
Here is a bunch of patches for linux-user, all of them for qemu-v7.2. Most of them add missing syscalls and enhance the tracing/logging. Some of the patches are target-hppa specific. I've tested those on productive hppa debian buildd servers (running qemu-user). Please check. Thanks! Helge Helg

[PATCH for-7.2 v4 18/21] device_node.c: enable 'info fdt' to print subnodes

2022-08-26 Thread Daniel Henrique Barboza
Printing subnodes of a given node will allow us to show a whole subtree, which the additional perk of 'info fdt /' being able to print the whole FDT. Since we're now printing more than one subnode, change 'fdt_info' to print the full path of the first node. This small tweak helps identifying which

Re: [RFC PATCH 1/2] softmmu/memory: add missing begin/commit callback calls

2022-08-26 Thread Peter Xu
On Fri, Aug 26, 2022 at 03:53:09PM +0200, Emanuele Giuseppe Esposito wrote: > What do you mean "will empty all regions with those listeners"? > But yes theoretically vhost-vdpa and physmem have commit callbacks that > are independent from whether region_add or other callbacks have been called. > Fo

Re: [PATCH] linux-user: use 'max' instead of 'qemu32' / 'qemu64' by defualt

2022-08-26 Thread Richard Henderson
On 8/26/22 04:39, Daniel P. Berrangé wrote: The 'qemu64' CPU model implements the least featureful x86_64 CPU that's possible. Historically this hasn't been an issue since it was rare for OS distros to build with a higher mandatory CPU baseline. With RHEL-9, however, the entire distro is built f

[PATCH 09/13] linux-user/hppa: Set TASK_UNMAPPED_BASE to 0xfa000000 for hppa arch

2022-08-26 Thread Helge Deller
On the parisc architecture the stack grows upwards. Move the TASK_UNMAPPED_BASE to high memory area as it's done by the kernel on physical machines. Signed-off-by: Helge Deller --- linux-user/mmap.c | 4 1 file changed, 4 insertions(+) diff --git a/linux-user/mmap.c b/linux-user/mmap.c ind

[PATCH for-7.2 v4 20/21] hmp, device_tree.c: add 'info fdt ' support

2022-08-26 Thread Daniel Henrique Barboza
'info fdt' is only able to print full nodes so far. It would be good to be able to also print single properties, since ometimes we just want to verify a single value from the FDT. libfdt does not have support to find a property given its full path, but it does have a way to return a fdt_property g

Re: [RFC PATCH 2/2] kvm/kvm-all.c: listener should delay kvm_vm_ioctl to the commit phase

2022-08-26 Thread Emanuele Giuseppe Esposito
Am 26/08/2022 um 16:15 schrieb David Hildenbrand: > On 16.08.22 12:12, Emanuele Giuseppe Esposito wrote: >> Instead of sending a single ioctl every time ->region_* or ->log_* >> callbacks are called, "queue" all memory regions in a list that will >> be emptied only when committing. >> > > Out o

[PATCH 12/13] linux-user: Add close_range() syscall

2022-08-26 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.list | 3 +++ linux-user/syscall.c | 12 2 files changed, 15 insertions(+) diff --git a/linux-user/strace.list b/linux-user/strace.list index 0463415902..4560a01d88 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list

[PATCH 06/13] linux-user/hppa: Use EXCP_DUMP() to show enhanced debug info

2022-08-26 Thread Helge Deller
Enhance the hppa linux-user cpu_loop() to show more debugging info on hard errors. Signed-off-by: Helge Deller --- linux-user/hppa/cpu_loop.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 64263c3dc4..1ef3b46

Re: [RFC PATCH 2/2] kvm/kvm-all.c: listener should delay kvm_vm_ioctl to the commit phase

2022-08-26 Thread David Hildenbrand
On 16.08.22 12:12, Emanuele Giuseppe Esposito wrote: > Instead of sending a single ioctl every time ->region_* or ->log_* > callbacks are called, "queue" all memory regions in a list that will > be emptied only when committing. > Out of interest, how many such regions does the ioctl support? As m

[PATCH 05/13] linux-user: Log failing executable in EXCP_DUMP()

2022-08-26 Thread Helge Deller
Enhance the EXCP_DUMP() macro to print out the failing program too. During debugging it's sometimes hard to track down the actual failing program if you are e.g. building a whole debian package. Signed-off-by: Helge Deller --- linux-user/cpu_loop-common.h | 2 ++ 1 file changed, 2 insertions(+)

[PATCH 11/13] linux-user: Show timespec on strace for futex()

2022-08-26 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index bac47748bc..a90e719681 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -3713,11 +3713,19 @@ print_futex(C

[PATCH v2 5/8] virtio-blk: move config size params to virtio-blk-common

2022-08-26 Thread Daniil Tatianin
This way we can reuse it for other virtio-blk devices, e.g vhost-user-blk, which currently does not control its config space size dynamically. Signed-off-by: Daniil Tatianin --- MAINTAINERS | 4 +++ hw/block/meson.build | 4 +-- hw/block/virtio-blk-co

RE: [PATCH v3] Loading new machines and devices from external modules

2022-08-26 Thread Sebelev, Vladimir
Hi Peter, Anton previously sent explanation of our position. Nobody commented. Could you please comment on it? It's necessary for us to better understand your position. From our point of view technical ban of external modules loading doesn't solve any of mentioned problems, but makes VP develop

[PATCH 01/13] linux-user: Add missing signals in strace output

2022-08-26 Thread Helge Deller
Some of the guest signal numbers are currently not converted to their representative names in the strace output, e.g. SIGVTALRM. This patch introduces a smart way to generate and keep in sync the host-to-guest and guest-to-host signal conversion tables for usage in the qemu signal and strace code.

[PATCH v6 11/10] parallels: Incorrect condition in out-of-image check

2022-08-26 Thread Alexander Ivanov
All the offsets in the BAT must be lower than the file size. Fix the check condition for correct check. Signed-off-by: Alexander Ivanov --- block/parallels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/parallels.c b/block/parallels.c index 8943eccbf5..e6e8b9e369 100

[PATCH 13/13] linux-user: Add parameters of getrandom() syscall for strace

2022-08-26 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.list | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/strace.list b/linux-user/strace.list index 4560a01d88..da8c1bf34e 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -358,7 +358,7 @@ { TARGET_NR

[PATCH 10/13] linux-user: Add strace for clock_nanosleep()

2022-08-26 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.c| 15 +++ linux-user/strace.list | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index d1afa0e12a..bac47748bc 100644 --- a/linux-user/strace.c +++ b/linux-user/str

[PATCH v2 8/8] vhost-user-blk: dynamically resize config space based on features

2022-08-26 Thread Daniil Tatianin
Make vhost-user-blk backwards compatible when migrating from older VMs running with modern features turned off, the same way it was done for virtio-blk in 20764be0421c ("virtio-blk: set config size depending on the features enabled") It's currently impossible to migrate from an older VM with vhos

[PATCH 08/13] linux-user: Fix strace of chmod() if mode == 0

2022-08-26 Thread Helge Deller
If the mode parameter of chmod() is zero, this value isn't shown when stracing a program: chmod("filename",) This patch fixes it up to show the zero-value as well: chmod("filename",000) Signed-off-by: Helge Deller --- linux-user/strace.c | 5 + 1 file changed, 5 insertions(+) diff -

[PATCH 02/13] linux-user: Add missing clock_gettime64() syscall strace

2022-08-26 Thread Helge Deller
Allow linux-user to strace the clock_gettime64() syscall. This syscall is used a lot on 32-bit guest architectures which use newer glibc versions. Signed-off-by: Helge Deller --- linux-user/strace.c| 53 ++ linux-user/strace.list | 4 2 files cha

[PATCH v2 7/8] vhost-user-blk: make 'config_wce' part of 'host_features'

2022-08-26 Thread Daniil Tatianin
No reason to have this be a separate field. This also makes it more akin to what the virtio-blk device does. Signed-off-by: Daniil Tatianin --- hw/block/vhost-user-blk.c | 6 ++ include/hw/virtio/vhost-user-blk.h | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/

[PATCH v2 0/8] vhost-user-blk: dynamically resize config space based on features

2022-08-26 Thread Daniil Tatianin
This patch set attempts to align vhost-user-blk with virtio-blk in terms of backward compatibility and flexibility. It also improves the virtio core by introducing new common code that can be used by a virtio device to calculate its config space size. In particular it adds the following things: -

Re: [RFC PATCH 2/2] kvm/kvm-all.c: listener should delay kvm_vm_ioctl to the commit phase

2022-08-26 Thread David Hildenbrand
On 26.08.22 16:32, Emanuele Giuseppe Esposito wrote: > > > Am 26/08/2022 um 16:15 schrieb David Hildenbrand: >> On 16.08.22 12:12, Emanuele Giuseppe Esposito wrote: >>> Instead of sending a single ioctl every time ->region_* or ->log_* >>> callbacks are called, "queue" all memory regions in a lis

[PATCH v2 6/8] vhost-user-blk: make it possible to disable write-zeroes/discard

2022-08-26 Thread Daniil Tatianin
It is useful to have the ability to disable these features for compatibility with older VMs that don't have these implemented. Signed-off-by: Daniil Tatianin --- hw/block/vhost-user-blk.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/block/vhost-user-blk.c b/hw/blo

[PATCH v2 2/3] hw/nvme: use KVM irqfd when available

2022-08-26 Thread Jinhao Fan
Use KVM's irqfd to send interrupts when possible. This approach is thread safe. Moreover, it does not have the inter-thread communication overhead of plain event notifiers since handler callback are called in the same system call as irqfd write. Signed-off-by: Jinhao Fan Signed-off-by: Klaus Jens

[PATCH v2 1/8] virtio: introduce VirtIOConfigSizeParams & virtio_get_config_size

2022-08-26 Thread Daniil Tatianin
This is the first step towards moving all device config size calculation logic into the virtio core code. In particular, this adds a struct that contains all the necessary information for common virtio code to be able to calculate the final config size for a device. This is expected to be used with

Re: [PATCH 01/13] linux-user: Add missing signals in strace output

2022-08-26 Thread Richard Henderson
On 8/26/22 07:18, Helge Deller wrote: +static const char *target_signal_to_host_signal_table[_NSIG] = { (1) static const char * const (2) target_signal_name -- there's no "host" about this. r~

[PATCH v2 2/8] virtio-blk: utilize VirtIOConfigSizeParams & virtio_get_config_size

2022-08-26 Thread Daniil Tatianin
Use the common helper instead of duplicating the same logic. Signed-off-by: Daniil Tatianin --- hw/block/virtio-blk.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index e9ba752f6b..10c47c2934 100644 --- a/hw/bl

[PATCH v2 1/3] hw/nvme: support irq(de)assertion with eventfd

2022-08-26 Thread Jinhao Fan
When the new option 'irq-eventfd' is turned on, the IO emulation code signals an eventfd when it want to (de)assert an irq. The main loop eventfd handler does the actual irq (de)assertion. This paves the way for iothread support since QEMU's interrupt emulation is not thread safe. Asserting and d

[PATCH] tpm_crb: Avoid backend startup just before shutdown under Xen

2022-08-26 Thread Ross Lagerwall via
When running under Xen and the guest reboots, it boots into a new domain with a new QEMU process (and a new swtpm process if using the emulator backend). The existing reset function is triggered just before the old QEMU process exists which causes QEMU to startup the TPM backend and then immediatel

Re: [PATCH 01/13] linux-user: Add missing signals in strace output

2022-08-26 Thread Richard Henderson
On 8/26/22 07:18, Helge Deller wrote: +if (arg < _NSIG) +signal_name = target_signal_to_host_signal_table[arg]; Oh, and _NSIG is a host thing. Leave the array as [] and then bound the lookup with ARRAY_SIZE(target_signal_name). Also, missing {}. r~

[PATCH v2 4/8] virtio: remove the virtio_feature_get_config_size helper

2022-08-26 Thread Daniil Tatianin
This has no more users and is superseded by virtio_get_config_size. Signed-off-by: Daniil Tatianin --- hw/virtio/virtio.c | 15 --- include/hw/virtio/virtio.h | 3 --- 2 files changed, 18 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 8518382025..c0

[PATCH v8 0/7] Add support for zoned device

2022-08-26 Thread Sam Li
Zoned Block Devices (ZBDs) devide the LBA space to block regions called zones that are larger than the LBA size. It can only allow sequential writes, which reduces write amplification in SSD, leading to higher throughput and increased capacity. More details about ZBDs can be found at: https://zone

Re: [PATCH 11/51] qga/commands-posix-ssh: Use g_mkdir_with_parents()

2022-08-26 Thread Bin Meng
On Wed, Aug 24, 2022 at 10:41 PM Konstantin Kostiuk wrote: > > Reviewed-by: Konstantin Kostiuk > > On Wed, Aug 24, 2022 at 12:42 PM Bin Meng wrote: >> >> From: Bin Meng >> >> g_mkdir() is a deprecated API and newer codes should use >> g_mkdir_with_parents(). >> >> Signed-off-by: Bin Meng >> --

Re: [PATCH v7 01/14] mm: Add F_SEAL_AUTO_ALLOCATE seal to memfd

2022-08-26 Thread Fuad Tabba
Hi Chao, On Wed, Jul 6, 2022 at 9:25 AM Chao Peng wrote: > > Normally, a write to unallocated space of a file or the hole of a sparse > file automatically causes space allocation, for memfd, this equals to > memory allocation. This new seal prevents such automatically allocating, > either this is

[PATCH v2 3/8] virtio-net: utilize VirtIOConfigSizeParams & virtio_get_config_size

2022-08-26 Thread Daniil Tatianin
Use the new common helper. As an added bonus this also makes use of config size sanity checking via the 'max_size' field. Signed-off-by: Daniil Tatianin --- hw/net/virtio-net.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c i

Re: [PATCH 12/51] tests: Use g_mkdir_with_parents()

2022-08-26 Thread Bin Meng
On Thu, Aug 25, 2022 at 1:58 AM Dr. David Alan Gilbert wrote: > > * Bin Meng (bmeng...@gmail.com) wrote: > > From: Bin Meng > > > > Use the same g_mkdir_with_parents() call to create a directory on > > all platforms. > > > > Signed-off-by: Bin Meng > > Reviewed-by: Dr. David Alan Gilbert > > >

Re: [PATCH 03/13] linux-user: Add faccessat2() syscall

2022-08-26 Thread Richard Henderson
On 8/26/22 07:18, Helge Deller wrote: Add implementation and strace output for faccessat2(). Signed-off-by: Helge Deller --- linux-user/strace.c| 2 +- linux-user/strace.list | 3 +++ linux-user/syscall.c | 12 3 files changed, 16 insertions(+), 1 deletion(-) I've do

Re: [PATCH v7 11/14] KVM: Register/unregister the guest private memory regions

2022-08-26 Thread Fuad Tabba
Hi Chao, On Wed, Jul 6, 2022 at 9:27 AM Chao Peng wrote: > > If CONFIG_HAVE_KVM_PRIVATE_MEM=y, userspace can register/unregister the > guest private memory regions through KVM_MEMORY_ENCRYPT_{UN,}REG_REGION > ioctls. The patch reuses existing SEV ioctl but differs that the > address in the region

Re: [PATCH v3] Loading new machines and devices from external modules

2022-08-26 Thread Daniel P . Berrangé
On Fri, Aug 26, 2022 at 07:51:20AM +, Sebelev, Vladimir wrote: > Hi Peter, > > Anton previously sent explanation of our position. Nobody commented. > Could you please comment on it? It's necessary for us to better > understand your position. From our point of view technical ban of > external m

Re: [PATCH] tpm_crb: Avoid backend startup just before shutdown under Xen

2022-08-26 Thread Stefan Berger
On 8/26/22 10:38, Ross Lagerwall wrote: When running under Xen and the guest reboots, it boots into a new domain with a new QEMU process (and a new swtpm process if using the emulator backend). The existing reset function is triggered just before the old QEMU process exists which causes QEMU t

Re: [PATCH v3] Loading new machines and devices from external modules

2022-08-26 Thread Peter Maydell
On Fri, 26 Aug 2022 at 08:51, Sebelev, Vladimir wrote: > Anton previously sent explanation of our position. Nobody > commented. Could you please comment on it? It's necessary for > us to better understand your position. The discussion was on this thread: https://lore.kernel.org/qemu-devel/yta+06u

Re: [PATCH 3/3] hw/nvme: add iothread support

2022-08-26 Thread Jinhao Fan
at 7:18 PM, Jinhao Fan wrote: > @@ -4979,7 +5007,13 @@ static void nvme_init_cq(NvmeCQueue *cq, NvmeCtrl *n, > uint64_t dma_addr, > } > } > n->cq[cqid] = cq; > -cq->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, nvme_post_cqes, cq); > + > +if (cq->cqid) { > +cq->timer =

Re: [PATCH 03/18] i386: Add CHECK_NO_VEX

2022-08-26 Thread Richard Henderson
On 8/25/22 15:13, Paolo Bonzini wrote: } else { +CHECK_NO_VEX(s); if ((op6.flags & SSE_OPF_MMX) == 0) { goto unknown_op; } Swap these, perhaps? Or drop the unknown/illegal distinction? Either way, Reviewed

Re: [PATCH v6 11/10] parallels: Incorrect condition in out-of-image check

2022-08-26 Thread Denis V. Lunev
On 26.08.2022 16:27, Alexander Ivanov wrote: All the offsets in the BAT must be lower than the file size. Fix the check condition for correct check. Signed-off-by: Alexander Ivanov --- block/parallels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/parallels.c b/b

Re: [PATCH 27/51] tests/qtest: Use send/recv for socket communication

2022-08-26 Thread Bin Meng
On Thu, Aug 25, 2022 at 9:04 PM Thomas Huth wrote: > > On 24/08/2022 11.40, Bin Meng wrote: > > From: Xuzhou Cheng > > > > Socket communication in the libqtest and libqmp codes uses read() > > and write() which work on any file descriptor on *nix, and sockets > > in *nix are an example of a file

[PATCH 0/2] tpm_emulator: Signal swtpm to re-lock storage

2022-08-26 Thread Stefan Berger
Swtpm is being extended to release the lock on the storage where its state is written to upon migration of the last one of its state blobs. Signal swtpm to re-lock the storage upon migration fallback. An explicit signal helps swtpm to re-lock the storage earlier because otherwise it would have to w

Re: [PATCH v2 2/3] hw/nvme: use KVM irqfd when available

2022-08-26 Thread Klaus Jensen
On Aug 26 09:34, Keith Busch wrote: > On Fri, Aug 26, 2022 at 11:12:04PM +0800, Jinhao Fan wrote: > > Use KVM's irqfd to send interrupts when possible. This approach is > > thread safe. Moreover, it does not have the inter-thread communication > > overhead of plain event notifiers since handler cal

Re: [PATCH 15/18] i386: Misc AVX helper prep

2022-08-26 Thread Richard Henderson
On 8/25/22 15:14, Paolo Bonzini wrote: From: Paul Brook Fixup various vector helpers that either trivially exten to 256 bit, or don't have 256 bit variants. No functional changes to existing helpers Signed-off-by: Paul Brook Message-Id:<20220424220204.2493824-19-p...@nowt.org> Signed-off-by: P

[PATCH v2 0/3] iothread and irqfd support

2022-08-26 Thread Jinhao Fan
This patch series adds support for using a seperate iothread for NVMe IO emulation, which brings the potential of applying polling. The first two patches implements support for irqfd, which solves thread safety problems for interrupt emulation outside the main loop thread. Changes since v1: - Avo

[PATCH 1/2] tpm_emulator: Use latest tpm_ioctl.h from swtpm project

2022-08-26 Thread Stefan Berger
Use the latest tpm_ioctl.h from upstream swtpm project. Signed-off-by: Stefan Berger --- backends/tpm/tpm_ioctl.h | 96 +++- 1 file changed, 76 insertions(+), 20 deletions(-) diff --git a/backends/tpm/tpm_ioctl.h b/backends/tpm/tpm_ioctl.h index bd6c12cb86..2

[PATCH v2 3/3] hw/nvme: add iothread support

2022-08-26 Thread Jinhao Fan
Add an option "iothread=x" to do emulation in a seperate iothread. This improves the performance because QEMU's main loop is responsible for a lot of other work while iothread is dedicated to NVMe emulation. Moreover, emulating in iothread brings the potential of polling on SQ/CQ doorbells, which I

Re: [PATCH 16/18] i386: Rewrite blendv helpers

2022-08-26 Thread Richard Henderson
On 8/25/22 15:14, Paolo Bonzini wrote: +#define BLEND_I128(elem, num, F, b) do {\ +d->elem(b + 0) = F(v->elem(b + 0), s->elem(b + 0), ((imm >> 0) & 1)); \ +d->elem(b + 1) = F(v->elem(b + 1), s->elem(b + 1), ((imm >> 1) & 1)); \ +if (num > 2) {

Re: [PATCH 17/18] i386: AVX pclmulqdq prep

2022-08-26 Thread Richard Henderson
On 8/25/22 15:14, Paolo Bonzini wrote: From: Paul Brook Make the pclmulqdq helper AVX ready Signed-off-by: Paul Brook Message-Id:<20220424220204.2493824-21-p...@nowt.org> Signed-off-by: Paolo Bonzini --- target/i386/ops_sse.h | 29 ++--- 1 file changed, 22 insertions(

Re: [PATCH v2 2/3] hw/nvme: use KVM irqfd when available

2022-08-26 Thread Keith Busch
On Fri, Aug 26, 2022 at 05:45:21PM +0200, Klaus Jensen wrote: > On Aug 26 09:34, Keith Busch wrote: > > On Fri, Aug 26, 2022 at 11:12:04PM +0800, Jinhao Fan wrote: > > > Use KVM's irqfd to send interrupts when possible. This approach is > > > thread safe. Moreover, it does not have the inter-thread

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-08-26 Thread Fuad Tabba
Hi, On Wed, Jul 6, 2022 at 9:24 AM Chao Peng wrote: > > This is the v7 of this series which tries to implement the fd-based KVM > guest private memory. The patches are based on latest kvm/queue branch > commit: > > b9b71f43683a (kvm/queue) KVM: x86/mmu: Buffer nested MMU > split_desc_cache only

Re: [PATCH] KVM: dirty ring: add missing memory barrier

2022-08-26 Thread Philippe Mathieu-Daudé via
Hi Paolo, On Fri, Aug 26, 2022 at 1:17 PM Paolo Bonzini wrote: > The KVM_DIRTY_GFN_F_DIRTY flag ensures that the entry is valid. If > the read of the fields are not ordered after the read of the flag, > QEMU might see stale values. > > Cc: Peter Xu > Cc: Gavin Shan > Signed-off-by: Paolo Bonz

Re: [PATCH v2 2/3] hw/nvme: use KVM irqfd when available

2022-08-26 Thread Keith Busch
On Fri, Aug 26, 2022 at 11:12:04PM +0800, Jinhao Fan wrote: > Use KVM's irqfd to send interrupts when possible. This approach is > thread safe. Moreover, it does not have the inter-thread communication > overhead of plain event notifiers since handler callback are called > in the same system call a

[PATCH v8 1/7] include: add zoned device structs

2022-08-26 Thread Sam Li
Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Damien Le Moal --- include/block/block-common.h | 43 1 file changed, 43 insertions(+) diff --git a/include/block/block-common.h b/include/block/block-common.h index fdb7306e78..36bd0e480e 1006

Re: [PATCH v2 2/3] hw/nvme: use KVM irqfd when available

2022-08-26 Thread Klaus Jensen
On Aug 26 09:54, Keith Busch wrote: > On Fri, Aug 26, 2022 at 05:45:21PM +0200, Klaus Jensen wrote: > > On Aug 26 09:34, Keith Busch wrote: > > > On Fri, Aug 26, 2022 at 11:12:04PM +0800, Jinhao Fan wrote: > > > > Use KVM's irqfd to send interrupts when possible. This approach is > > > > thread saf

<    1   2   3   4   >