Re: [PATCH] hw/ppc/spapr: Include missing 'sysemu/tcg.h' header

2024-03-25 Thread Harsh Prateek Bora
On 3/22/24 21:54, Philippe Mathieu-Daudé wrote: "sysemu/tcg.h" declares tcg_enabled(), and is implicitly included. Include it explicitly to avoid the following error when refactoring headers: hw/ppc/spapr.c:2612:9: error: call to undeclared function 'tcg_enabled'; ISO C99 and later do

Re: [PATCH v2] target/riscv/kvm/kvm-cpu.c: kvm_riscv_handle_sbi() fail with vendor-specific SBI

2024-03-25 Thread Alistair Francis
On Mon, Mar 25, 2024 at 11:46 PM Alexei Filippov wrote: > > kvm_riscv_handle_sbi() may return not supported return code to not trigger > qemu abort with vendor-specific sbi. > > Added SBI related return code's defines. > > Signed-off-by: Alexei Filippov > Fixes: 4eb47125 ("target/riscv: Handle

Re: [PATCH-for-9.0 v3 3/3] hw/misc/stm32l4x5_rcc: Propagate period when enabling a clock

2024-03-25 Thread Alistair Francis
On Tue, Mar 26, 2024 at 1:29 AM Philippe Mathieu-Daudé wrote: > > From: Arnaud Minier > > The "clock_set_mul_div" function doesn't propagate the clock period > to the children if it is changed (e.g. by enabling/disabling a clock > multiplexer). > This was overlooked during the implementation due

Re: [PATCH-for-9.0 v3 2/3] hw/misc/stm32l4x5_rcc: Inline clock_update() in clock_mux_update()

2024-03-25 Thread Alistair Francis
On Tue, Mar 26, 2024 at 1:29 AM Philippe Mathieu-Daudé wrote: > > Trivial inlining in preliminary patch to make the next > one easier to review. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Alistair > --- > hw/misc/stm32l4x5_rcc.c | 7 ++- > 1 file changed, 6

Re: [PATCH-for-9.0 v3 1/3] hw/clock: Let clock_set_mul_div() return a boolean value

2024-03-25 Thread Alistair Francis
On Tue, Mar 26, 2024 at 1:29 AM Philippe Mathieu-Daudé wrote: > > Let clock_set_mul_div() return a boolean value whether the > clock has been updated or not, similarly to clock_set(). > > Return early when clock_set_mul_div() is called with > same mul/div values the clock has. > > Acked-by: Luc

Re: [External] : Re: [PATCH v4 2/2] vhost: Perform memory section dirty scans once per iteration

2024-03-25 Thread Jason Wang
On Tue, Mar 26, 2024 at 7:21 AM Si-Wei Liu wrote: > > > > On 3/24/2024 11:13 PM, Jason Wang wrote: > > On Sat, Mar 23, 2024 at 5:14 AM Si-Wei Liu wrote: > >> > >> > >> On 3/21/2024 10:08 PM, Jason Wang wrote: > >>> On Fri, Mar 22, 2024 at 5:43 AM Si-Wei Liu wrote: > > On 3/20/2024

Re: [PATCH v3] contrib/plugins/execlog: Fix compiler warning

2024-03-25 Thread Pierrick Bouvier
On 3/26/24 05:52, Yao Xingtao wrote: 1. The g_pattern_match_string() is deprecated when glib2 version >= 2.70. Use g_pattern_spec_match_string() instead to avoid this problem. 2. The type of second parameter in g_ptr_array_add() is 'gpointer' {aka 'void *'}, but the type of reg->name is

Re: [PATCH-for-9.0 v2 1/8] hw/clock: Have clock_set_mul_div() return early when nothing to change

2024-03-25 Thread Alistair Francis
On Mon, Mar 25, 2024 at 11:34 PM Philippe Mathieu-Daudé wrote: > > Return early when clock_set_mul_div() is called with > same mul/div values the clock has. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Alistair > --- > hw/core/clock.c | 4 > 1 file changed, 4

Re: [External] Re: [PATCH v4 2/2] memory tier: create CPUless memory tiers after obtaining HMAT info

2024-03-25 Thread Huang, Ying
"Ho-Ren (Jack) Chuang" writes: > On Fri, Mar 22, 2024 at 1:41 AM Huang, Ying wrote: >> >> "Ho-Ren (Jack) Chuang" writes: >> >> > The current implementation treats emulated memory devices, such as >> > CXL1.1 type3 memory, as normal DRAM when they are emulated as normal memory >> >

[PATCH v3] contrib/plugins/execlog: Fix compiler warning

2024-03-25 Thread Yao Xingtao via
1. The g_pattern_match_string() is deprecated when glib2 version >= 2.70. Use g_pattern_spec_match_string() instead to avoid this problem. 2. The type of second parameter in g_ptr_array_add() is 'gpointer' {aka 'void *'}, but the type of reg->name is 'const char*'. Cast the type of

Re: [PATCH] misc/pca955*: Move models under hw/gpio

2024-03-25 Thread Andrew Jeffery
On Mon, 2024-03-25 at 14:48 +0100, Cédric Le Goater wrote: > The PCA9552 and PCA9554 devices are both I2C GPIO controllers and the > PCA9552 also can drive LEDs. Do all the necessary adjustments to move > the models under hw/gpio. > > Cc: Glenn Miles > Signed-off-by: Cédric Le Goater Acked-by:

Re: [External] : Re: [PATCH v4 2/2] vhost: Perform memory section dirty scans once per iteration

2024-03-25 Thread Si-Wei Liu
On 3/24/2024 11:13 PM, Jason Wang wrote: On Sat, Mar 23, 2024 at 5:14 AM Si-Wei Liu wrote: On 3/21/2024 10:08 PM, Jason Wang wrote: On Fri, Mar 22, 2024 at 5:43 AM Si-Wei Liu wrote: On 3/20/2024 8:56 PM, Jason Wang wrote: On Thu, Mar 21, 2024 at 5:03 AM Si-Wei Liu wrote: On

[PATCH] target/hppa: Fix diag instructions to set/restore shadow registers

2024-03-25 Thread Helge Deller
The 32-bit 7300LC CPU and the 64-bit PCX-W 8500 CPU use different diag instructions to save or restore the CPU registers to/from the shadow registers. Implement those per-CPU architecture diag instructions to fix those parts of the HP ODE testcases (L2DIAG and WDIAG, section 1) which test the

Re: [RFC PATCH 07/12] hw/arm/smmu-common: Support nested translation

2024-03-25 Thread Mostafa Saleh
Hi Julien, On Mon, Mar 25, 2024 at 02:20:07PM +, Julien Grall wrote: > Hi Mostafa, > > On 25/03/2024 10:14, Mostafa Saleh wrote: > > @@ -524,7 +551,7 @@ static int smmu_ptw_64_s2(SMMUTransCfg *cfg, > > tlbe->entry.translated_addr = gpa; > > tlbe->entry.iova = ipa & ~mask;

Re: [PATCH v2] target/hppa: Fix unit carry conditions

2024-03-25 Thread Helge Deller
On 3/25/24 20:02, Richard Henderson wrote: Split do_unit_cond to do_unit_zero_cond to only handle conditions versus zero. These are the only ones that are legal for UXOR. Simplify trans_uxor accordingly. Rename do_unit to do_unit_addsub, since xor has been split. Properly compute carry-out

Re: [RFC 0/8] virtio,vhost: Add VIRTIO_F_IN_ORDER support

2024-03-25 Thread Eugenio Perez Martin
On Mon, Mar 25, 2024 at 5:52 PM Jonah Palmer wrote: > > > > On 3/22/24 7:18 AM, Eugenio Perez Martin wrote: > > On Thu, Mar 21, 2024 at 4:57 PM Jonah Palmer > > wrote: > >> > >> The goal of these patches is to add support to a variety of virtio and > >> vhost devices for the VIRTIO_F_IN_ORDER

Re: [PATCH v3 0/4] fix two edge cases related to stream block jobs

2024-03-25 Thread Stefan Hajnoczi
On Fri, Mar 22, 2024 at 10:50:05AM +0100, Fiona Ebner wrote: > Changes in v3: > * Also deal with edge case in bdrv_next_cleanup(). Haven't run > into an actual issue there, but at least the caller in > migration/block.c uses bdrv_nb_sectors() which, while not a > coroutine

Re: [PATCH v3 4/4] iotests: add test for stream job with an unaligned prefetch read

2024-03-25 Thread Stefan Hajnoczi
On Fri, Mar 22, 2024 at 10:50:09AM +0100, Fiona Ebner wrote: > Previously, bdrv_pad_request() could not deal with a NULL qiov when > a read needed to be aligned. During prefetch, a stream job will pass a > NULL qiov. Add a test case to cover this scenario. > > By accident, also covers a previous

Re: [PATCH v3 3/4] block-backend: fix edge case in bdrv_next_cleanup() where BDS associated to BB changes

2024-03-25 Thread Stefan Hajnoczi
On Fri, Mar 22, 2024 at 10:50:08AM +0100, Fiona Ebner wrote: > Same rationale as for commit "block-backend: fix edge case in > bdrv_next() where BDS associated to BB changes". The block graph might > change between the bdrv_next() call and the bdrv_next_cleanup() call, > so it could be that the

Re: [PATCH v3 2/4] block-backend: fix edge case in bdrv_next() where BDS associated to BB changes

2024-03-25 Thread Stefan Hajnoczi
On Fri, Mar 22, 2024 at 10:50:07AM +0100, Fiona Ebner wrote: > The old_bs variable in bdrv_next() is currently determined by looking > at the old block backend. However, if the block graph changes before > the next bdrv_next() call, it might be that the associated BDS is not > the same that was

Re: [PATCH v3 1/4] block/io: accept NULL qiov in bdrv_pad_request

2024-03-25 Thread Stefan Hajnoczi
On Fri, Mar 22, 2024 at 10:50:06AM +0100, Fiona Ebner wrote: > From: Stefan Reiter > > Some operations, e.g. block-stream, perform reads while discarding the > results (only copy-on-read matters). In this case, they will pass NULL > as the target QEMUIOVector, which will however trip

Re: [RFC 4/8] virtio: Implement in-order handling for virtio devices

2024-03-25 Thread Eugenio Perez Martin
On Mon, Mar 25, 2024 at 6:35 PM Jonah Palmer wrote: > > > > On 3/22/24 6:46 AM, Eugenio Perez Martin wrote: > > On Thu, Mar 21, 2024 at 4:57 PM Jonah Palmer > > wrote: > >> > >> Implements in-order handling for most virtio devices using the > >> VIRTIO_F_IN_ORDER transport feature, specifically

target/hppa: be,n nullifying first insn at branch target?

2024-03-25 Thread Sven Schnelle
Hi Richard, one of the last issue i'm seeing with 64bit HP-UX 11.11 is a crash of ld64 while building (linking) the kernel. The program is killed due to a unaligned access. I've wrote a logfile, and it looks like be,n is nullifying the first instruction at the branch target: IN:

[PATCH v2 2/4] linux-user: Fix shmat() strace

2024-03-25 Thread Ilya Leoshkevich
The indices of arguments passed to print_shmat() are all off-by-1, because arg1 is the ipc() command. Fix them. New output for linux-shmat-maps test: 3501769 shmat(4784214,0x0080,SHM_RND) = 0 Fixes: 9f7c97324c27 ("linux-user: Add strace for shmat") Reviewed-by: Richard Henderson

[PATCH v2 4/4] tests/tcg: Test shmat(NULL)

2024-03-25 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/linux/linux-shmat-null.c | 38 1 file changed, 38 insertions(+) create mode 100644 tests/tcg/multiarch/linux/linux-shmat-null.c diff --git

[PATCH v2 0/4] linux-user: Fix shmat(NULL) for h != g

2024-03-25 Thread Ilya Leoshkevich
v1: https://lore.kernel.org/qemu-devel/20240325153313.526888-1-...@linux.ibm.com/ v1 -> v2: Remove an unnecessary ifdef, add R-Bs (Richard). Hi, I noticed that while shmat() now works with /proc/self/maps, shmat(NULL) got broken. This series fixes that along with two related strace issues, and

[PATCH v2 1/4] linux-user: Fix semctl() strace

2024-03-25 Thread Ilya Leoshkevich
The indices of arguments used with semctl() are all off-by-1, because arg1 is the ipc() command. Fix them. While at it, reuse print_semctl(). New output (for a small test program): 3540333 semctl(999,888,SEM_INFO,0x7fe5051ee9a0) = -1 errno=14 (Bad address) Fixes: 7ccfb2eb5f9d ("Fix

[PATCH v2 3/4] linux-user: Fix shmat(NULL) for h != g

2024-03-25 Thread Ilya Leoshkevich
In the h != g && shmaddr == NULL && !reserved_va case, target_shmat() incorrectly mmap()s the initial anonymous range with MAP_FIXED_NOREPLACE, even though the earlier mmap_find_vma() has already reserved the respective address range. Fix by using MAP_FIXED when "mapped", which is set after

Re: [PATCH v3 7/8] plugins: distinct types for callbacks

2024-03-25 Thread Richard Henderson
On 3/25/24 02:41, Pierrick Bouvier wrote: To prevent errors when writing new types of callbacks or inline operations, we split callbacks data to distinct types. Signed-off-by: Pierrick Bouvier --- include/qemu/plugin.h | 46 ++--- plugins/plugin.h | 2 +-

Re: [PATCH v3 8/8] plugins: extract cpu_index generate

2024-03-25 Thread Richard Henderson
On 3/25/24 02:41, Pierrick Bouvier wrote: Signed-off-by: Pierrick Bouvier --- accel/tcg/plugin-gen.c | 28 +--- 1 file changed, 13 insertions(+), 15 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH v3 5/8] plugins: conditional callbacks

2024-03-25 Thread Richard Henderson
On 3/25/24 02:41, Pierrick Bouvier wrote: Extend plugins API to support callback called with a given criteria (evaluated inline). Added functions: - qemu_plugin_register_vcpu_tb_exec_cond_cb - qemu_plugin_register_vcpu_insn_exec_cond_cb They expect as parameter a condition, a qemu_plugin_u64_t

Re: [RFC 1/8] virtio: Define InOrderVQElement

2024-03-25 Thread Eugenio Perez Martin
On Mon, Mar 25, 2024 at 6:08 PM Jonah Palmer wrote: > > > > On 3/22/24 5:45 AM, Eugenio Perez Martin wrote: > > On Thu, Mar 21, 2024 at 4:57 PM Jonah Palmer > > wrote: > >> > >> Define the InOrderVQElement structure for the VIRTIO_F_IN_ORDER > >> transport feature implementation. > >> > >> The

Re: [PATCH v3 4/8] tests/plugin/inline: add test for STORE_U64 inline op

2024-03-25 Thread Richard Henderson
On 3/25/24 02:41, Pierrick Bouvier wrote: Signed-off-by: Pierrick Bouvier --- tests/plugin/inline.c | 41 + 1 file changed, 37 insertions(+), 4 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH v3 3/8] plugins: add new inline op STORE_U64

2024-03-25 Thread Richard Henderson
On 3/25/24 02:41, Pierrick Bouvier wrote: @@ -152,6 +152,18 @@ static void gen_inline_add_u64_cb(struct qemu_plugin_dyn_cb *cb) tcg_temp_free_ptr(ptr); } +static void gen_inline_store_u64_cb(struct qemu_plugin_dyn_cb *cb) +{ +TCGv_ptr ptr =

Re: [PATCH v3 2/8] plugins: extract generate ptr for qemu_plugin_u64

2024-03-25 Thread Richard Henderson
On 3/25/24 02:41, Pierrick Bouvier wrote: Signed-off-by: Pierrick Bouvier --- accel/tcg/plugin-gen.c | 27 ++- 1 file changed, 18 insertions(+), 9 deletions(-) Reviewed-by: Richard Henderson r~

[PATCH v6 00/12] Enabling DCD emulation support in Qemu

2024-03-25 Thread nifan . cxl
From: Fan Ni A git tree of his series can be found here (with one extra commit on top for printing out accepted/pending extent list): https://github.com/moking/qemu/tree/dcd-v6 v5->v6: 1. Picked up tags; 2. Renamed start_region_id to start_rid; (Jonathan) 3. For get extent list mailbox

[PATCH v6 07/12] hw/mem/cxl_type3: Add DC extent list representative and get DC extent list mailbox support

2024-03-25 Thread nifan . cxl
From: Fan Ni Add dynamic capacity extent list representative to the definition of CXLType3Dev and implement get DC extent list mailbox command per CXL.spec.3.1:.8.2.9.9.9.2. Signed-off-by: Fan Ni --- hw/cxl/cxl-mailbox-utils.c | 75 - hw/mem/cxl_type3.c

[PATCH v6 02/12] hw/cxl/cxl-mailbox-utils: Add dynamic capacity region representative and mailbox command support

2024-03-25 Thread nifan . cxl
From: Fan Ni Per cxl spec r3.1, add dynamic capacity region representative based on Table 8-165 and extend the cxl type3 device definition to include dc region information. Also, based on info in 8.2.9.9.9.1, add 'Get Dynamic Capacity Configuration' mailbox support. Note: we store region decode

[PATCH v6 10/12] hw/mem/cxl_type3: Add dpa range validation for accesses to DC regions

2024-03-25 Thread nifan . cxl
From: Fan Ni All dpa ranges in the DC regions are invalid to access until an extent covering the range has been added. Add a bitmap for each region to record whether a DC block in the region has been backed by DC extent. For the bitmap, a bit in the bitmap represents a DC block. When a DC extent

[PATCH v6 12/12] hw/mem/cxl_type3: Allow to release extent superset in QMP interface

2024-03-25 Thread nifan . cxl
From: Fan Ni Before the change, the QMP interface used for add/release DC extents only allows to release an extent whose DPA range is contained by a single accepted extent in the device. With the change, we relax the constraints. As long as the DPA range of the extent is covered by accepted

[PATCH v6 11/12] hw/cxl/cxl-mailbox-utils: Add superset extent release mailbox support

2024-03-25 Thread nifan . cxl
From: Fan Ni With the change, we extend the extent release mailbox command processing to allow more flexible release. As long as the DPA range of the extent to release is covered by accepted extent(s) in the device, the release can be performed. Signed-off-by: Fan Ni ---

[PATCH v6 03/12] include/hw/cxl/cxl_device: Rename mem_size as static_mem_size for type3 memory devices

2024-03-25 Thread nifan . cxl
From: Fan Ni Rename mem_size as static_mem_size for type3 memdev to cover static RAM and pmem capacity, preparing for the introduction of dynamic capacity to support dynamic capacity devices. Reviewed-by: Jonathan Cameron Signed-off-by: Fan Ni --- hw/cxl/cxl-mailbox-utils.c | 4 ++--

[PATCH v6 04/12] hw/mem/cxl_type3: Add support to create DC regions to type3 memory devices

2024-03-25 Thread nifan . cxl
From: Fan Ni With the change, when setting up memory for type3 memory device, we can create DC regions. A property 'num-dc-regions' is added to ct3_props to allow users to pass the number of DC regions to create. To make it easier, other region parameters like region base, length, and block size

[PATCH v6 06/12] hw/mem/cxl_type3: Add host backend and address space handling for DC regions

2024-03-25 Thread nifan . cxl
From: Fan Ni Add (file/memory backed) host backend, all the dynamic capacity regions will share a single, large enough host backend. Set up address space for DC regions to support read/write operations to dynamic capacity for DCD. With the change, following supports are added: 1. Add a new

[PATCH v6 05/12] hw/mem/cxl-type3: Refactor ct3_build_cdat_entries_for_mr to take mr size instead of mr as argument

2024-03-25 Thread nifan . cxl
From: Fan Ni The function ct3_build_cdat_entries_for_mr only uses size of the passed memory region argument, refactor the function definition to make the passed arguments more specific. Reviewed-by: Jonathan Cameron Signed-off-by: Fan Ni --- hw/mem/cxl_type3.c | 15 +-- 1 file

[PATCH v6 09/12] hw/cxl/events: Add qmp interfaces to add/release dynamic capacity extents

2024-03-25 Thread nifan . cxl
From: Fan Ni To simulate FM functionalities for initiating Dynamic Capacity Add (Opcode 5604h) and Dynamic Capacity Release (Opcode 5605h) as in CXL spec r3.1 7.6.7.6.5 and 7.6.7.6.6, we implemented two QMP interfaces to issue add/release dynamic capacity extents requests. With the change, we

[PATCH v6 01/12] hw/cxl/cxl-mailbox-utils: Add dc_event_log_size field to output payload of identify memory device command

2024-03-25 Thread nifan . cxl
From: Fan Ni Based on CXL spec r3.1 Table 8-127 (Identify Memory Device Output Payload), dynamic capacity event log size should be part of output of the Identify command. Add dc_event_log_size to the output payload for the host to get the info. Reviewed-by: Jonathan Cameron Signed-off-by: Fan

[PATCH v6 08/12] hw/cxl/cxl-mailbox-utils: Add mailbox commands to support add/release dynamic capacity response

2024-03-25 Thread nifan . cxl
From: Fan Ni Per CXL spec 3.1, two mailbox commands are implemented: Add Dynamic Capacity Response (Opcode 4802h) 8.2.9.9.9.3, and Release Dynamic Capacity (Opcode 4803h) 8.2.9.9.9.4. For the process of the above two commands, we use two-pass approach. Pass 1: Check whether the input payload is

[PATCH v2] target/hppa: Fix unit carry conditions

2024-03-25 Thread Richard Henderson
Split do_unit_cond to do_unit_zero_cond to only handle conditions versus zero. These are the only ones that are legal for UXOR. Simplify trans_uxor accordingly. Rename do_unit to do_unit_addsub, since xor has been split. Properly compute carry-out bits for add and subtract, mirroring the code in

Re: [RFC v2 4/5] target/arm: Enable feature ARM_FEATURE_EL2 if EL2 is supported

2024-03-25 Thread Eric Auger
Hi Peter, On 3/5/24 17:49, Peter Maydell wrote: > On Fri, 9 Feb 2024 at 16:00, Eric Auger wrote: >> From: Haibo Xu >> >> KVM_CAP_ARM_EL2 must be supported by the cpu to enable ARM_FEATURE_EL2. >> In case the host does support NV, expose the feature. >> >> Signed-off-by: Haibo Xu >>

Re: [PATCH 4/4] tests/tcg: Test shmat(NULL)

2024-03-25 Thread Richard Henderson
On 3/25/24 05:07, Ilya Leoshkevich wrote: Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/linux/linux-shmat-null.c | 38 1 file changed, 38 insertions(+) create mode 100644 tests/tcg/multiarch/linux/linux-shmat-null.c

Re: [PATCH 3/4] linux-user: Fix shmat(NULL) for h != g

2024-03-25 Thread Richard Henderson
On 3/25/24 05:07, Ilya Leoshkevich wrote: In the h != g && shmaddr == NULL && !reserved_va case, target_shmat() incorrectly mmap()s the initial anonymous range with MAP_FIXED_NOREPLACE, even though the earlier mmap_find_vma() has already reserved the respective address range. Fix by using

Re: [PATCH 1/4] linux-user: Fix semctl() strace

2024-03-25 Thread Richard Henderson
On 3/25/24 05:07, Ilya Leoshkevich wrote: The indices of arguments used with semctl() are all off-by-1, because arg1 is the ipc() command. Fix them. While at it, reuse print_semctl(). New output (for a small test program): 3540333 semctl(999,888,SEM_INFO,0x7fe5051ee9a0) = -1 errno=14

Re: [PATCH 2/4] linux-user: Fix shmat() strace

2024-03-25 Thread Richard Henderson
On 3/25/24 05:07, Ilya Leoshkevich wrote: The indices of arguments passed to print_shmat() are all off-by-1, because arg1 is the ipc() command. Fix them. New output for linux-shmat-maps test: 3501769 shmat(4784214,0x0080,SHM_RND) = 0 Fixes: 9f7c97324c27 ("linux-user: Add

Re: [PATCH for-9.0] target/arm: take HSTR traps of cp15 accesses to EL2, not EL1

2024-03-25 Thread Richard Henderson
On 3/25/24 03:31, Peter Maydell wrote: The HSTR_EL2 register allows the hypervisor to trap AArch32 EL1 and EL0 accesses to cp15 registers. We incorrectly implemented this so they trap to EL1 when we detect the need for a HSTR trap at code generation time. (The check in access_check_cp_reg()

Re: [PATCH] hw/s390x: Include missing 'cpu.h' header

2024-03-25 Thread Eric Farman
On Fri, 2024-03-22 at 17:28 +0100, Philippe Mathieu-Daudé wrote: > "cpu.h" is implicitly included. Include it explicitly to > avoid the following error when refactoring headers: > >   hw/s390x/s390-stattrib.c:86:40: error: use of undeclared identifier > 'TARGET_PAGE_SIZE' >   len =

Re: [PATCH trivial for-9.0] hw/i386/fw_cfg.c: fix non-legacy smbios build

2024-03-25 Thread Michael Tokarev
25.03.2024 18:20, Igor Mammedov wrote On Mon, 25 Mar 2024 16:09:20 +0300 Michael Tokarev wrote: When building qemu with smbios but not legacy mode (eg minimal microvm build), link fails with: hw/i386/fw_cfg.c:74: undefined reference to `smbios_get_table_legacy' This is because fw_cfg

Re: [PATCH v3 2/2] Implement SSH commands in QEMU GA for Windows

2024-03-25 Thread Philippe Mathieu-Daudé
On 22/3/24 18:46, aidan_le...@selinc.com wrote: From: Aidan Leuck Signed-off-by: Aidan Leuck --- qga/commands-windows-ssh.c | 791 + Huge file, I'm skipping it. qga/commands-windows-ssh.h | 26 ++ qga/meson.build| 5 +-

Re: [RFC PATCH 00/12] SMMUv3 nested translation support

2024-03-25 Thread Marcin Juszkiewicz
W dniu 25.03.2024 o 11:13, Mostafa Saleh pisze: Currently, QEMU supports emulating either stage-1 or stage-2 SMMUs but not nested instances. This patch series adds support for nested translation in SMMUv3, this is controlled by property “arm-smmuv3.stage=nested”, and advertised to guests as

Re: [RFC v2 2/5] hw/arm: Allow setting KVM vGIC maintenance IRQ

2024-03-25 Thread Eric Auger
Hi Peter, On 3/5/24 17:46, Peter Maydell wrote: > On Fri, 9 Feb 2024 at 16:00, Eric Auger wrote: >> From: Haibo Xu >> >> Allow virt arm machine to set the intid for the KVM GIC maintenance >> interrupt. >> >> Signed-off-by: Haibo Xu >> Signed-off-by: Miguel Luis >> Signed-off-by: Eric Auger

Re: [PATCH v3 1/2] Refactor common functions between POSIX and Windows implementation

2024-03-25 Thread Philippe Mathieu-Daudé
Hi Aidan, On 22/3/24 18:46, aidan_le...@selinc.com wrote: From: Aidan Leuck Signed-off-by: Aidan Leuck --- qga/commands-posix-ssh.c | 47 + qga/commands-ssh-core.c | 57 qga/commands-ssh-core.h | 8 ++

Re: [PATCH v1] qapi: document parameters of query-cpu-model-* QAPI commands

2024-03-25 Thread Markus Armbruster
David Hildenbrand writes: >>> # >>> # Usually, a CPU model is compared against the maximum possible CPU >>> # model of a certain configuration (e.g. the "host" model for KVM). >>> @@ -154,7 +155,14 @@ >>> # Some architectures may not support comparing CPU models. s390x >>> # supports

Re: [RFC 4/8] virtio: Implement in-order handling for virtio devices

2024-03-25 Thread Jonah Palmer
On 3/22/24 6:46 AM, Eugenio Perez Martin wrote: On Thu, Mar 21, 2024 at 4:57 PM Jonah Palmer wrote: Implements in-order handling for most virtio devices using the VIRTIO_F_IN_ORDER transport feature, specifically those who call virtqueue_push to push their used elements onto the used ring.

Re: [PATCH] meson: Fix MESONINTROSPECT parsing

2024-03-25 Thread Michael Tokarev
25.03.2024 20:23, Peter Maydell : On Sat, 12 Aug 2023 at 13:10, Akihiko Odaki wrote: ... The problem is that Meson uses a different logic for escaping arguments in MESONINTROSPECT on Windows. I'll wait till Meson maintainers figure out how MESONINTROSPECT should be used. For details, see:

Re: [PATCH] meson: Fix MESONINTROSPECT parsing

2024-03-25 Thread Peter Maydell
On Sat, 12 Aug 2023 at 13:10, Akihiko Odaki wrote: > > On 2023/08/12 15:15, Akihiko Odaki wrote: > > The arguments in MESONINTROSPECT are quoted with shlex.quote() so it > > must be parsed with shlex.split(). > > > > Fixes: cf60ccc330 ("cutils: Introduce bundle mechanism") > > Reported-by:

Re: [RFC 1/8] virtio: Define InOrderVQElement

2024-03-25 Thread Jonah Palmer
On 3/22/24 5:45 AM, Eugenio Perez Martin wrote: On Thu, Mar 21, 2024 at 4:57 PM Jonah Palmer wrote: Define the InOrderVQElement structure for the VIRTIO_F_IN_ORDER transport feature implementation. The InOrderVQElement structure is used to encapsulate out-of-order VirtQueueElement data

Re: how do the iotests pick a machine model to run on ?

2024-03-25 Thread Thomas Huth
On 19/01/2024 17.18, Peter Maydell wrote: On Fri, 19 Jan 2024 at 15:26, Peter Maydell wrote: (Also, we should probably put an entry for sh4 in machine_map, because the default board type (shix) is about to be deprecated, and the r2d board type is thus a better choice.) The good news is if we

Re: [RFC 0/8] virtio,vhost: Add VIRTIO_F_IN_ORDER support

2024-03-25 Thread Jonah Palmer
On 3/22/24 7:18 AM, Eugenio Perez Martin wrote: On Thu, Mar 21, 2024 at 4:57 PM Jonah Palmer wrote: The goal of these patches is to add support to a variety of virtio and vhost devices for the VIRTIO_F_IN_ORDER transport feature. This feature indicates that all buffers are used by the

Re: [PULL v2 0/7] target-arm queue

2024-03-25 Thread Peter Maydell
garch-20240322' of https://gitlab.com/gaosong/qemu into > staging (2024-03-22 10:59:57 +) > > are available in the Git repository at: > > https://git.linaro.org/people/pmaydell/qemu-arm.git > tags/pull-target-arm-20240325-1 > > for you to fetch changes up to fe3e3

Re: [PULL 0/9] Patches for QEMU 9.0-rc1

2024-03-25 Thread Peter Maydell
On Mon, 25 Mar 2024 at 14:12, Thomas Huth wrote: > > The following changes since commit 853546f8128476eefb701d4a55b2781bb3a46faa: > > Merge tag 'pull-loongarch-20240322' of https://gitlab.com/gaosong/qemu into > staging (2024-03-22 10:59:57 +) > > are available in the Git repository at: >

Re: [PULL 0/3] Migration 20240322 patches

2024-03-25 Thread Peter Maydell
On Fri, 22 Mar 2024 at 16:15, wrote: > > From: Peter Xu > > The following changes since commit 853546f8128476eefb701d4a55b2781bb3a46faa: > > Merge tag 'pull-loongarch-20240322' of https://gitlab.com/gaosong/qemu into > staging (2024-03-22 10:59:57 +) > > are available in the Git

Re: [PATCH] qapi/block-core: improve Qcow2OverlapCheckFlags documentation

2024-03-25 Thread Vladimir Sementsov-Ogievskiy
On 25.03.24 16:04, Markus Armbruster wrote: Vladimir Sementsov-Ogievskiy writes: Most of fields have no description at all. Let's fix that. Still, no reason to place here more detailed descriptions of what these structures are, as we have public Qcow2 format specification. Signed-off-by:

Re: [PATCH v1] qapi: document parameters of query-cpu-model-* QAPI commands

2024-03-25 Thread David Hildenbrand
# # Usually, a CPU model is compared against the maximum possible CPU # model of a certain configuration (e.g. the "host" model for KVM). @@ -154,7 +155,14 @@ # Some architectures may not support comparing CPU models. s390x # supports comparing CPU models. # -# Returns: a

Re: [PATCH trivial for-9.0] hw/i386/fw_cfg.c: fix non-legacy smbios build

2024-03-25 Thread Igor Mammedov
On Mon, 25 Mar 2024 14:40:21 +0100 Philippe Mathieu-Daudé wrote: > Hi Michael, > > On 25/3/24 14:09, Michael Tokarev wrote: > > When building qemu with smbios but not legacy mode (eg minimal microvm > > build), > > link fails with: > > > >hw/i386/fw_cfg.c:74: undefined reference to

Re: [PATCH v1] coroutine: avoid inserting duplicate coroutine to co_queue_wakeup

2024-03-25 Thread Eric Blake
I've seen (and agree with) Stefan's reply that a more thorough audit is needed, but am still providing a preliminary review based on what I see here. On Mon, Mar 25, 2024 at 05:18:50PM +0800, zhuyangyang via wrote: > If g_main_loop_run()/aio_poll() is called in the coroutine context, > the

Re: [PATCH] qapi/block-core: improve Qcow2OverlapCheckFlags documentation

2024-03-25 Thread Markus Armbruster
Squashing in diff --git a/qapi/pragma.json b/qapi/pragma.json index 99e4052ab3..9e28de1721 100644 --- a/qapi/pragma.json +++ b/qapi/pragma.json @@ -72,7 +72,6 @@ 'QCryptoAkCipherKeyType', 'QCryptodevBackendServiceType', 'QKeyCode', -'Qcow2OverlapCheckFlags',

Re: [PATCH v1] coroutine: avoid inserting duplicate coroutine to co_queue_wakeup

2024-03-25 Thread Stefan Hajnoczi
On Mon, Mar 25, 2024 at 05:18:50PM +0800, zhuyangyang wrote: > If g_main_loop_run()/aio_poll() is called in the coroutine context, > the pending coroutine may be woken up repeatedly, and the co_queue_wakeup > may be disordered. aio_poll() must not be called from coroutine context: bool

Re: [PATCH] qapi: document leftover members in qapi/stats.json

2024-03-25 Thread Markus Armbruster
Squashing in diff --git a/qapi/pragma.json b/qapi/pragma.json index 1a302981c1..99e4052ab3 100644 --- a/qapi/pragma.json +++ b/qapi/pragma.json @@ -75,8 +75,6 @@ 'Qcow2OverlapCheckFlags', 'RbdAuthMode', 'RbdImageEncryptionFormat', -'StatsFilter', -

Re: [PATCH] qapi: document leftover members in qapi/run-state.json

2024-03-25 Thread Markus Armbruster
Squashing in diff --git a/qapi/pragma.json b/qapi/pragma.json index 92715d22b3..1a302981c1 100644 --- a/qapi/pragma.json +++ b/qapi/pragma.json @@ -57,7 +57,6 @@ 'DummyForceArrays', 'DummyVirtioForceArrays', 'GrabToggleKeys', -'GuestPanicInformationHyperV',

[PATCH] tests/qemu-iotests: Test 157 and 227 require virtio-blk

2024-03-25 Thread Thomas Huth
Tests 157 and 227 use the virtio-blk device, so we have to mark these tests accordingly to be skipped if this devices is not available (e.g. when running the tests with qemu-system-avr only). Signed-off-by: Thomas Huth --- tests/qemu-iotests/157 | 2 ++ tests/qemu-iotests/227 | 2 ++ 2 files

Re: [PATCH] qapi: document InputMultiTouchType

2024-03-25 Thread Markus Armbruster
Squashing in diff --git a/qapi/pragma.json b/qapi/pragma.json index 6929ab776e..92715d22b3 100644 --- a/qapi/pragma.json +++ b/qapi/pragma.json @@ -62,8 +62,6 @@ 'ImageInfoSpecificKind', 'InputAxis', 'InputButton', -'InputMultiTouchEvent', -

Re: [PATCH v1] qapi: document parameters of query-cpu-model-* QAPI commands

2024-03-25 Thread Markus Armbruster
David Hildenbrand writes: > Let's document the parameters of these commands, so we can remove them > from the "documentation-exceptions" list. > > While at it, extend the "Returns:" documentation as well, fixing a wrong > use of CpuModelBaselineInfo vs. CpuModelCompareInfo for >

[PATCH 0/4] linux-user: Fix shmat(NULL) for h != g

2024-03-25 Thread Ilya Leoshkevich
Hi, I noticed that while shmat() now works with /proc/self/maps, shmat(NULL) got broken. This series fixes that along with two related strace issues, and adds a test. Best regards, Ilya Ilya Leoshkevich (4): linux-user: Fix semctl() strace linux-user: Fix shmat() strace linux-user: Fix

[PATCH 2/4] linux-user: Fix shmat() strace

2024-03-25 Thread Ilya Leoshkevich
The indices of arguments passed to print_shmat() are all off-by-1, because arg1 is the ipc() command. Fix them. New output for linux-shmat-maps test: 3501769 shmat(4784214,0x0080,SHM_RND) = 0 Fixes: 9f7c97324c27 ("linux-user: Add strace for shmat") Signed-off-by: Ilya

[PATCH 1/4] linux-user: Fix semctl() strace

2024-03-25 Thread Ilya Leoshkevich
The indices of arguments used with semctl() are all off-by-1, because arg1 is the ipc() command. Fix them. While at it, reuse print_semctl(). New output (for a small test program): 3540333 semctl(999,888,SEM_INFO,0x7fe5051ee9a0) = -1 errno=14 (Bad address) Fixes: 7ccfb2eb5f9d ("Fix

[PATCH 4/4] tests/tcg: Test shmat(NULL)

2024-03-25 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/linux/linux-shmat-null.c | 38 1 file changed, 38 insertions(+) create mode 100644 tests/tcg/multiarch/linux/linux-shmat-null.c diff --git

[PATCH 3/4] linux-user: Fix shmat(NULL) for h != g

2024-03-25 Thread Ilya Leoshkevich
In the h != g && shmaddr == NULL && !reserved_va case, target_shmat() incorrectly mmap()s the initial anonymous range with MAP_FIXED_NOREPLACE, even though the earlier mmap_find_vma() has already reserved the respective address range. Fix by using MAP_FIXED when "mapped", which is set after

Re: [PATCH trivial for-9.0] hw/i386/fw_cfg.c: fix non-legacy smbios build

2024-03-25 Thread Igor Mammedov
On Mon, 25 Mar 2024 16:09:20 +0300 Michael Tokarev wrote: > When building qemu with smbios but not legacy mode (eg minimal microvm build), > link fails with: > > hw/i386/fw_cfg.c:74: undefined reference to `smbios_get_table_legacy' > > This is because fw_cfg interface can call this function

[PATCH-for-9.0 v3 2/3] hw/misc/stm32l4x5_rcc: Inline clock_update() in clock_mux_update()

2024-03-25 Thread Philippe Mathieu-Daudé
Trivial inlining in preliminary patch to make the next one easier to review. Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/stm32l4x5_rcc.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/misc/stm32l4x5_rcc.c b/hw/misc/stm32l4x5_rcc.c index bc2d63528b..49b90afdf0

[PATCH-for-9.0 v3 1/3] hw/clock: Let clock_set_mul_div() return a boolean value

2024-03-25 Thread Philippe Mathieu-Daudé
Let clock_set_mul_div() return a boolean value whether the clock has been updated or not, similarly to clock_set(). Return early when clock_set_mul_div() is called with same mul/div values the clock has. Acked-by: Luc Michel Signed-off-by: Philippe Mathieu-Daudé --- docs/devel/clocks.rst | 4

[PATCH-for-9.0 v3 0/3] hw/clock: Propagate clock changes when STM32L4X5 MUX is updated

2024-03-25 Thread Philippe Mathieu-Daudé
Since v2: - Simpler approach Since v1: - Rework API to only propagate when both clock_set and clock_set_mul_div modified the clock params (Peter & Luc). - Use that in zynq_slcr. Per https://www.qemu.org/docs/master/devel/clocks.html#clock-multiplier-and-divider-settings: Note that

[PATCH-for-9.0 v3 3/3] hw/misc/stm32l4x5_rcc: Propagate period when enabling a clock

2024-03-25 Thread Philippe Mathieu-Daudé
From: Arnaud Minier The "clock_set_mul_div" function doesn't propagate the clock period to the children if it is changed (e.g. by enabling/disabling a clock multiplexer). This was overlooked during the implementation due to late changes. This commit propagates the change if the multiplier or

Re: [PATCH-for-9.0? v2 2/8] hw/clock: Pass optional argument to clock_set()

2024-03-25 Thread Philippe Mathieu-Daudé
On 25/3/24 16:11, Philippe Mathieu-Daudé wrote: On 25/3/24 16:03, Peter Maydell wrote: On Mon, 25 Mar 2024 at 15:01, Philippe Mathieu-Daudé wrote: On 25/3/24 15:44, Peter Maydell wrote: On Mon, 25 Mar 2024 at 14:39, Philippe Mathieu-Daudé wrote: On 25/3/24 14:47, Peter Maydell wrote: On

Re: [PATCH trivial for-9.0] hw/i386/fw_cfg.c: fix non-legacy smbios build

2024-03-25 Thread Igor Mammedov
On Mon, 25 Mar 2024 16:09:20 +0300 Michael Tokarev wrote: > When building qemu with smbios but not legacy mode (eg minimal microvm build), > link fails with: > > hw/i386/fw_cfg.c:74: undefined reference to `smbios_get_table_legacy' > > This is because fw_cfg interface can call this function

Re: [PATCH-for-9.0? v2 2/8] hw/clock: Pass optional argument to clock_set()

2024-03-25 Thread Philippe Mathieu-Daudé
On 25/3/24 16:03, Peter Maydell wrote: On Mon, 25 Mar 2024 at 15:01, Philippe Mathieu-Daudé wrote: On 25/3/24 15:44, Peter Maydell wrote: On Mon, 25 Mar 2024 at 14:39, Philippe Mathieu-Daudé wrote: On 25/3/24 14:47, Peter Maydell wrote: On Mon, 25 Mar 2024 at 13:33, Philippe

Re: [PATCH for-9.1 v5 1/3] hw: Add compat machines for 9.1

2024-03-25 Thread Thomas Huth
On 25/03/2024 15.14, Paolo Bonzini wrote: Add 9.1 machine types for arm/i440fx/m68k/q35/s390x/spapr. Cc: Cornelia Huck Cc: Thomas Huth Cc: Harsh Prateek Bora Cc: Gavin Shan Signed-off-by: Paolo Bonzini --- include/hw/boards.h| 3 +++ include/hw/i386/pc.h | 3 +++

Re: [PATCH trivial for-9.0] hw/i386/fw_cfg.c: fix non-legacy smbios build

2024-03-25 Thread Michael Tokarev
25.03.2024 16:40, Philippe Mathieu-Daudé пишет: Hi Michael, On 25/3/24 14:09, Michael Tokarev wrote: When building qemu with smbios but not legacy mode (eg minimal microvm build), link fails with:    hw/i386/fw_cfg.c:74: undefined reference to `smbios_get_table_legacy' This is because fw_cfg

Re: [PATCH-for-9.0? v2 2/8] hw/clock: Pass optional argument to clock_set()

2024-03-25 Thread Peter Maydell
On Mon, 25 Mar 2024 at 15:01, Philippe Mathieu-Daudé wrote: > > On 25/3/24 15:44, Peter Maydell wrote: > > On Mon, 25 Mar 2024 at 14:39, Philippe Mathieu-Daudé > > wrote: > >> > >> On 25/3/24 14:47, Peter Maydell wrote: > >>> On Mon, 25 Mar 2024 at 13:33, Philippe Mathieu-Daudé > >>> wrote: >

Re: [PATCH for-9.1 v5 1/3] hw: Add compat machines for 9.1

2024-03-25 Thread Cornelia Huck
On Mon, Mar 25 2024, Paolo Bonzini wrote: > Add 9.1 machine types for arm/i440fx/m68k/q35/s390x/spapr. > > Cc: Cornelia Huck > Cc: Thomas Huth > Cc: Harsh Prateek Bora > Cc: Gavin Shan > Signed-off-by: Paolo Bonzini > --- > include/hw/boards.h| 3 +++ > include/hw/i386/pc.h

[PATCH v1] qapi: document parameters of query-cpu-model-* QAPI commands

2024-03-25 Thread David Hildenbrand
Let's document the parameters of these commands, so we can remove them from the "documentation-exceptions" list. While at it, extend the "Returns:" documentation as well, fixing a wrong use of CpuModelBaselineInfo vs. CpuModelCompareInfo for query-cpu-model-comparison. Cc: Markus Armbruster Cc:

  1   2   3   >