Re: [PATCH v2 2/4] vhost-user-common: send get_inflight_fd once

2023-07-27 Thread Michael S. Tsirkin
On Tue, Jul 25, 2023 at 06:42:45PM +0800, Li Feng wrote: > Get_inflight_fd is sent only once. When reconnecting to the backend, > qemu sent set_inflight_fd to the backend. I don't understand what you are trying to say here. Should be: Currently ABCD. This is wrong/unnecessary because EFG. This pat

Re:Re: [PATCH v2] softmmu/physmem: try opening file readonly before failure in file_ram_open

2023-07-27 Thread ThinerLogoer
Sorry my mail agent just have a bug At 2023-07-28 02:30:09, "David Hildenbrand" wrote: >On 27.07.23 17:20, ThinerLogoer wrote: >> >> At 2023-07-27 21:18:44, "David Hildenbrand" wrote: >>> On 26.07.23 16:59, Thiner Logoer wrote: Users may give "-mem-path" a read only file and expect the fil

[PATCH] semihosting/uaccess.c: Replaced a malloc call with g_malloc.

2023-07-27 Thread dinglimin
Replaced a call to malloc() and its respective call to free() with g_malloc() and g_free(). Signed-off-by: dinglimin v4 -> V5:Use g_try_malloc() instead of malloc() V3 -> V4:Delete null checks after g malloc(). V2 -> V3:softmmu_unlock_user changes free to g free. V1 -> V2:if cpu_memory_rw_debug

[PATCH v2] linux-user/armeb: Fix __kernel_cmpxchg() for armeb

2023-07-27 Thread Helge Deller
Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with host atomics") switched to use qatomic_cmpxchg() to swap a word with the memory content, but missed to endianess-swap the oldval and newval values when emulating an armeb CPU, which expects words to be stored in big endian in the

Re:Re: [PATCH v2] softmmu/physmem: try opening file readonly before failure in file_ram_open

2023-07-27 Thread ThinerLogoer
At 2023-07-28 02:30:09, "David Hildenbrand" wrote: >On 27.07.23 17:20, ThinerLogoer wrote: >> >> At 2023-07-27 21:18:44, "David Hildenbrand" wrote: >>> On 26.07.23 16:59, Thiner Logoer wrote: Users may give "-mem-path" a read only file and expect the file to be mapped r

Re: [PATCH] bsd-user: Properly allocate guest virtual address space

2023-07-27 Thread Warner Losh
On Thu, Jul 27, 2023 at 6:31 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 7/27/23 17:09, Warner Losh wrote: > > Yes. FreeBSD's bsd-user binary will only run on 64-bit hosts. The project > > has started phasing out support for 32-bit hosts, and the role of > bsd-user > > (packag

[PATCH] bsd-user: Specify host page alignment if none specified

2023-07-27 Thread Warner Losh
We're hitting an assert when we pass in alignment == 0 since that's not a power of two. so pass in the ideal page size. Signed-off-by: Warner Losh --- bsd-user/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c index 74ed00b9fe3..e3ce4ab1

[PATCH v5 3/9] throttle: support read-only and write-only

2023-07-27 Thread zhenwei pi
Only one direction is necessary in several scenarios: - a read-only disk - operations on a device are considered as *write* only. For example, encrypt/decrypt/sign/verify operations on a cryptodev use a single *write* timer(read timer callback is defined, but never invoked). Allow a single dir

[PATCH v5 2/9] test-throttle: use enum ThrottleDirection

2023-07-27 Thread zhenwei pi
Use enum ThrottleDirection instead in the throttle test codes. Reviewed-by: Alberto Garcia Reviewed-by: Hanna Czenczek Signed-off-by: zhenwei pi --- tests/unit/test-throttle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/test-throttle.c b/tests/unit/test

[PATCH v5 7/9] throttle: use THROTTLE_MAX/ARRAY_SIZE for hard code

2023-07-27 Thread zhenwei pi
The first dimension of both to_check and bucket_types_size/bucket_types_units is used as throttle direction, use THROTTLE_MAX instead of hard coded number. Also use ARRAY_SIZE() to avoid hard coded number for the second dimension. Hanna noticed that the two array should be static. Yes, turn them i

[PATCH v5 0/9] Misc fixes for throttle

2023-07-27 Thread zhenwei pi
v4 -> v5: - typo fix in 'throttle: use enum ThrottleDirection instead of bool is_write': '@throttle: throttle direction' -> '@direction: throttle direction' - several 'for (i = 0; i < 2; i++)' left, use 'for (dir = THROTTLE_READ; dir < THROTTLE_MAX; dir++)' instead. 'true/false' left, use

[PATCH v5 4/9] test-throttle: test read only and write only

2023-07-27 Thread zhenwei pi
Reviewed-by: Alberto Garcia Reviewed-by: Hanna Czenczek Signed-off-by: zhenwei pi --- tests/unit/test-throttle.c | 66 ++ 1 file changed, 66 insertions(+) diff --git a/tests/unit/test-throttle.c b/tests/unit/test-throttle.c index a60b5fe22e..5547837a58 10064

[PATCH v5 5/9] cryptodev: use NULL throttle timer cb for read direction

2023-07-27 Thread zhenwei pi
Operations on a cryptodev are considered as *write* only, the callback of read direction is never invoked. Use NULL instead of an unreachable path(cryptodev_backend_throttle_timer_cb on read direction). The dummy read timer(never invoked) is already removed here, it means that the 'FIXME' tag is n

[PATCH v5 8/9] fsdev: Use ThrottleDirection instread of bool is_write

2023-07-27 Thread zhenwei pi
'bool is_write' style is obsolete from throttle framework, adapt fsdev to the new style. Cc: Greg Kurz Reviewed-by: Hanna Czenczek Signed-off-by: zhenwei pi --- fsdev/qemu-fsdev-throttle.c | 14 +++--- fsdev/qemu-fsdev-throttle.h | 4 ++-- hw/9pfs/cofile.c| 4 ++-- 3 file

Re: Re: [PATCH v4 9/9] block/throttle-groups: Use ThrottleDirection instread of bool is_write

2023-07-27 Thread zhenwei pi
On 7/28/23 00:12, Hanna Czenczek wrote: On 24.07.23 12:09, zhenwei pi wrote: 'bool is_write' style is obsolete from throttle framework, adapt block throttle groups to the new style. Use a simple python script to test the new style:   #!/usr/bin/python3 import subprocess import random import

[PATCH v5 9/9] block/throttle-groups: Use ThrottleDirection instread of bool is_write

2023-07-27 Thread zhenwei pi
'bool is_write' style is obsolete from throttle framework, adapt block throttle groups to the new style: - use ThrottleDirection instead of 'bool is_write'. Ex, schedule_next_request(ThrottleGroupMember *tgm, bool is_write) -> schedule_next_request(ThrottleGroupMember *tgm, ThrottleDirection d

[PATCH v5 6/9] throttle: use enum ThrottleDirection instead of bool is_write

2023-07-27 Thread zhenwei pi
enum ThrottleDirection is already there, use ThrottleDirection instead of 'bool is_write' for throttle API, also modify related codes from block, fsdev, cryptodev and tests. Reviewed-by: Hanna Czenczek Signed-off-by: zhenwei pi --- backends/cryptodev.c| 9 + block/throttle-grou

[PATCH v5 1/9] throttle: introduce enum ThrottleDirection

2023-07-27 Thread zhenwei pi
Use enum ThrottleDirection instead of number index. Reviewed-by: Alberto Garcia Reviewed-by: Hanna Czenczek Signed-off-by: zhenwei pi --- include/qemu/throttle.h | 11 --- util/throttle.c | 16 +--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/in

Re: [PATCH v6 09/12] target/riscv/cpu.c: limit cfg->vext_spec log message

2023-07-27 Thread Weiwei Li
On 2023/7/28 06:09, Daniel Henrique Barboza wrote: Inside riscv_cpu_validate_v() we're always throwing a log message if the user didn't set a vector version via 'vext_spec'. We're going to include one case with the 'max' CPU where env->vext_ver will be set in the cpu_init(). But that alone wil

Re: [PATCH] target/riscv: Fix zfa fleq.d and fltq.d

2023-07-27 Thread Weiwei Li
On 2023/7/28 08:39, LIU Zhiwei wrote: Commit a47842d ("riscv: Add support for the Zfa extension") implemented the zfa extension. However, it has some typos for fleq.d and fltq.d. Both of them misused the fltq.s helper function. Signed-off-by: LIU Zhiwei --- Reviewed-by: Weiwei Li Weiwei

[PATCH] hw/i2c: Fix bitbang_i2c_data trace event

2023-07-27 Thread BALATON Zoltan
The clock and data values were logged swapped. Correct the trace event text to match what is logged. Also fix a typo in a comment nearby. Signed-off-by: BALATON Zoltan --- By the way, get_maintainer.pl does not find a maintainer for bitbang_i2c.c, should it be added somewhere with the rest of hw/

[PATCH] target/riscv: Fix zfa fleq.d and fltq.d

2023-07-27 Thread LIU Zhiwei
Commit a47842d ("riscv: Add support for the Zfa extension") implemented the zfa extension. However, it has some typos for fleq.d and fltq.d. Both of them misused the fltq.s helper function. Signed-off-by: LIU Zhiwei --- target/riscv/insn_trans/trans_rvzfa.c.inc | 4 ++-- 1 file changed, 2 inse

Re: [PATCH 6/9] include/exec: typedef abi_ptr to vaddr in softmmu

2023-07-27 Thread Richard Henderson
On 7/21/23 13:58, Anton Johansson wrote: In system mode, abi_ptr is primarily used for representing addresses when accessing guest memory with cpu_[st|ld]*(). Widening it from target_ulong to vaddr reduces the target dependence of these functions and is step towards building accel/ once for syste

Re: [PATCH 8/9] accel/tcg: Widen address arg. in tlb_compare_set()

2023-07-27 Thread Richard Henderson
On 7/21/23 13:58, Anton Johansson wrote: Signed-off-by: Anton Johansson --- accel/tcg/cputlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

Re: [RFC PATCH] target/i386: Truncate ESP when exiting from long mode

2023-07-27 Thread Richard Henderson
On 7/27/23 14:36, Ard Biesheuvel wrote: On Thu, 27 Jul 2023 at 19:56, Richard Henderson wrote: On 7/26/23 08:01, Richard Henderson wrote: On 7/26/23 01:17, Ard Biesheuvel wrote: Hints welcome on where the architectural behavior is specified, and in particular, whether or not other 64-bit GP

Re: [PATCH] bsd-user: Properly allocate guest virtual address space

2023-07-27 Thread Richard Henderson
On 7/27/23 17:09, Warner Losh wrote: Yes. FreeBSD's bsd-user binary will only run on 64-bit hosts. The project has started phasing out support for 32-bit hosts, and the role of bsd-user (package builder tool) is such that 32-bit hosts don't make sense. Ok, fine. I've tested this out, and it w

Re: [PATCH] bsd-user: Properly allocate guest virtual address space

2023-07-27 Thread Warner Losh
On Thu, Jul 27, 2023 at 10:11 AM Richard Henderson < richard.hender...@linaro.org> wrote: > Do not hard-code guest_base at 32GB. > Do not override mmap_next_start for reserved_va. > > Signed-off-by: Richard Henderson > --- > > Hi Warner, > > With the blitz-trial branch you provided, the host libc

Re: avocado test failing INTERRUPTED for "Missing asset"

2023-07-27 Thread Richard Henderson
On 7/27/23 12:08, Cleber Rosa wrote: Anyways, I'll look into, and report back on: 1. expanding avocado.Test.fetch_asset() with a timeout parameter 2. making sure the newer implementation for the requirement types used by QEMU respect a timeout (they don't need to be smaller than the test, becaus

Re: linux-user/armeb: Fix __kernel_cmpxchg() for armeb

2023-07-27 Thread Richard Henderson
On 7/27/23 14:19, Helge Deller wrote: Words are stored in big endian in the guest memory for armeb. Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with host atomics") switched to use qatomic_cmpxchg() to swap a word with the memory content, but missed to endianess-swap the oldv

Re: [PATCH 9/9] accel/tcg: Update run_on_cpu_data static assert

2023-07-27 Thread Richard Henderson
On 7/21/23 13:58, Anton Johansson wrote: As we are now using vaddr for representing guest addresses, update the static assert to check that vaddr fits in the run_on_cpu_data union. Signed-off-by: Anton Johansson --- accel/tcg/cputlb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

[PATCH 3/3] hw/ufs: change ufs_process_db signature

2023-07-27 Thread Mike Maslenkin
Actually UTRLDBR is 32bit register. There is no need to pass 64bit value to ufs_process_db() function. Cc: Jeuk Kim Cc: Stefan Hajnoczi Signed-off-by: Mike Maslenkin --- hw/ufs/ufs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c index b0656e475

Re: [PATCH 7/9] include/exec: Widen tlb_hit/tlb_hit_page()

2023-07-27 Thread Richard Henderson
On 7/21/23 13:58, Anton Johansson wrote: tlb_addr is changed from target_ulong to uint64_t to match the type of a CPUTLBEntry value, and the addressed is changed to vaddr. Signed-off-by: Anton Johansson --- include/exec/cpu-all.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Rev

Re: [PATCH 5/9] Replace target_ulong with abi_ptr in cpu_[st|ld]*()

2023-07-27 Thread Richard Henderson
On 7/21/23 13:58, Anton Johansson wrote: Changes the address type of the guest memory read/write functions from target_ulong to abi_ptr. (abi_ptr is currently typedef'd to target_ulong but that will change in a following commit.) This will reduce the coupling between accel/ and target/. Note: Fu

Re: [PATCH 0/8] Adds CPU hot-plug support to Loongarch

2023-07-27 Thread Gavin Shan
Hi Salil, On 7/28/23 00:58, Salil Mehta wrote: From: Gavin Shan Sent: Thursday, July 27, 2023 1:57 AM On 7/20/23 17:15, xianglai li wrote: Hello everyone, We refer to the implementation of ARM CPU Hot-Plug to add GED-based CPU Hot-Plug support to Loongarch. The first 4 patches are changes to

[PATCH 2/3] hw/ufs: fix compilation warning

2023-07-27 Thread Mike Maslenkin
This patch fixes compilation warning, since argument to ufs_process_db() passed to find_first_bit() that expects unsigned long value. The exact warnings are: warning: incompatible pointer types passing 'uint64_t *' (aka 'unsigned long long *') to parameter of type 'const unsigned long *' [-Wincom

[PATCH 1/3] hw/ufs: fix compilation warning

2023-07-27 Thread Mike Maslenkin
This patch fixes a compilation warning: implicit conversion from enumeration type 'enum UfsRequestState' to different enumeration type 'UfsReqResult' (aka 'enum UfsReqResult') [-Wenum-conversion] ufs_exec_scsi_cmd() returns a value from UfsReqResult enum. Cc: Jeuk Kim Cc: Stefan Hajnoczi Signed

[PATCH 0/3] hw/ufs: fix compilation warnings

2023-07-27 Thread Mike Maslenkin
This patchset contains a trivial compilation fixes for UFS support applied to block-next tree. Cc: Jeuk Kim Cc: Stefan Hajnoczi Signed-off-by: Mike Maslenkin

Re: [PATCH 0/6] Add nRF51 DETECT signal with test

2023-07-27 Thread Chris Laplante
Hi Peter, > > 2. I also have some implementations for pieces of CLOCK, namely the > > HFCLKSTART/HFCLKSTOP events and HFCLKSTARTED event. Should I include that > > in this patch series, or would you prefer it in a separate series? It is > > unrelated to DETECT and POWER. > > > If you think th

[PATCH v6 10/12] target/riscv: add 'max' CPU type

2023-07-27 Thread Daniel Henrique Barboza
The 'max' CPU type is used by tooling to determine what's the most capable CPU a current QEMU version implements. Other archs such as ARM implements this type. Let's add it to RISC-V. What we consider "most capable CPU" in this context are related to ratified, non-vendor extensions. This means tha

[PATCH v6 08/12] target/riscv/cpu.c: add ADD_UNAVAIL_KVM_PROP_ARRAY() macro

2023-07-27 Thread Daniel Henrique Barboza
Use a macro in riscv_cpu_add_kvm_properties() to eliminate some of its code repetition, similar to what we're already doing with ADD_CPU_QDEV_PROPERTIES_ARRAY(). Signed-off-by: Daniel Henrique Barboza Reviewed-by: Weiwei Li --- target/riscv/cpu.c | 22 ++ 1 file changed, 10

[PATCH v6 00/12] riscv: add 'max' CPU, deprecate 'any'

2023-07-27 Thread Daniel Henrique Barboza
Hi, I decided to spin a new version of this work after chatting with Conor about some log messages about 'vector version is not specified' message when using the 'max' CPU. For this particular CPU we should set an appropriate value for the vector version right at cpu_init(), but doing that isn't

[PATCH v6 12/12] target/riscv: deprecate the 'any' CPU type

2023-07-27 Thread Daniel Henrique Barboza
The 'any' CPU type was introduced in commit dc5bd18fa5725 ("RISC-V CPU Core Definition"), being around since the beginning. It's not an easy CPU to use: it's undocumented and its name doesn't tell users much about what the CPU is supposed to bring. 'git log' doesn't help us either in knowing what w

[PATCH v6 03/12] target/riscv/cpu.c: split kvm prop handling to its own helper

2023-07-27 Thread Daniel Henrique Barboza
Future patches will split the existing Property arrays even further, and the existing code in riscv_cpu_add_user_properties() will start to scale bad with it because it's dealing with KVM constraints mixed in with TCG constraints. We're going to pay a high price to share a couple of common lines of

[PATCH v6 07/12] target/riscv/cpu.c: add ADD_CPU_QDEV_PROPERTIES_ARRAY() macro

2023-07-27 Thread Daniel Henrique Barboza
The code inside riscv_cpu_add_user_properties() became quite repetitive after recent changes. Add a macro to hide the repetition away. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Weiwei Li --- target/riscv/cpu.c | 26 +++--- 1 file changed, 11 insertions(+), 15 delet

[PATCH v6 11/12] avocado, risc-v: add opensbi tests for 'max' CPU

2023-07-27 Thread Daniel Henrique Barboza
Add smoke tests to ensure that we'll not break the 'max' CPU type when adding new ratified extensions to be enabled. Signed-off-by: Daniel Henrique Barboza --- tests/avocado/riscv_opensbi.py | 16 1 file changed, 16 insertions(+) diff --git a/tests/avocado/riscv_opensbi.py b/te

[PATCH v6 05/12] target/riscv/cpu.c: split vendor exts from riscv_cpu_extensions[]

2023-07-27 Thread Daniel Henrique Barboza
Our goal is to make riscv_cpu_extensions[] hold only ratified, non-vendor extensions. Create a new riscv_cpu_vendor_exts[] array for them, changing riscv_cpu_add_user_properties() and riscv_cpu_add_kvm_properties() accordingly. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis

[PATCH v6 09/12] target/riscv/cpu.c: limit cfg->vext_spec log message

2023-07-27 Thread Daniel Henrique Barboza
Inside riscv_cpu_validate_v() we're always throwing a log message if the user didn't set a vector version via 'vext_spec'. We're going to include one case with the 'max' CPU where env->vext_ver will be set in the cpu_init(). But that alone will not stop the "vector version is not specified" messag

[PATCH v6 06/12] target/riscv/cpu.c: split non-ratified exts from riscv_cpu_extensions[]

2023-07-27 Thread Daniel Henrique Barboza
Create a new riscv_cpu_experimental_exts[] to store the non-ratified extensions properties. Once they are ratified we'll move them back to riscv_cpu_extensions[]. riscv_cpu_add_user_properties() and riscv_cpu_add_kvm_properties() are changed to keep adding non-ratified properties to users. Signed

[PATCH v6 04/12] target/riscv/cpu.c: del DEFINE_PROP_END_OF_LIST() from riscv_cpu_extensions

2023-07-27 Thread Daniel Henrique Barboza
This last blank element is used by the 'for' loop to check if a property has a valid name. Remove it and use ARRAY_SIZE() instead like riscv_cpu_options is already using. All future arrays will also do the same and we'll able to encapsulate more repetitions in macros later on. Signed-off-by: Dani

[PATCH v6 02/12] target/riscv/cpu.c: skip 'bool' check when filtering KVM props

2023-07-27 Thread Daniel Henrique Barboza
After the introduction of riscv_cpu_options[] all properties in riscv_cpu_extensions[] are booleans. This check is now obsolete. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) dif

[PATCH v6 01/12] target/riscv/cpu.c: split CPU options from riscv_cpu_extensions[]

2023-07-27 Thread Daniel Henrique Barboza
We'll add a new CPU type that will enable a considerable amount of extensions. To make it easier for us we'll do a few cleanups in our existing riscv_cpu_extensions[] array. Start by splitting all CPU non-boolean options from it. Create a new riscv_cpu_options[] array for them. Add all these prope

linux-user/armeb: Fix __kernel_cmpxchg() for armeb

2023-07-27 Thread Helge Deller
Words are stored in big endian in the guest memory for armeb. Commit 7f4f0d9ea870 ("linux-user/arm: Implement __kernel_cmpxchg with host atomics") switched to use qatomic_cmpxchg() to swap a word with the memory content, but missed to endianess-swap the oldval and newval values when emulating an a

Re: [PATCH] vhost-user-scsi: support reconnect to backend

2023-07-27 Thread Raphael Norwitz
> On Jul 25, 2023, at 6:19 AM, Li Feng wrote: > > Thanks for your comments. > >> 2023年7月25日 上午1:21,Raphael Norwitz 写道: >> >> Very excited to see this. High level looks good modulo a few small things. >> >> My major concern is around existing vhost-user-scsi backends which don’t >> support

Re: [RFC PATCH] target/i386: Truncate ESP when exiting from long mode

2023-07-27 Thread Ard Biesheuvel
On Thu, 27 Jul 2023 at 19:56, Richard Henderson wrote: > > On 7/26/23 08:01, Richard Henderson wrote: > > On 7/26/23 01:17, Ard Biesheuvel wrote: > >> Hints welcome on where the architectural behavior is specified, and in > >> particular, > >> whether or not other 64-bit GPRs can be relied upon t

Re: [PATCH v2 3/6] qtest: implement named interception of out-GPIO

2023-07-27 Thread Chris Laplante
> (g_strcmp0() can handle the NULL case without having > to special case it -- this is how qdev_get_named_gpio_list() > finds entries in the ngl list.) > > Apologies for not noticing that on the first round of review. No worries - it makes the code much simpler anyway. Should we bother factorin

Re: [PATCH 1/6] vhost-user.rst: Add suspend/resume

2023-07-27 Thread Stefan Hajnoczi
On Tue, Jul 25, 2023 at 10:30:49AM +0200, Hanna Czenczek wrote: > On 24.07.23 19:55, Stefan Hajnoczi wrote: > > On Wed, Jul 19, 2023 at 03:59:32PM +0200, Hanna Czenczek wrote: > > > On 18.07.23 16:25, Stefan Hajnoczi wrote: > > > > On Tue, Jul 11, 2023 at 05:52:23PM +0200, Hanna Czenczek wrote: > >

Re: [PATCH 3/6] vhost: Do not reset suspended devices on stop

2023-07-27 Thread Stefan Hajnoczi
On Thu, Jul 27, 2023 at 02:49:04PM +0200, Eugenio Perez Martin wrote: > On Wed, Jul 26, 2023 at 8:57 AM Hanna Czenczek wrote: > > > > On 25.07.23 20:53, Eugenio Perez Martin wrote: > > > On Tue, Jul 25, 2023 at 3:09 PM Hanna Czenczek wrote: > > >> On 25.07.23 12:03, Eugenio Perez Martin wrote: >

[PULL for-8.1 5/8] block/blkio: move blkio_connect() in the drivers functions

2023-07-27 Thread Stefan Hajnoczi
From: Stefano Garzarella This is in preparation for the next patch, where for virtio-blk drivers we need to handle the failure of blkio_connect(). Let's also rename the *_open() functions to *_connect() to make the code reflect the changes applied. Signed-off-by: Stefano Garzarella Message-id:

[PULL for-8.1 7/8] block/blkio: fall back on using `path` when `fd` setting fails

2023-07-27 Thread Stefan Hajnoczi
From: Stefano Garzarella qemu_open() fails if called with an unix domain socket in this way: -blockdev node-name=drive0,driver=virtio-blk-vhost-user,path=vhost-user-blk.sock,cache.direct=on: Could not open 'vhost-user-blk.sock': No such device or address Since virtio-blk-vhost-user does no

Re: avocado test failing INTERRUPTED for "Missing asset"

2023-07-27 Thread Peter Maydell
On Thu, 27 Jul 2023 at 20:08, Cleber Rosa wrote: > > On Thu, Jul 27, 2023 at 11:50 AM Peter Maydell > wrote: > > > > Ah, so the problem is that we are trying to download the asset > > file, and the remote server is stalling so it doesn't actually > > download the file in 90s, and Avocado doesn't

[PULL for-8.1 0/8] Block patches

2023-07-27 Thread Stefan Hajnoczi
The following changes since commit 66547f416a61e0cb711dc76821890242432ba193: block/nvme: invoke blk_io_plug_call() outside q->lock (2023-07-17 09:17:41 -0400) are available in the Git repository at: https://gitlab.com/stefanha/qemu.git tags/block-pull-request for you to fetch changes up to

Re: [PATCH 3/9] target: Use vaddr for kvm_arch_[insert|remove]_hw_breakpoint

2023-07-27 Thread Richard Henderson
On 7/21/23 13:58, Anton Johansson wrote: Changes the signature of the target-defined functions for inserting/removing kvm hw breakpoints. The address and length arguments are now of vaddr type, which both matches the type used internally in accel/kvm/kvm-all.c and makes the api target-agnostic.

Re: [PATCH v2 0/4] block/blkio: fix opening virtio-blk drivers

2023-07-27 Thread Stefan Hajnoczi
On Thu, Jul 27, 2023 at 06:10:16PM +0200, Stefano Garzarella wrote: > There is a problem with virtio-blk-vhost-vdpa. > The first patch does some preparation changes. The second and third patches > fix the issues, the last patch tries to prepare QEMU for a future version of > libblkio where we can u

[PULL for-8.1 8/8] block/blkio: use blkio_set_int("fd") to check fd support

2023-07-27 Thread Stefan Hajnoczi
From: Stefano Garzarella Setting the `fd` property fails with virtio-blk-* libblkio drivers that do not support fd passing since https://gitlab.com/libblkio/libblkio/-/merge_requests/208. Getting the `fd` property, on the other hand, always succeeds for virtio-blk-* libblkio drivers even when th

[PULL for-8.1 1/8] block/blkio: enable the completion eventfd

2023-07-27 Thread Stefan Hajnoczi
From: Stefano Garzarella Until libblkio 1.3.0, virtio-blk drivers had completion eventfd notifications enabled from the start, but from the next releases this is no longer the case, so we have to explicitly enable them. In fact, the libblkio documentation says they could be disabled, so we shoul

[PULL for-8.1 6/8] block/blkio: retry blkio_connect() if it fails using `fd`

2023-07-27 Thread Stefan Hajnoczi
From: Stefano Garzarella libblkio 1.3.0 added support of "fd" property for virtio-blk-vhost-vdpa driver. In QEMU, starting from commit cad2ccc395 ("block/blkio: use qemu_open() to support fd passing for virtio-blk") we are using `blkio_get_int(..., "fd")` to check if the "fd" property is supporte

[PULL for-8.1 3/8] block/file-posix: fix g_file_get_contents return path

2023-07-27 Thread Stefan Hajnoczi
From: Sam Li The g_file_get_contents() function returns a g_boolean. If it fails, the returned value will be 0 instead of -1. Solve the issue by skipping assigning ret value. This issue was found by Matthew Rosato using virtio-blk-{pci,ccw} backed by an NVMe partition e.g. /dev/nvme0n1p1 on s390

[PULL for-8.1 4/8] block: Fix pad_request's request restriction

2023-07-27 Thread Stefan Hajnoczi
From: Hanna Czenczek bdrv_pad_request() relies on requests' lengths not to exceed SIZE_MAX, which bdrv_check_qiov_request() does not guarantee. bdrv_check_request32() however will guarantee this, and both of bdrv_pad_request()'s callers (bdrv_co_preadv_part() and bdrv_co_pwritev_part()) already

[PULL for-8.1 2/8] block/blkio: do not use open flags in qemu_open()

2023-07-27 Thread Stefan Hajnoczi
From: Stefano Garzarella qemu_open() in blkio_virtio_blk_common_open() is used to open the character device (e.g. /dev/vhost-vdpa-0 or /dev/vfio/vfio) or in the future eventually the unix socket. In all these cases we cannot open the path in read-only mode, when the `read-only` option of blockde

Re: avocado test failing INTERRUPTED for "Missing asset"

2023-07-27 Thread Cleber Rosa
On Wed, Jul 26, 2023 at 5:07 AM Thomas Huth wrote: > > On 26/07/2023 09.33, Philippe Mathieu-Daudé wrote: > > On 25/7/23 19:13, Peter Maydell wrote: > >> Currently this CI job is failing: > >> > >> https://gitlab.com/qemu-project/qemu/-/jobs/4737819946 > >> > >> because: > >> > >> (05/59) > >> tes

Re: [PATCH 1/9] accel/kvm: Widen pc/saved_insn for kvm_sw_breakpoint

2023-07-27 Thread Richard Henderson
On 7/21/23 13:58, Anton Johansson wrote: Widens the pc and saved_insn fields of kvm_sw_breakpoint from target_ulong to vaddr. The pc argument of kvm_find_sw_breakpoint is also widened to match. Signed-off-by: Anton Johansson --- include/sysemu/kvm.h | 6 +++--- accel/kvm/kvm-all.c | 3 +--

Re: [PATCH 4/9] target: Use vaddr for hvf_arch_[insert|remove]_hw_breakpoint

2023-07-27 Thread Richard Henderson
On 7/21/23 13:58, Anton Johansson wrote: -int hvf_arch_insert_hw_breakpoint(target_ulong addr, target_ulong len, int type) +int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type) { switch (type) { case GDB_BREAKPOINT_HW: -return insert_hw_breakpoint(addr); +

Re: [PATCH 2/9] accel/hvf: Widen pc/saved_insn for hvf_sw_breakpoint

2023-07-27 Thread Richard Henderson
On 7/21/23 13:58, Anton Johansson wrote: Widens the pc and saved_insn fields of hvf_sw_breakpoint from target_ulong to vaddr. Other hvf_* functions accessing hvf_sw_breakpoint are also widened to match. Signed-off-by: Anton Johansson --- include/sysemu/hvf.h | 6 +++--- accel/hvf/hvf-acc

Re: avocado test failing INTERRUPTED for "Missing asset"

2023-07-27 Thread Cleber Rosa
On Wed, Jul 26, 2023 at 3:34 AM Philippe Mathieu-Daudé wrote: > > On 25/7/23 19:13, Peter Maydell wrote: > > Currently this CI job is failing: > > > > https://gitlab.com/qemu-project/qemu/-/jobs/4737819946 > > > > because: > > > > (05/59) > > tests/avocado/boot_linux_console.py:BootLinuxConsole.t

Re: avocado test failing INTERRUPTED for "Missing asset"

2023-07-27 Thread Cleber Rosa
On Thu, Jul 27, 2023 at 11:50 AM Peter Maydell wrote: > > Ah, so the problem is that we are trying to download the asset > file, and the remote server is stalling so it doesn't actually > download the file in 90s, and Avocado doesn't distinguish > "hit the timeout while trying to download assets"

Re: [PATCH v4] block-jobs: flush target at the end of .run()

2023-07-27 Thread Vladimir Sementsov-Ogievskiy
On 27.07.23 18:27, Hanna Czenczek wrote: On 25.07.23 19:40, Vladimir Sementsov-Ogievskiy wrote: From: Vladimir Sementsov-Ogievskiy Actually block job is not completed without this final flush. It's rather unexpected to have broken target when job was successfully completed long ago and now we

Re: [PATCH v2] softmmu/physmem: try opening file readonly before failure in file_ram_open

2023-07-27 Thread David Hildenbrand
On 27.07.23 17:20, ThinerLogoer wrote: At 2023-07-27 21:18:44, "David Hildenbrand" wrote: On 26.07.23 16:59, Thiner Logoer wrote: Users may give "-mem-path" a read only file and expect the file to be mapped read-write privately. Allow this but give a warning since other users may surprise whe

[PATCH v2 0/4] block/blkio: fix opening virtio-blk drivers

2023-07-27 Thread Stefano Garzarella
There is a problem with virtio-blk-vhost-vdpa. The first patch does some preparation changes. The second and third patches fix the issues, the last patch tries to prepare QEMU for a future version of libblkio where we can use blkio_set_fd() to check whether the property is supported or not. While

Re: [RFC PATCH] target/i386: Truncate ESP when exiting from long mode

2023-07-27 Thread Richard Henderson
On 7/26/23 08:01, Richard Henderson wrote: On 7/26/23 01:17, Ard Biesheuvel wrote: Hints welcome on where the architectural behavior is specified, and in particular, whether or not other 64-bit GPRs can be relied upon to preserve their full 64-bit length values. No idea about chapter and ver

[PATCH] target/arm: Do not use gen_mte_checkN in trans_STGP

2023-07-27 Thread Richard Henderson
STGP writes to tag memory, it does not check it. This happened to work because we wrote tag memory first so that the check always succeeded. Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 41 +- 1 file changed, 15 insertions(+), 26 deletions

Re: [PATCH v21 03/20] target/s390x/cpu topology: handle STSI(15) and build the SYSIB

2023-07-27 Thread Nina Schoetterl-Glausch
On Fri, 2023-06-30 at 11:17 +0200, Pierre Morel wrote: > On interception of STSI(15.1.x) the System Information Block > (SYSIB) is built from the list of pre-ordered topology entries. > > Signed-off-by: Pierre Morel > --- > MAINTAINERS | 1 + > qapi/machine-target.json

Re: [PATCH RFC v1 1/3] vfio/pci: detect the support of dynamic MSI-X allocation

2023-07-27 Thread Cédric Le Goater
Hello Jing, On 7/27/23 09:24, Jing Liu wrote: From: Reinette Chatre Kernel provides the guidance of dynamic MSI-X allocation support of passthrough device, by clearing the VFIO_IRQ_INFO_NORESIZE flag to guide user space. Fetch and store the flags from host for later use to determine if specif

Re: Implementing "tee" in python asyncio

2023-07-27 Thread Daniel P . Berrangé
On Thu, Jul 27, 2023 at 12:49:10PM -0400, John Snow wrote: > On Thu, Jul 27, 2023, 6:47 AM Daniel P. Berrangé > wrote: > > > On Wed, Jul 26, 2023 at 04:25:34PM -0400, John Snow wrote: > > > Hi folks, > > > > > > I'm currently wondering how to take a StreamReader as found on > > > > > https://docs

Re: assert fails in s390x TCG

2023-07-27 Thread Richard Henderson
On 7/21/23 02:08, Claudio Fontana wrote: Thread 3 "qemu-system-s39" received signal SIGABRT, Aborted. [Switching to Thread 0x753516c0 (LWP 215975)] (gdb) bt #0 0x7730dabc in __pthread_kill_implementation () at /lib64/libc.so.6 #1 0x772bc266 in raise () at /lib64/libc.so.6 #2

Re: [PATCH RFC v1 1/3] vfio/pci: detect the support of dynamic MSI-X allocation

2023-07-27 Thread Alex Williamson
On Thu, 27 Jul 2023 03:24:08 -0400 Jing Liu wrote: > From: Reinette Chatre > > Kernel provides the guidance of dynamic MSI-X allocation support of > passthrough device, by clearing the VFIO_IRQ_INFO_NORESIZE flag to > guide user space. > > Fetch and store the flags from host for later use to d

Re: [PATCH for-8.2 2/6] sysemu: Add pre VM state change callback

2023-07-27 Thread Cédric Le Goater
On 7/16/23 10:15, Avihai Horon wrote: Add pre VM state change callback to struct VMChangeStateEntry. This sentence could be the subject. The pre VM state change callback is optional and can be set by the new function qemu_add_vm_change_state_handler_prio_full() that allows setting this callb

Re: [PATCH RFC v1 3/3] vfio/pci: dynamic MSI-X allocation in interrupt restoring

2023-07-27 Thread Alex Williamson
On Thu, 27 Jul 2023 03:24:10 -0400 Jing Liu wrote: > During migration restoring, vfio_enable_vectors() is called to restore > enabling MSI-X interrupts for assigned devices. It sets the range from 0 > to nr_vectors to kernel to enable MSI-X and the vectors unmasked in > guest. During the MSI-X en

Re: [PATCH RFC v1 2/3] vfio/pci: enable vector on dynamic MSI-X allocation

2023-07-27 Thread Cédric Le Goater
On 7/27/23 09:24, Jing Liu wrote: The vector_use callback is used to enable vector that is unmasked in guest. The kernel used to only support static MSI-X allocation. When allocating a new interrupt using "static MSI-X allocation" kernels, Qemu first disables all previously allocated vectors and

Re: [PATCH 1/3] Rework i.MX6UL device implementation/instantiation

2023-07-27 Thread Peter Maydell
On Wed, 26 Jul 2023 at 16:55, Jean-Christophe Dubois wrote: > > From: jcdubois > > * Add Addr and size definition for all i.MX6UL devices in i.MX6UL header file. > * Use those newly defined named constants whenever possible. > * Standardize the way we init a familly of unimplemented devices > -

Re: Implementing "tee" in python asyncio

2023-07-27 Thread John Snow
On Thu, Jul 27, 2023, 12:53 PM Daniel P. Berrangé wrote: > On Thu, Jul 27, 2023 at 12:49:10PM -0400, John Snow wrote: > > On Thu, Jul 27, 2023, 6:47 AM Daniel P. Berrangé > > wrote: > > > > > On Wed, Jul 26, 2023 at 04:25:34PM -0400, John Snow wrote: > > > > Hi folks, > > > > > > > > I'm current

Re: [PATCH 2/3] Rework i.MX7 device implementation/instantiation

2023-07-27 Thread Peter Maydell
On Wed, 26 Jul 2023 at 16:52, Jean-Christophe Dubois wrote: > > From: jcdubois > > * Add Addr and size definition for all i.MX7 devices in i.MX7 header file. > * Use those newly defined named constants whenever possible. > * Standardize the way we init a familly of unimplemented devices > - SAI

Re: [PATCH RFC v1 2/3] vfio/pci: enable vector on dynamic MSI-X allocation

2023-07-27 Thread Alex Williamson
On Thu, 27 Jul 2023 03:24:09 -0400 Jing Liu wrote: > The vector_use callback is used to enable vector that is unmasked in > guest. The kernel used to only support static MSI-X allocation. When > allocating a new interrupt using "static MSI-X allocation" kernels, > Qemu first disables all previous

Re: [PATCH 3/3] Add i.MX7 SRC device implementation

2023-07-27 Thread Peter Maydell
On Wed, 26 Jul 2023 at 16:54, Jean-Christophe Dubois wrote: > > From: jcdubois > > The SRC device is normaly used to start the secondary CPU. > > When running Linux directly, Qemu is emulating a PSCI interface that UBOOT > is installing at boot time and therefore the fact that the SRC device is >

Re: Implementing "tee" in python asyncio

2023-07-27 Thread John Snow
On Thu, Jul 27, 2023, 6:47 AM Daniel P. Berrangé wrote: > On Wed, Jul 26, 2023 at 04:25:34PM -0400, John Snow wrote: > > Hi folks, > > > > I'm currently wondering how to take a StreamReader as found on > > > https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.subprocess.Process > >

[PATCH v2 4/4] block/blkio: use blkio_set_int("fd") to check fd support

2023-07-27 Thread Stefano Garzarella
Setting the `fd` property fails with virtio-blk-* libblkio drivers that do not support fd passing since https://gitlab.com/libblkio/libblkio/-/merge_requests/208. Getting the `fd` property, on the other hand, always succeeds for virtio-blk-* libblkio drivers even when they don't support fd passing

Re: [PATCH v4 7/9] throttle: use THROTTLE_MAX/ARRAY_SIZE for hard code

2023-07-27 Thread Hanna Czenczek
On 24.07.23 12:09, zhenwei pi wrote: The first dimension of both to_check and bucket_types_size/bucket_types_units is used as throttle direction, use THROTTLE_MAX instead of hard coded number. Also use ARRAY_SIZE() to avoid hard coded number for the second dimension. Hanna noticed that the two a

[PATCH v2 3/4] block/blkio: fall back on using `path` when `fd` setting fails

2023-07-27 Thread Stefano Garzarella
qemu_open() fails if called with an unix domain socket in this way: -blockdev node-name=drive0,driver=virtio-blk-vhost-user,path=vhost-user-blk.sock,cache.direct=on: Could not open 'vhost-user-blk.sock': No such device or address Since virtio-blk-vhost-user does not support fd passing, let`s

[PATCH v2 2/4] block/blkio: retry blkio_connect() if it fails using `fd`

2023-07-27 Thread Stefano Garzarella
libblkio 1.3.0 added support of "fd" property for virtio-blk-vhost-vdpa driver. In QEMU, starting from commit cad2ccc395 ("block/blkio: use qemu_open() to support fd passing for virtio-blk") we are using `blkio_get_int(..., "fd")` to check if the "fd" property is supported for all the virtio-blk-*

Re: [PATCH v2 0/6] Add nRF51 DETECT signal with test

2023-07-27 Thread Peter Maydell
On Wed, 26 Jul 2023 at 04:32, Chris Laplante wrote: > > This patch series implements the nRF51 DETECT signal > in the GPIO peripheral. A qtest is added exercising the signal. > > To implement the test, named out-GPIO IRQ interception had to be added > to the qtest framework. I also took the opport

[PATCH v2 1/4] block/blkio: move blkio_connect() in the drivers functions

2023-07-27 Thread Stefano Garzarella
This is in preparation for the next patch, where for virtio-blk drivers we need to handle the failure of blkio_connect(). Let's also rename the *_open() functions to *_connect() to make the code reflect the changes applied. Signed-off-by: Stefano Garzarella --- block/blkio.c | 67 ++

  1   2   3   >