[PATCH] target/riscv: Validate the mode in write_vstvec

2024-06-30 Thread Jiayi Li
Base on the riscv-privileged spec, vstvec substitutes for the usual stvec. Therefore, the encoding of the MODE should also be restricted to 0 and 1. Signed-off-by: Jiayi Li --- target/riscv/csr.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/target/riscv/csr.c

Re: [PATCH v2 1/1] memory tier: consolidate the initialization of memory tiers

2024-06-30 Thread Huang, Ying
Hi, Jack, "Ho-Ren (Jack) Chuang" writes: I suggest you to merge the [0/1] with the change log here. [0/1] describes why do we need the patch. The below text describes some details. Just don't use "---" to separate them. We need both parts in the final commit message. > If we simply move

Re: [PATCH 2/2] target/i386: drop AMD machine check bits from Intel CPUID

2024-06-30 Thread Zhao Liu
On Fri, Jun 28, 2024 at 03:23:11PM +0200, Paolo Bonzini wrote: > Date: Fri, 28 Jun 2024 15:23:11 +0200 > From: Paolo Bonzini > Subject: Re: [PATCH 2/2] target/i386: drop AMD machine check bits from > Intel CPUID > > Il ven 28 giu 2024, 10:32 Xiaoyao Li ha scritto: > > > On 6/27/2024 10:06 PM,

[PATCH 6/6] target/riscv: Enable RV32 CPU support in RV64 QEMU

2024-06-30 Thread LIU Zhiwei
From: TANG Tiancheng Add gdb XML files and adjust CPU initialization to allow running RV32 CPUs in RV64 QEMU. Signed-off-by: TANG Tiancheng Reviewed-by: Liu Zhiwei --- configs/targets/riscv64-softmmu.mak | 2 +- target/riscv/cpu.c | 17 + 2 files changed, 14

[PATCH 5/6] target/riscv: Correct mcause/scause bit width for RV32 in RV64 QEMU

2024-06-30 Thread LIU Zhiwei
From: TANG Tiancheng Ensure mcause high bit is correctly set by using 32-bit width for RV32 mode and 64-bit width for RV64 mode. Signed-off-by: TANG Tiancheng Reviewed-by: Liu Zhiwei --- target/riscv/cpu_helper.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git

[PATCH 4/6] target/riscv: Detect sxl to set bit width for RV32 in RV64

2024-06-30 Thread LIU Zhiwei
From: TANG Tiancheng Ensure correct bit width based on sxl when running RV32 on RV64 QEMU. This is required as MMU address translations run in S-mode. Signed-off-by: TANG Tiancheng Reviewed-by: Liu Zhiwei --- target/riscv/cpu_helper.c | 15 +++ 1 file changed, 11 insertions(+), 4

[PATCH 3/6] target/riscv: Correct SXL return value for RV32 in RV64 QEMU

2024-06-30 Thread LIU Zhiwei
From: TANG Tiancheng Ensure that riscv_cpu_sxl returns MXL_RV32 when runningRV32 in an RV64 QEMU. Signed-off-by: TANG Tiancheng Fixes: 05e6ca5e156 ("target/riscv: Ignore reserved bits in PTE for RV64") Reviewed-by: Liu Zhiwei --- target/riscv/cpu.h | 5 - 1 file changed, 4 insertions(+),

[PATCH 2/6] target/riscv: Adjust PMP size for no-MMU RV64 QEMU running RV32

2024-06-30 Thread LIU Zhiwei
From: TANG Tiancheng Ensure pmp_size is correctly determined using mxl for RV32 in RV64 QEMU. Signed-off-by: TANG Tiancheng Reviewed-by: Liu Zhiwei --- target/riscv/pmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/pmp.c b/target/riscv/pmp.c index

[PATCH 1/6] target/riscv: Add fw_dynamic_info32 for booting RV32 OpenSBI

2024-06-30 Thread LIU Zhiwei
From: TANG Tiancheng RV32 OpenSBI need a fw_dynamic_info parameter with 32-bit fields instead of target_ulong. In RV64 QEMU, target_ulong is 64. So it is not right for booting RV32 OpenSBI. We create a fw_dynmaic_info32 struct for this purpose. Signed-off-by: TANG Tiancheng Reviewed-by: Liu

[PATCH 0/6] target/riscv: Expose RV32 cpu to RV64 QEMU

2024-06-30 Thread LIU Zhiwei
From: TANG Tiancheng This patch set aims to expose 32-bit RISC-V cpu to RV64 QEMU. Thus qemu-system-riscv64 can directly boot a RV32 Linux. This patch set has been tested with 6.9.0 Linux Image. - Run RV64 QEMU with RV32 CPU qemu-system-riscv64 -cpu rv32 -M virt -nographic \ -kernel Image

RE: [PATCH] hw/misc/bcm2835_thermal: Handle invalid address accesses gracefully

2024-06-30 Thread Xingtao Yao (Fujitsu)
Hi, zheyu > -Original Message- > From: qemu-devel-bounces+yaoxt.fnst=fujitsu@nongnu.org > On Behalf Of Zheyu > Ma > Sent: Sunday, June 30, 2024 11:14 PM > To: Peter Maydell ; Philippe Mathieu-Daudé > > Cc: Zheyu Ma ; qemu-...@nongnu.org; > qemu-devel@nongnu.org > Subject: [PATCH]

RE: [PATCH] hw/display/tcx: Fix out-of-bounds access in tcx_blit_writel

2024-06-30 Thread Xingtao Yao (Fujitsu)
Hi, zheyu > -Original Message- > From: qemu-devel-bounces+yaoxt.fnst=fujitsu@nongnu.org > On Behalf Of Zheyu > Ma > Sent: Sunday, June 30, 2024 9:04 PM > To: Mark Cave-Ayland > Cc: Zheyu Ma ; qemu-devel@nongnu.org > Subject: [PATCH] hw/display/tcx: Fix out-of-bounds access in

[PATCH 2/5] target/i386: Convert cc_op_live to a function

2024-06-30 Thread Richard Henderson
Assert that op is known. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 56 +++- target/i386/tcg/decode-new.c.inc | 2 +- target/i386/tcg/emit.c.inc | 6 ++-- 3 files changed, 39 insertions(+), 25 deletions(-) diff --git

[PATCH 3/5] target/i386: Rearrange CCOp

2024-06-30 Thread Richard Henderson
Define CC_OP_{FIRST,LAST}_BWLQ. Remove CC_OP_NB. Give the first few enumerators explicit integer constants. Move CC_OP_POPCNT up in the enumeration; remove unused CC_OP_POPCNT*__ placeholders. Align the BWLQ enumerators. This will be used to simplify ((op - CC_OP_*B) & 3). Signed-off-by:

[PATCH 0/5] target/i386: CCOp cleanups

2024-06-30 Thread Richard Henderson
While debugging #2413, I spent quite a bit of time trying to work out if the CCOp value was incorrect. I think the following is a worthwhile cleanup, isolating potential problems to asserts. r~ Richard Henderson (5): target/i386: Tidy cc_op_str usage target/i386: Convert cc_op_live to a

[PATCH 4/5] target/i386: Remove default in cc_op_live

2024-06-30 Thread Richard Henderson
Now that CC_OP_NB is gone, push the assert after the switch. This will allow -Wswitch to diagnose missing entries. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/i386/tcg/translate.c

[PATCH 5/5] target/i386: Introduce cc_op_size

2024-06-30 Thread Richard Henderson
Replace arithmetic on cc_op with a helper function. Assert that the op has a size and that it is valid for the configuration. Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 29 ++--- target/i386/tcg/emit.c.inc | 3 ++- 2 files changed, 20

[PATCH 1/5] target/i386: Tidy cc_op_str usage

2024-06-30 Thread Richard Henderson
Make const. Use the read-only strings directly; do not copy them into an on-stack buffer with snprintf. Allow for holes in the cc_op_str array, now present with CC_OP_POPCNT. Fixes: 460231ad369 ("target/i386: give CC_OP_POPCNT low bits corresponding to MO_TL") Signed-off-by: Richard Henderson

[PATCH] tcg/optimize: Fix TCG_COND_TST* simplification of setcond2

2024-06-30 Thread Richard Henderson
Fix a typo in the argument movement. Cc: qemu-sta...@nongnu.org Fixes: ceb9ee06b71 ("tcg/optimize: Handle TCG_COND_TST{EQ,NE}") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2413 Signed-off-by: Richard Henderson --- tcg/optimize.c | 2 +- tests/tcg/x86_64/test-2413.c |

[PATCH v2 1/2] vfio/display: Fix potential memleak of edid info

2024-06-30 Thread Zhenzhong Duan
EDID related device region info is leaked in vfio_display_edid_init() error path and VFIODisplay destroying path. Fixes: 08479114b0de ("vfio/display: add edid support.") Signed-off-by: Zhenzhong Duan --- hw/vfio/display.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/vfio/display.c

[PATCH v2 0/2] Misc fixes on vfio display

2024-06-30 Thread Zhenzhong Duan
Hi, This is trying to address an issue Cédric found. See https://www.mail-archive.com/qemu-devel@nongnu.org/msg1043142.html While looking into it, also found a potential memory leak. I'm sorry that I didn't find how to test this fix, because it looks a GFX card is needed. Any idea on how to test

[PATCH v2 2/2] vfio/display: Fix vfio_display_edid_init() error path

2024-06-30 Thread Zhenzhong Duan
vfio_display_edid_init() can fail for many reasons and return silently. It would be good to report the error. Old mdev driver may not support vfio edid region and we allow to go through in this case. vfio_display_edid_update() isn't changed because it can be called at runtime when UI changes

Re: [PULL 00/16] Trivial patches for 2024-06-30

2024-06-30 Thread Richard Henderson
On 6/30/24 09:53, Michael Tokarev wrote: The following changes since commit 3665dd6bb9043bef181c91e2dce9e1efff47ed51: Merge tag 'for-upstream' ofhttps://gitlab.com/bonzini/qemu into staging (2024-06-28 16:09:38 -0700) are available in the Git repository at:

Re: [PATCH v3 1/4] hw/intc: Remove loongarch_ipi.c

2024-06-30 Thread maobibo
Hi Philippe, On 2024/6/27 下午9:02, Philippe Mathieu-Daudé wrote: On 27/6/24 04:44, gaosong wrote: 在 2024/6/26 下午8:10, Philippe Mathieu-Daudé 写道: Hi Bibo, On 26/6/24 06:11, maobibo wrote: On 2024/6/5 上午10:15, Jiaxun Yang wrote: It was missed out in previous commit. Fixes: b4a12dfc2132

Re: [PATCH 1/2] vfio/display: Fix potential memleak of edid info

2024-06-30 Thread Duan, Zhenzhong
Hi, On 6/29/2024 8:15 PM, Marc-André Lureau wrote: Hi On Fri, Jun 28, 2024 at 1:32 PM Zhenzhong Duan wrote: EDID related device region info is leaked in three paths: 1. In vfio_get_dev_region_info(), when edid info isn't find, the last device region info is leaked. 2. In

[RFC PATCH] target/ppc: Inline most of dcbz helper

2024-06-30 Thread BALATON Zoltan
This is an RFC patch, not finished, just to show the idea and test this approach. I'm not sure it's correct but I'm sure it can be improved so comments are requested. The test case I've used came out of a discussion about very slow access to VRAM of a graphics card passed through with vfio the

RE: [PATCH] hw/usb: Fix memory leak in musb_reset()

2024-06-30 Thread Xingtao Yao (Fujitsu)
> -Original Message- > From: qemu-devel-bounces+yaoxt.fnst=fujitsu@nongnu.org > On Behalf Of Zheyu > Ma > Sent: Monday, July 1, 2024 12:32 AM > Cc: Zheyu Ma ; qemu-devel@nongnu.org > Subject: [PATCH] hw/usb: Fix memory leak in musb_reset() > > The musb_reset function was causing a

Re: [PULL 0/1] ufs queue

2024-06-30 Thread Richard Henderson
/jeuk20.kim/qemu.git tags/pull-ufs-20240630 for you to fetch changes up to e12b11f6f29272ee31ccde6b0db1a10139e87083: hw/ufs: Fix potential bugs in MMIO read|write (2024-06-30 12:44:32 +0900) hw/ufs: fix coverity issue Applied

[RFC V1 2/6] migration: VMSTATE_FD

2024-06-30 Thread Steve Sistare
Define VMSTATE_FD for declaring a file descriptor field in a VMStateDescription. Signed-off-by: Steve Sistare --- include/migration/vmstate.h | 9 + migration/vmstate-types.c | 32 2 files changed, 41 insertions(+) diff --git

[RFC V1 6/6] migration: cpr-transfer mode

2024-06-30 Thread Steve Sistare
Add the cpr-transfer migration mode. Usage: qemu-system-$arch -machine anon-alloc=memfd ... start new QEMU with "-incoming -cpr-uri " Issue commands to old QEMU: migrate_set_parameter mode cpr-transfer migrate_set_parameter cpr-uri migrate -d The migrate command stops the VM,

[RFC V1 3/6] migration: cpr-transfer save and load

2024-06-30 Thread Steve Sistare
Add functions to create a QEMUFile based on a unix URI, for saving or loading, for use by cpr-transfer mode to preserve CPR state. Signed-off-by: Steve Sistare --- include/migration/cpr.h | 3 ++ migration/cpr-transfer.c | 81

[RFC V1 1/6] migration: SCM_RIGHTS for QEMUFile

2024-06-30 Thread Steve Sistare
Define functions to put/get file descriptors to/from a QEMUFile, for qio channels that support SCM_RIGHTS. Maintain ordering such that put(A), put(fd), put(B) followed by get(A), get(fd), get(B) always succeeds. Other get orderings may succeed but are not guaranteed. Signed-off-by: Steve

[RFC V1 5/6] migration: cpr-uri option

2024-06-30 Thread Steve Sistare
Define the cpr-uri QEMU command-line option to specify the URI from which CPR vmstate is loaded for cpr-transfer mode. Signed-off-by: Steve Sistare --- include/migration/cpr.h | 1 + migration/cpr.c | 7 +++ qemu-options.hx | 8 system/vl.c | 3 +++ 4

[RFC V1 0/6] Live update: cpr-transfer

2024-06-30 Thread Steve Sistare
What? This patch series adds the live migration cpr-transfer mode, which allows the user to transfer a guest to a new QEMU instance on the same host. It is identical to cpr-exec in most respects, except as described below. The new user-visible interfaces are: * cpr-transfer (MigMode

[RFC V1 4/6] migration: cpr-uri parameter

2024-06-30 Thread Steve Sistare
Define the cpr-uri migration parameter to specify the URI to which CPR vmstate is saved for cpr-transfer mode. Signed-off-by: Steve Sistare --- migration/migration-hmp-cmds.c | 10 ++ migration/options.c| 29 + migration/options.h| 1

[PATCH V2 05/11] physmem: preserve ram blocks for cpr

2024-06-30 Thread Steve Sistare
Save the memfd for anonymous ramblocks in CPR state, along with a name that uniquely identifies it. The block's idstr is not yet set, so it cannot be used for this purpose. Find the saved memfd in new QEMU when creating a block. QEMU hard-codes the length of some internally-created blocks, so

[PATCH V2 10/11] migration: cpr-exec save and load

2024-06-30 Thread Steve Sistare
To preserve CPR state across exec, create a QEMUFile based on a memfd, and keep the memfd open across exec. Save the value of the memfd in an environment variable so post-exec QEMU can find it. These new functions are called in a subsequent patch. Signed-off-by: Steve Sistare ---

[PATCH V2 11/11] migration: cpr-exec mode

2024-06-30 Thread Steve Sistare
Add the cpr-exec migration mode. Usage: qemu-system-$arch -machine anon-alloc=memfd ... migrate_set_parameter mode cpr-exec migrate_set_parameter cpr-exec-command \ ... -incoming \ migrate -d The migrate command stops the VM, saves state to uri-1, directly exec's a new version of

[PATCH V2 03/11] migration: save cpr mode

2024-06-30 Thread Steve Sistare
Save the mode in CPR state, so the user does not need to explicitly specify it for the target. Modify migrate_mode() so it returns the incoming mode on the target. Signed-off-by: Steve Sistare --- include/migration/cpr.h | 7 +++ migration/cpr.c | 23 ++-

[PATCH V2 04/11] migration: stop vm earlier for cpr

2024-06-30 Thread Steve Sistare
Stop the vm earlier for cpr, to guarantee consistent device state when CPR state is saved. Signed-off-by: Steve Sistare --- migration/migration.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index

[PATCH V2 08/11] vl: helper to request exec

2024-06-30 Thread Steve Sistare
Add a qemu_system_exec_request() hook that causes the main loop to exit and exec a command using the specified arguments. This will be used during CPR to exec a new version of QEMU. Signed-off-by: Steve Sistare --- include/sysemu/runstate.h | 3 +++ system/runstate.c | 29

[PATCH V2 01/11] machine: alloc-anon option

2024-06-30 Thread Steve Sistare
Allocate anonymous memory using mmap MAP_ANON or memfd_create depending on the value of the anon-alloc machine property. This affects memory-backend-ram objects, guest RAM created with the global -m option but without an associated memory-backend object and without the -mem-path option, and

[PATCH V2 07/11] oslib: qemu_clear_cloexec

2024-06-30 Thread Steve Sistare
Define qemu_clear_cloexec, analogous to qemu_set_cloexec. Signed-off-by: Steve Sistare Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Marc-André Lureau Reviewed-by: Fabiano Rosas --- include/qemu/osdep.h | 9 + util/oslib-posix.c | 9 + util/oslib-win32.c | 4 3

[PATCH V2 09/11] migration: cpr-exec-command parameter

2024-06-30 Thread Steve Sistare
Create the cpr-exec-command migration parameter, defined as a list of strings. It will be used for cpr-exec migration mode in a subsequent patch, and contains forward references to cpr-exec mode in the qapi doc. No functional change, except that cpr-exec-command is shown by the 'info migrate'

[PATCH V2 00/11] Live update: cpr-exec

2024-06-30 Thread Steve Sistare
What? This patch series adds the live migration cpr-exec mode, which allows the user to update QEMU with minimal guest pause time, by preserving guest RAM in place, albeit with new virtual addresses in new QEMU, and by preserving device file descriptors. The new user-visible interfaces are: *

[PATCH V2 06/11] migration: fix mismatched GPAs during cpr

2024-06-30 Thread Steve Sistare
For new cpr modes, ramblock_is_ignored will always be true, because the memory is preserved in place rather than copied. However, for an ignored block, parse_ramblock currently requires that the received address of the block must match the address of the statically initialized region on the

[PATCH V2 02/11] migration: cpr-state

2024-06-30 Thread Steve Sistare
CPR must save state that is needed after QEMU is restarted, when devices are realized. Thus the extra state cannot be saved in the migration stream, as objects must already exist before that stream can be loaded. Instead, define auxilliary state structures and vmstate descriptions, not

[PATCH v4 03/14] tests/tcg/aarch64: Drop -fno-tree-loop-distribute-patterns

2024-06-30 Thread Richard Henderson
This option is not supported by clang, and is not required in order to get sve code generation with gcc 12. Signed-off-by: Richard Henderson --- tests/tcg/aarch64/Makefile.softmmu-target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v4 13/14] tests/tcg/arm: Use vmrs/vmsr instead of mcr/mrc

2024-06-30 Thread Richard Henderson
Clang 14 generates /home/rth/qemu/src/tests/tcg/arm/fcvt.c:431:9: error: invalid operand for instruction asm("mrc p10, 7, r1, cr1, cr0, 0\n\t" ^ :1:6: note: instantiated into assembly here mrc p10, 7, r1, cr1, cr0, 0 ^

[PATCH v4 04/14] tests/tcg/aarch64: Explicitly specify register width

2024-06-30 Thread Richard Henderson
From: Akihiko Odaki clang version 18.1.6 assumes a register is 64-bit by default and complains if a 32-bit value is given. Explicitly specify register width when passing a 32-bit value. Signed-off-by: Akihiko Odaki Reviewed-by: Philippe Mathieu-Daudé Message-Id:

[PATCH v4 10/14] tests/tcg/arm: Use -fno-integrated-as for test-arm-iwmmxt

2024-06-30 Thread Richard Henderson
Clang does not support IWMXT instructions. Fall back to the external assembler. Signed-off-by: Richard Henderson --- tests/tcg/arm/Makefile.target | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target index

[PATCH v4 12/14] tests/tcg/arm: Use -march and -mfpu for fcvt

2024-06-30 Thread Richard Henderson
Clang requires the architecture to be set properly in order to assemble the half-precision instructions. Signed-off-by: Richard Henderson --- tests/tcg/arm/Makefile.target | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tcg/arm/Makefile.target

[PATCH v4 05/14] tests/tcg/aarch64: Fix irg operand type

2024-06-30 Thread Richard Henderson
From: Akihiko Odaki irg expects 64-bit integers. Passing a 32-bit integer results in compilation failure with clang version 18.1.6. Signed-off-by: Akihiko Odaki Message-Id: <20240627-tcg-v2-4-1690a8133...@daynix.com> --- tests/tcg/aarch64/mte-1.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v4 01/14] tests/tcg/minilib: Constify digits in print_num

2024-06-30 Thread Richard Henderson
This avoids a memcpy to the stack when compiled with clang. Since we don't enable optimization, nor provide memcpy, this results in an undefined symbol error at link time. Signed-off-by: Richard Henderson --- tests/tcg/minilib/printf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v4 06/14] tests/tcg/aarch64: Do not use x constraint

2024-06-30 Thread Richard Henderson
From: Akihiko Odaki clang version 18.1.6 does not support x constraint for AArch64. Use w instead. Signed-off-by: Akihiko Odaki Message-Id: <20240627-tcg-v2-5-1690a8133...@daynix.com> --- tests/tcg/arm/fcvt.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git

[PATCH v4 00/14] test/tcg: Clang build fixes for arm/aarch64

2024-06-30 Thread Richard Henderson
Supercedes: 20240629-tcg-v3-0-fa57918bd...@daynix.com ("[PATCH v3 0/7] tests/tcg/aarch64: Fix inline assemblies for clang") On top of Akihiko's patches for aarch64, additional changes are required for arm, both as a host and as a guest. r~ Akihiko Odaki (5): tests/tcg/aarch64: Explicitly

[PATCH v4 02/14] tests/tcg: Adjust variable defintion from cc-option

2024-06-30 Thread Richard Henderson
Define the variable to the compiler flag used, not "y". This avoids replication of the compiler flag itself. Signed-off-by: Richard Henderson --- tests/tcg/Makefile.target | 2 +- tests/tcg/aarch64/Makefile.softmmu-target | 2 +- tests/tcg/aarch64/Makefile.target | 15

[PATCH v4 14/14] linux-user/main: Suppress out-of-range comparison warning for clang

2024-06-30 Thread Richard Henderson
For arm32 host and arm64 guest we get .../main.c:851:32: error: result of comparison of constant 70368744177664 with expression of type 'unsigned long' is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (TASK_UNMAPPED_BASE < reserved_va) {

[PATCH v4 11/14] tests/tcg/arm: Manually register allocate half-precision numbers

2024-06-30 Thread Richard Henderson
From: Akihiko Odaki Clang does not allow specifying an integer as the value of a single precision register. Explicitly move value from a general register. Signed-off-by: Akihiko Odaki [rth: Use one single inline asm block.] Signed-off-by: Richard Henderson --- tests/tcg/arm/fcvt.c | 7

[PATCH v4 09/14] tests/tcg/arm: Drop -N from LDFLAGS

2024-06-30 Thread Richard Henderson
This is redudant with a linker script, and is not supported by clang. Signed-off-by: Richard Henderson --- tests/tcg/arm/Makefile.softmmu-target | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tcg/arm/Makefile.softmmu-target b/tests/tcg/arm/Makefile.softmmu-target

[PATCH v4 08/14] tests/tcg/arm: Fix fcvt result messages

2024-06-30 Thread Richard Henderson
From: Akihiko Odaki The test cases for "converting double-precision to single-precision" emits float but the result variable was typed as uint32_t and corrupted the printed values. Propertly type it as float. Signed-off-by: Akihiko Odaki Fixes: 8ec8a55e3fc9 ("tests/tcg/arm: add fcvt test cases

[PATCH v4 07/14] tests/tcg/aarch64: Add -fno-integrated-as for sme

2024-06-30 Thread Richard Henderson
The only use of SME is inline assembly. Both gcc and clang only support SME with very recent releases; by deferring detection to the assembler we get better test coverage. Signed-off-by: Richard Henderson --- tests/tcg/aarch64/Makefile.target | 3 ++- 1 file changed, 2 insertions(+), 1

Re: [PATCH v2 3/3] target/ppc : Update VSX storage access insns to use tcg_gen_qemu _ld/st_i128.

2024-06-30 Thread Richard Henderson
On 6/30/24 05:01, Chinmay Rath wrote: @@ -2175,13 +2179,13 @@ static bool do_lstxv(DisasContext *ctx, int ra, TCGv displ, int rt, bool store, bool paired) { TCGv ea; -TCGv_i64 xt; +TCGv_i128 data; MemOp mop; int rt1, rt2; -xt =

[PATCH] hw/char/pl011: ensure UARTIBRD register is 16-bit

2024-06-30 Thread Zheyu Ma
The PL011 TRM says that "The 16-bit integer is written to the Integer Baud Rate Register, UARTIBRD". Updated the handling of the UARTIBRD register to ensure only 16-bit values are written to it. ASAN log: ==2973125==ERROR: AddressSanitizer: FPE on unknown address 0x55f72629b348 (pc

Re: [PATCH v2 2/3] target/ppc: Update VMX storage access insns to use tcg_gen_qemu_ld/st_i128.

2024-06-30 Thread Richard Henderson
On 6/30/24 05:01, Chinmay Rath wrote: Updated instructions {l, st}vx to use tcg_gen_qemu_ld/st_i128, instead of using 64 bits loads/stores in succession. Introduced functions {get, set}_avr_full in vmx-impl.c.inc to facilitate the above, and potential future usage. Suggested-by: Richard

Re: [PATCH v2 1/3] target/ppc: Move get/set_avr64 functions to vmx-impl.c.inc.

2024-06-30 Thread Richard Henderson
On 6/30/24 05:01, Chinmay Rath wrote: Those functions are used to ld/st data to and from Altivec registers, in 64 bits chunks, and are only used in vmx-impl.c.inc file, hence the clean-up movement. Signed-off-by: Chinmay Rath --- target/ppc/translate.c | 10 --

[PULL 15/16] vl.c: select_machine(): add selected machine type to error message

2024-06-30 Thread Michael Tokarev
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- system/vl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/vl.c b/system/vl.c index

[PULL 05/16] monitor: Remove obsolete stubs

2024-06-30 Thread Michael Tokarev
From: Philippe Mathieu-Daudé hmp_info_roms() was removed in commit dd98234c05 ("qapi: introduce x-query-roms QMP command"), hmp_info_numa() in commit 1b8ae799d8 ("qapi: introduce x-query-numa QMP command"), hmp_info_ramblock() in commit ca411b7c8a ("qapi: introduce x-query-ramblock QMP

[PULL 00/16] Trivial patches for 2024-06-30

2024-06-30 Thread Michael Tokarev
The following changes since commit 3665dd6bb9043bef181c91e2dce9e1efff47ed51: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2024-06-28 16:09:38 -0700) are available in the Git repository at: https://gitlab.com/mjt0k/qemu.git tags/pull-trivial-patches for you to

[PULL 13/16] vl.c: select_machine(): use ERRP_GUARD instead of error propagation

2024-06-30 Thread Michael Tokarev
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- system/vl.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/system/vl.c

[PULL 03/16] vl: Allow multiple -overcommit commands

2024-06-30 Thread Michael Tokarev
From: Zide Chen Both cpu-pm and mem-lock are related to system resource overcommit, but they are separate from each other, in terms of how they are realized, and of course, they are applied to different system resources. It's tempting to use separate command lines to specify their behavior.

[PULL 10/16] os-posix: Expand setrlimit() syscall compatibility

2024-06-30 Thread Michael Tokarev
From: Trent Huber Darwin uses a subtly different version of the setrlimit() syscall as described in the COMPATIBILITY section of the macOS man page. The value of the rlim_cur member has been adjusted accordingly for Darwin-based systems. Signed-off-by: Trent Huber Tested-by: Philippe

[PULL 08/16] hw/arm/bcm2836: Remove unusued struct 'BCM283XClass'

2024-06-30 Thread Michael Tokarev
From: "Dr. David Alan Gilbert" This struct has been unused since Commit f932093ae165 ("hw/arm/bcm2836: Split out common part of BCM283X classes") Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev ---

[PULL 04/16] target/i386: Advertise MWAIT iff host supports

2024-06-30 Thread Michael Tokarev
From: Zide Chen host_cpu_realizefn() sets CPUID_EXT_MONITOR without consulting host/KVM capabilities. This may cause problems: - If MWAIT/MONITOR is not available on the host, advertising this feature to the guest and executing MWAIT/MONITOR from the guest triggers #UD and the guest doesn't

[PULL 11/16] docs/cxl: fix some typos

2024-06-30 Thread Michael Tokarev
From: Hyeongtak Ji This patch corrects minor typographical errors to ensure the ASCII art aligns with the explanations provided. Specifically, it fixes an incorrect root port reference and removes redundant words. Signed-off-by: Hyeongtak Ji Signed-off-by: Michael Tokarev ---

[PULL 16/16] hw/core/loader: gunzip(): fix memory leak on error path

2024-06-30 Thread Michael Tokarev
From: Vladimir Sementsov-Ogievskiy We should call inflateEnd() like on success path to cleanup state in s variable. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- hw/core/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PULL 12/16] docs/system/devices/usb: Replace the non-existing "qemu" binary

2024-06-30 Thread Michael Tokarev
From: Thomas Huth We don't ship a binary that is simply called "qemu", so we should avoid this in the documentation. Use the configurable binary name via "|qemu_system|" instead. Signed-off-by: Thomas Huth Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev ---

[PULL 07/16] linux-user: sparc: Remove unused struct 'target_mc_fq'

2024-06-30 Thread Michael Tokarev
From: "Dr. David Alan Gilbert" This struct is unused since Peter's Commit b8ae597f0e6d ("linux-user/sparc: Fix errors in target_ucontext structures") However, hmm, I'm a bit confused since that commit modifies the structure and then removes it, was that intentional? Signed-off-by: Dr. David

[PULL 14/16] vl.c: select_machine(): use g_autoptr

2024-06-30 Thread Michael Tokarev
From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- system/vl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system/vl.c b/system/vl.c

[PULL 01/16] hmp-commands-info.hx: Add missing info command for stats subcommand

2024-06-30 Thread Michael Tokarev
From: Martin Joerg Signed-off-by: Martin Joerg Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- hmp-commands-info.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index

[PULL 06/16] linux-user: cris: Remove unused struct 'rt_signal_frame'

2024-06-30 Thread Michael Tokarev
From: "Dr. David Alan Gilbert" Since 'setup_rt_frame' has never been implemented, this struct is unused. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Richard Henderson Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- linux-user/cris/signal.c | 8 1 file

[PULL 02/16] cpu: fix memleak of 'halt_cond' and 'thread'

2024-06-30 Thread Michael Tokarev
From: Matheus Tavares Bernardino Since a4c2735f35 (cpu: move Qemu[Thread|Cond] setup into common code, 2024-05-30) these fields are now allocated at cpu_common_initfn(). So let's make sure we also free them at cpu_common_finalize(). Furthermore, the code also frees these on round robin, but we

[PULL 09/16] net/can: Remove unused struct 'CanBusState'

2024-06-30 Thread Michael Tokarev
From: "Dr. David Alan Gilbert" As far as I can tell this struct has never been used in this file (it is used in can_core.c). Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev --- net/can/can_host.c | 6

Re: [PATCH v6] virtio-net: Fix network stall at the host side waiting for kick

2024-06-30 Thread Michael S. Tsirkin
Thanks for the patch! Yes something to improve: On Sun, Jun 30, 2024 at 02:36:15PM +0800, Wencheng Yang wrote: > From: thomas > > Patch 06b12970174 ("virtio-net: fix network stall under load") > added double-check to test whether the available buffer size > can satisfy the request or not, in

[PATCH] hw/usb: Fix memory leak in musb_reset()

2024-06-30 Thread Zheyu Ma
The musb_reset function was causing a memory leak by not properly freeing the memory associated with USBPacket instances before reinitializing them. This commit addresses the memory leak by adding calls to usb_packet_cleanup for each USBPacket instance before reinitializing them with

[PATCH] hw/misc/bcm2835_thermal: Handle invalid address accesses gracefully

2024-06-30 Thread Zheyu Ma
This commit handles invalid address accesses gracefully in both read and write functions. Instead of asserting and aborting, it logs an error message and returns a neutral value for read operations and does nothing for write operations. Error log:

Re: [PATCH v3 1/2] tests/avocado: update firmware for sbsa-ref

2024-06-30 Thread Ard Biesheuvel
On Thu, 20 Jun 2024 at 12:20, Marcin Juszkiewicz wrote: > > Update firmware to have graphics card memory fix from EDK2 commit > c1d1910be6e04a8b1a73090cf2881fb698947a6e: > > OvmfPkg/QemuVideoDxe: add feature PCD to remap framebuffer W/C > > Some platforms (such as SBSA-QEMU on recent

[PATCH] virtio: Implement Virtio Backend for SD/MMC in QEMU

2024-06-30 Thread Mikhail Krasheninnikov
Add a Virtio backend for SD/MMC devices. Confirmed interoperability with Linux. Signed-off-by: Mikhail Krasheninnikov CC: Matwey Kornilov CC: qemu-bl...@nongnu.org CC: Michael S. Tsirkin --- hw/virtio/Kconfig | 5 + hw/virtio/meson.build | 2

[PATCH] hw/display/tcx: Fix out-of-bounds access in tcx_blit_writel

2024-06-30 Thread Zheyu Ma
This patch addresses a potential out-of-bounds memory access issue in the tcx_blit_writel function. It adds bounds checking to ensure that memory accesses do not exceed the allocated VRAM size. If an out-of-bounds access is detected, an error is logged using qemu_log_mask. ASAN log:

Question: xen + vhost user

2024-06-30 Thread Peng Fan
Hi All, I am trying to enable vhost user input with xen hypervisor on i.MX95, using qemu vhost-user-input. But meet " Invalid vring_addr message ". My xen domu cfg: '-chardev', 'socket,path=/tmp/input.sock,id=mouse0', '-device', 'vhost-user-input-pci,chardev=mouse0', Anyone knows what missing?

[PATCH v2 3/3] target/ppc : Update VSX storage access insns to use tcg_gen_qemu _ld/st_i128.

2024-06-30 Thread Chinmay Rath
Updated many VSX instructions to use tcg_gen_qemu_ld/st_i128, instead of using tcg_gen_qemu_ld/st_i64 consecutively. Introduced functions {get,set}_vsr_full to facilitate the above & for future use. Suggested-by: Richard Henderson Signed-off-by: Chinmay Rath ---

[PATCH v2 2/3] target/ppc: Update VMX storage access insns to use tcg_gen_qemu_ld/st_i128.

2024-06-30 Thread Chinmay Rath
Updated instructions {l, st}vx to use tcg_gen_qemu_ld/st_i128, instead of using 64 bits loads/stores in succession. Introduced functions {get, set}_avr_full in vmx-impl.c.inc to facilitate the above, and potential future usage. Suggested-by: Richard Henderson Signed-off-by: Chinmay Rath ---

[PATCH v2 0/3] target/ppc: Update vector insns to use 128 bit

2024-06-30 Thread Chinmay Rath
Updating a bunch of VMX and VSX storage access instructions to use tcg_gen_qemu_ld/st_i128 instead of using tcg_gen_qemu_ld/st_i64 in succession; as suggested by Richard, in my decodetree patches. Plus some minor clean-ups to facilitate the above in case of VMX insns. Change log: v2 : Applied

[PATCH v2 1/3] target/ppc: Move get/set_avr64 functions to vmx-impl.c.inc.

2024-06-30 Thread Chinmay Rath
Those functions are used to ld/st data to and from Altivec registers, in 64 bits chunks, and are only used in vmx-impl.c.inc file, hence the clean-up movement. Signed-off-by: Chinmay Rath --- target/ppc/translate.c | 10 -- target/ppc/translate/vmx-impl.c.inc | 10

[PATCH v6] virtio-net: Fix network stall at the host side waiting for kick

2024-06-30 Thread Wencheng Yang
From: thomas Patch 06b12970174 ("virtio-net: fix network stall under load") added double-check to test whether the available buffer size can satisfy the request or not, in case the guest has added some buffers to the avail ring simultaneously after the first check. It will be lucky if the