Re: [PATCH v2] target/loongarch/kvm: Enable LSX/LASX extension

2024-01-22 Thread maobibo
On 2024/1/22 下午5:02, Song Gao wrote: The kernel had already support LSX and LASX [1], but QEMU is disable LSX/LASX for kvm. This patch adds kvm_check_cpucfg2() to check CPUCFG2. [1]: https://lore.kernel.org/all/cabgobfzhrf7e_7jk4uprmsyxty3eiuuywhc35jqncnl9s-z...@mail.gmail.com/ Signed-off-b

Re: [PATCH rfcv1 2/6] hw/pci: introduce pci_device_set/unset_iommu_device()

2024-01-22 Thread Cédric Le Goater
On 1/23/24 07:37, Duan, Zhenzhong wrote: -Original Message- From: Cédric Le Goater Subject: Re: [PATCH rfcv1 2/6] hw/pci: introduce pci_device_set/unset_iommu_device() On 1/15/24 11:13, Zhenzhong Duan wrote: From: Yi Liu This adds pci_device_set/unset_iommu_device() to set/unset I

Re: How can I know Page Table address on RAM?

2024-01-22 Thread Nicholas Piggin
On Mon Jan 22, 2024 at 6:54 PM AEST, Thomas Huth wrote: > On 22/01/2024 05.11, Junho wrote: > > Hello, > > > > I'm a QEMU user with PowerPc target architecture. > > I have some personal modifications related to tb jmp cache and chaining > > logic to improve the performance of a specific guest cod

Re: [PATCH] target/ppc: Re-name registers to match ISA

2024-01-22 Thread Cédric Le Goater
On 12/1/23 13:24, Nicholas Piggin wrote: Several registers have names that don't match the ISA (or convention with other QEMU PPC registers), making them unintuitive to use with GDB. Fortunately most of these registers are obscure and/or have not been correctly implemented in the gdb server (e.g

Re: [PATCH v6 9/9] ppc/pnv: Test pnv i2c master and connected devices

2024-01-22 Thread Cédric Le Goater
On 11/27/23 19:16, Glenn Miles wrote: Tests the following for both P9 and P10: - I2C master POR status - I2C master status after immediate reset Tests the following for powernv10-ranier only: - Config pca9552 hotplug device pins as inputs then Read the INPUT0/1 registers to verify

Re: [PATCH v3 8/8] target/ppc: Add SMT support to time facilities

2024-01-22 Thread Cédric Le Goater
On 12/1/23 13:16, Nicholas Piggin wrote: The TB, VTB, PURR, HDEC SPRs are per-LPAR registers, and the TFMR is a per-core register. Add the necessary SMT synchronisation and value sharing. The TFMR can only drive the timebase state machine via thread 0 of the core, which is almost certainly not r

Re: [PATCH v3 5/8] ppc/pnv: Wire ChipTOD model to powernv9 and powernv10 machines

2024-01-22 Thread Cédric Le Goater
On 12/1/23 13:16, Nicholas Piggin wrote: Wire the ChipTOD model to powernv9 and powernv10 machines. Suggested-by-by: Cédric Le Goater Signed-off-by: Nicholas Piggin Reviewed-by: Cédric Le Goater Thanks, C. --- include/hw/ppc/pnv_chip.h | 3 +++ hw/ppc/pnv.c | 30 +

Re: [PATCH] Make 'uri' optional for migrate QAPI

2024-01-22 Thread Het Gala
On 23/01/24 12:12 pm, Het Gala wrote: 'uri' argument should be optional, as 'uri' and 'channels' arguments are mutally exclusive in nature. Also verified by running the qemu CI/CD pipeline. ref: https://gitlab.com/galahet/Qemu/-/pipelines/1147048455 Fixes: 074dbce5fcce (migration: New migr

[PATCH] Make 'uri' optional for migrate QAPI

2024-01-22 Thread Het Gala
'uri' argument should be optional, as 'uri' and 'channels' arguments are mutally exclusive in nature. Fixes: 074dbce5fcce (migration: New migrate and migrate-incoming argument 'channels') Signed-off-by: Het Gala --- qapi/migration.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 2/8] hw/arm/highbank: Check for CPU types in machine_run_board_init()

2024-01-22 Thread Philippe Mathieu-Daudé
Restrict MachineClass::valid_cpu_types[] to the single valid CPU types. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/highbank.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index e6e27d69af..67677eb651 100644 --- a/hw/arm/highbank.c ++

[PATCH 3/8] hw/arm/vexpress: Check for CPU types in machine_run_board_init()

2024-01-22 Thread Philippe Mathieu-Daudé
Restrict MachineClass::valid_cpu_types[] to the single valid CPU types. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/vexpress.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index f1b45245d5..a3561a1b56 100644 --- a/hw/arm/vexpress.c ++

[PATCH 7/8] hw/arm/aspeed/1030: Check for CPU types in machine_run_board_init()

2024-01-22 Thread Philippe Mathieu-Daudé
Restrict MachineClass::valid_cpu_types[] to the single valid CPU type. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/aspeed.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 393c97d55e..62d08899d8 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspe

[PATCH 8/8] hw/arm/zynq: Check for CPU types in machine_run_board_init()

2024-01-22 Thread Philippe Mathieu-Daudé
Restrict MachineClass::valid_cpu_types[] to the single valid CPU type. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/xilinx_zynq.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index 66d0de139f..6ec65d4780 100644 --- a/hw/arm/xilinx_zynq.

[PATCH 0/8] hw/arm/cortex-a: Check for CPU types in machine_run_board_init()

2024-01-22 Thread Philippe Mathieu-Daudé
Following Gavin recent CPU type enforcement cleanups, restrict more single-CPU ARM machines (here Cortex-A SoC). Based-on: <20240118200643.29037-1-phi...@linaro.org> (arm-next) Philippe Mathieu-Daudé (8): hw/arm/exynos: Check for CPU types in machine_run_board_init() hw/arm/highbank: Check fo

[PATCH 4/8] hw/arm/aspeed/2400: Check for CPU types in machine_run_board_init()

2024-01-22 Thread Philippe Mathieu-Daudé
Restrict MachineClass::valid_cpu_types[] to the single valid CPU type. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/aspeed.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index cc59176563..e0e0877b1d 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/as

[PATCH 5/8] hw/arm/aspeed/2500: Check for CPU types in machine_run_board_init()

2024-01-22 Thread Philippe Mathieu-Daudé
Restrict MachineClass::valid_cpu_types[] to the single valid CPU type. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/aspeed.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index e0e0877b1d..df627096d2 100644 --- a/hw/arm/aspeed.c +++ b/h

[PATCH 6/8] hw/arm/aspeed/2600: Check for CPU types in machine_run_board_init()

2024-01-22 Thread Philippe Mathieu-Daudé
Restrict MachineClass::valid_cpu_types[] to the single valid CPU type. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/aspeed.c | 12 1 file changed, 12 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index df627096d2..393c97d55e 100644 --- a/hw/arm/aspeed.c +++ b/hw/

[PATCH 1/8] hw/arm/exynos: Check for CPU types in machine_run_board_init()

2024-01-22 Thread Philippe Mathieu-Daudé
Restrict MachineClass::valid_cpu_types[] to the single valid CPU type. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/exynos4_boards.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c index b0e13eb4f0..01c7618a67 100644 --- a/hw/arm/

RE: [PATCH rfcv1 2/6] hw/pci: introduce pci_device_set/unset_iommu_device()

2024-01-22 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH rfcv1 2/6] hw/pci: introduce >pci_device_set/unset_iommu_device() > >On 1/15/24 11:13, Zhenzhong Duan wrote: >> From: Yi Liu >> >> This adds pci_device_set/unset_iommu_device() to set/unset >> IOMMUFDDevice for a given PCI

Re: [PATCH 3/5] util/uri: Remove the uri_string_escape() function

2024-01-22 Thread Thomas Huth
On 22/01/2024 21.59, Stefan Weil wrote: Am 22.01.24 um 20:17 schrieb Thomas Huth: It is not used in QEMU - and if somebody needs this functionality, they can simply use g_uri_escape_string() from the glib instead. Signed-off-by: Thomas Huth ---   include/qemu/uri.h |  1 -   util/uri.c

Re: [PATCH 2/5] util/uri: Simplify uri_string_unescape()

2024-01-22 Thread Thomas Huth
On 22/01/2024 22.22, Stefan Weil wrote: Am 22.01.24 um 20:17 schrieb Thomas Huth: uri_string_unescape() basically does the same as the glib function g_uri_unescape_string(), with just an additional length parameter. So we can simplify this function a lot by limiting the length with g_strndup()

RE: [PATCH rfcv1 1/6] backends/iommufd_device: introduce IOMMUFDDevice

2024-01-22 Thread Duan, Zhenzhong
>-Original Message- >From: Cédric Le Goater >Subject: Re: [PATCH rfcv1 1/6] backends/iommufd_device: introduce >IOMMUFDDevice > >On 1/19/24 08:31, Duan, Zhenzhong wrote: >> >> >>> -Original Message- >>> From: Eric Auger >>> Subject: Re: [PATCH rfcv1 1/6] backends/iommufd_device:

Re: [PATCH v3 0/2] riscv: support new isa extension detection devicetree properties

2024-01-22 Thread Alistair Francis
On Mon, Jan 22, 2024 at 10:25 PM Conor Dooley wrote: > > On Mon, Jan 22, 2024 at 03:24:19PM +1000, Alistair Francis wrote: > > On Wed, Jan 10, 2024 at 8:27 PM Conor Dooley wrote: > > > > > > From: Conor Dooley > > > > > > Making it a series to keep the standalone change to riscv_isa_string() > >

Re: [PATCH 5/5] util/uri: Remove unused macros ISA_RESERVED() and ISA_GEN_DELIM()

2024-01-22 Thread Philippe Mathieu-Daudé
On 22/1/24 20:17, Thomas Huth wrote: They are not used anywhere, so there's no need to keep them around. Signed-off-by: Thomas Huth --- util/uri.c | 13 - 1 file changed, 13 deletions(-) Reviewed-by: Philippe Mathieu-Daudé (could be reordered as patch 1 to clarify it is not

Re: [PATCH v3 01/21] hw/riscv: Use misa_mxl instead of misa_mxl_max

2024-01-22 Thread Alistair Francis
On Tue, Jan 23, 2024 at 12:57 AM Alex Bennée wrote: > > From: Akihiko Odaki > > The effective MXL value matters when booting. > > Signed-off-by: Akihiko Odaki > Message-Id: <20240103173349.398526-23-alex.ben...@linaro.org> > Message-Id: <20231213-riscv-v7-1-a760156a3...@daynix.com> > Signed-off-

Re: [PATCH v4 00/13] target/riscv: add 'cpu->cfg.vlenb', remove

2024-01-22 Thread Alistair Francis
On Tue, Jan 23, 2024 at 2:11 AM Daniel Henrique Barboza wrote: > > Hi, > > This new version is rebased with a newer riscv-to-apply.next branch > (@ 096b6b0729). No other changes made. > > All patches acked. > > v4 link: > https://lore.kernel.org/qemu-riscv/20240116205817.344178-1-dbarb...@ventana

Re: [PATCH 1/5] util/uri: Remove the unused "target" argument from uri_string_unescape()

2024-01-22 Thread Philippe Mathieu-Daudé
On 22/1/24 20:17, Thomas Huth wrote: All callers pass NULL as target, so we can simplify the code by dropping this parameter. Signed-off-by: Thomas Huth --- include/qemu/uri.h | 2 +- util/uri.c | 32 ++-- 2 files changed, 15 insertions(+), 19 deletions(

Re: [PATCH 6/7] hw/riscv/virt.c: use g_autofree in virt_machine_init()

2024-01-22 Thread Philippe Mathieu-Daudé
On 22/1/24 23:15, Daniel Henrique Barboza wrote: Move 'soc_name' to the loop, and give it g_autofree, to avoid the manual g_free(). Signed-off-by: Daniel Henrique Barboza --- hw/riscv/virt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 5/7] hw/riscv/virt.c: use g_autofree in create_fdt_virtio()

2024-01-22 Thread Philippe Mathieu-Daudé
On 22/1/24 23:15, Daniel Henrique Barboza wrote: Put 'name' declaration inside the loop, with g_autofree, to avoid manually doing g_free() in each iteration. Signed-off-by: Daniel Henrique Barboza --- hw/riscv/virt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) Reviewed-by: P

Re: [PATCH 3/7] hw/riscv/virt.c: use g_autofree in create_fdt_socket_cpus()

2024-01-22 Thread Philippe Mathieu-Daudé
On 22/1/24 23:15, Daniel Henrique Barboza wrote: Move all char pointers to the loop. Use g_autofree in all of them to avoid the g_free() calls. Signed-off-by: Daniel Henrique Barboza --- hw/riscv/virt.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) Reviewed-by: Philipp

Re: [PATCH v3 37/38] tcg/s390x: Support TCG_COND_TST{EQ,NE}

2024-01-22 Thread Philippe Mathieu-Daudé
+Ilya/David On 10/1/24 23:44, Richard Henderson wrote: Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.h | 2 +- tcg/s390x/tcg-target.c.inc | 139 + 2 files changed, 97 insertions(+), 44 deletions(-) diff --git a/tcg/s390x/tcg-target.h b/

[PATCH v4] qemu-img: Fix Column Width and Improve Formatting in snapshot list

2024-01-22 Thread Abhiram Tilak
When running the command `qemu-img snapshot -l SNAPSHOT` the output of VM_CLOCK (measures the offset between host and VM clock) cannot to accommodate values in the order of thousands (4-digit). This line [1] hints on the problem. Additionally, the column width for the VM_CLOCK field was reduced fr

Re: [External] Re: [PATCH v2 04/20] So we use multifd to transmit zero pages.

2024-01-22 Thread Hao Xiang
On Thu, Nov 16, 2023 at 7:14 AM Fabiano Rosas wrote: > > Hao Xiang writes: > > > From: Juan Quintela > > > > Signed-off-by: Juan Quintela > > Reviewed-by: Leonardo Bras > > --- > > migration/multifd.c | 7 --- > > migration/options.c | 13 +++-- > > migration/ram.c | 45 +

Re: [PATCH] migration/docs: Explain two solutions for VMSD compatibility

2024-01-22 Thread Peter Xu
On Mon, Jan 22, 2024 at 12:39:06PM -0300, Fabiano Rosas wrote: > pet...@redhat.com writes: > > > From: Peter Xu > > > > The current article is not extremely easy to follow, and may contain too > > much information for someone looking for solutions on VMSD compatibility > > issues. Meanwhile, VMS

Re: [PATCH v4 0/4] Support RISC-V IOPMP

2024-01-22 Thread Ethan Chen via
On Mon, Jan 22, 2024 at 04:01:12PM +1000, Alistair Francis wrote: > On Thu, Dec 21, 2023 at 4:38 PM Ethan Chen wrote: > > > > On Mon, Dec 18, 2023 at 02:18:58PM +1000, Alistair Francis wrote: > > > On Wed, Nov 22, 2023 at 3:36 PM Ethan Chen via > > > wrote: > > > > > > > > This series implements

Re: [PATCH] tcg/arm: Fix SIGILL in tcg_out_qemu_st_direct

2024-01-22 Thread Richard Henderson
On 1/22/24 07:14, Joseph Burt wrote: When tcg_out_qemu_st_{index,direct} were merged, the direct case for MO_64 was omitted, causing qemu_st_i64 to be encoded as 0x due to underflow when adding h.base and h.index. Fixes: 1df6d611bdc2("tcg/arm: Introduce HostAddress") Signed-off-by: Josep

Re: [PATCH 0/5] migration: Fix migration state reference counting

2024-01-22 Thread Peter Xu
On Fri, Jan 19, 2024 at 08:39:17PM -0300, Fabiano Rosas wrote: > We currently have a bug when running migration code in bottom > halves. The issue has already been reported in Gitlab[1] and it > started happening very frequently on my machine for some reason. > > The issue is that we're dropping t

Re: [PATCH v3 2/2] target/ppc: Implement attn instruction on BookS 64-bit processors

2024-01-22 Thread Nicholas Piggin
On Fri Jan 19, 2024 at 8:09 AM AEST, Richard Henderson wrote: > On 1/19/24 02:25, Nicholas Piggin wrote: > > +/* attn enable check > > */ > > +static inline int check_attn_none(CPUPPCState *env) > > Don't mark inline ... > > > @@ -2150,6 +217

Re: [PATCH 2/8] ppc/spapr|pnv: Remove SAO from pa-features when running MTTCG

2024-01-22 Thread Nicholas Piggin
On Fri Jan 19, 2024 at 10:23 AM AEST, David Gibson wrote: > On Fri, Jan 19, 2024 at 12:09:36AM +1000, Nicholas Piggin wrote: > > SAO is a page table attribute that strengthens the memory ordering of > > accesses. QEMU with MTTCG does not implement this, so clear it in > > ibm,pa-features. There is

Re: [PATCH 1/5] migration: Fix use-after-free of migration state object

2024-01-22 Thread Peter Xu
On Mon, Jan 22, 2024 at 01:55:45PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Mon, Jan 22, 2024 at 05:49:01PM +0800, Peter Xu wrote: > >> On Fri, Jan 19, 2024 at 08:39:18PM -0300, Fabiano Rosas wrote: > >> > We're currently allowing the process_incoming_migration_bh bottom-half > >>

Re: [PATCH 00/26] target/ppc: TCG improvements and fixes

2024-01-22 Thread Nicholas Piggin
On Fri Jan 19, 2024 at 6:58 PM AEST, Cédric Le Goater wrote: > Hello Nick, > > On 1/18/24 16:06, Nicholas Piggin wrote: > > This is mostly TCG core emulation improvements and fixes. I > > got the chiptod model in there because it's intertwined with > > TFMR SPR. > > > > Other non-TCG patches are s

Re: [PATCH v6 08/10] migration/yank: Use channel features

2024-01-22 Thread Peter Xu
On Mon, Jan 22, 2024 at 05:08:09PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Mon, Sep 11, 2023 at 02:13:18PM -0300, Fabiano Rosas wrote: > >> Stop using outside knowledge about the io channels when registering > >> yank functions. Query for features instead. > >> > >> The yank meth

Re: [External] Re: [PATCH v3 03/20] multifd: Zero pages transmission

2024-01-22 Thread Hao Xiang
On Sun, Jan 14, 2024 at 11:01 PM Shivam Kumar wrote: > > > > > On 04-Jan-2024, at 6:14 AM, Hao Xiang wrote: > > > > From: Juan Quintela > > > > This implements the zero page dection and handling. > > > > Signed-off-by: Juan Quintela > > --- > > migration/multifd.c | 41 +

Re: [External] Re: [PATCH v3 13/20] migration/multifd: Prepare to introduce DSA acceleration on the multifd path.

2024-01-22 Thread Hao Xiang
On Sun, Jan 14, 2024 at 10:46 PM Shivam Kumar wrote: > > > > > On 04-Jan-2024, at 6:14 AM, Hao Xiang wrote: > > > > 1. Refactor multifd_send_thread function. > > 2. Implement buffer_is_zero_use_cpu to handle CPU based zero page > > checking. > > 3. Introduce the batch task structure in MultiFDSen

Re: [External] Re: [PATCH v3 01/20] multifd: Add capability to enable/disable zero_page

2024-01-22 Thread Hao Xiang
On Sun, Jan 14, 2024 at 10:02 PM Shivam Kumar wrote: > > > > > On 04-Jan-2024, at 6:14 AM, Hao Xiang wrote: > > > > From: Juan Quintela > > > > We have to enable it by default until we introduce the new code. > > > > Signed-off-by: Juan Quintela > > --- > > migration/options.c | 15

Re: [PATCH v3 3/3] tests/tcg: Add the PROT_NONE gdbstub test

2024-01-22 Thread Alex Bennée
Ilya Leoshkevich writes: > On Mon, Jan 22, 2024 at 03:54:32PM +, Alex Bennée wrote: >> Ilya Leoshkevich writes: >> >> > Make sure that qemu gdbstub, like gdbserver, allows reading from and >> > writing to PROT_NONE pages. >> > >> > Signed-off-by: Ilya Leoshkevich >> > --- >> > tests/tcg/m

[PATCH 4/7] hw/riscv/virt.c: use g_autofree in create_fdt_sockets()

2024-01-22 Thread Daniel Henrique Barboza
Move 'clust_name' inside the loop, and g_autofree, to avoid having to g_free() manually in each loop iteration. 'intc_phandles' is also g_autofreed to avoid another manual g_free(). Signed-off-by: Daniel Henrique Barboza --- hw/riscv/virt.c | 9 +++-- 1 file changed, 3 insertions(+), 6 dele

[PATCH 7/7] hw/riscv/virt.c: use g_autofree in create_fdt_*

2024-01-22 Thread Daniel Henrique Barboza
We have a lot of cases where a char or an uint32_t pointer is used once to alloc a string/array, read/written during the function, and then g_free() at the end. There's no pointer re-use - a single alloc, a single g_free(). Use 'g_autofree' to avoid the g_free() calls. Signed-off-by: Daniel Henri

[PATCH 5/7] hw/riscv/virt.c: use g_autofree in create_fdt_virtio()

2024-01-22 Thread Daniel Henrique Barboza
Put 'name' declaration inside the loop, with g_autofree, to avoid manually doing g_free() in each iteration. Signed-off-by: Daniel Henrique Barboza --- hw/riscv/virt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index d0f402e0d5..f82

[PATCH 6/7] hw/riscv/virt.c: use g_autofree in virt_machine_init()

2024-01-22 Thread Daniel Henrique Barboza
Move 'soc_name' to the loop, and give it g_autofree, to avoid the manual g_free(). Signed-off-by: Daniel Henrique Barboza --- hw/riscv/virt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index f8278df83f..710fbbda2c 100644 --- a/hw/ri

[PATCH 2/7] hw/riscv/numa.c: use g_autofree in socket_fdt_write_distance_matrix()

2024-01-22 Thread Daniel Henrique Barboza
Use g_autofree in 'dist_matrix' to avoid the manual g_free(). Signed-off-by: Daniel Henrique Barboza --- hw/riscv/numa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/riscv/numa.c b/hw/riscv/numa.c index d319aefb45..cf686f4ff1 100644 --- a/hw/riscv/numa.c +++ b/hw/ri

[PATCH 3/7] hw/riscv/virt.c: use g_autofree in create_fdt_socket_cpus()

2024-01-22 Thread Daniel Henrique Barboza
Move all char pointers to the loop. Use g_autofree in all of them to avoid the g_free() calls. Signed-off-by: Daniel Henrique Barboza --- hw/riscv/virt.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index f9fd1341fc..373b1dd96

[PATCH 0/7] hw/riscv: fix leak, add more g_autofree

2024-01-22 Thread Daniel Henrique Barboza
Hi, First patch fixes a leak found when using Valgrind. The root cause is a missing g_free() in a string. In fact, I found while doing reviews that we keep repeating the same pattern: char *name; name = g_strdup_printf(...); (...) g_free(name); With this in mind, I ended up making th

[PATCH 1/7] hw/riscv/virt-acpi-build.c: fix leak in build_rhct()

2024-01-22 Thread Daniel Henrique Barboza
The 'isa' char pointer isn't being freed after use. Issue detected by Valgrind: ==38752== 128 bytes in 1 blocks are definitely lost in loss record 3,190 of 3,884 ==38752==at 0x484280F: malloc (vg_replace_malloc.c:442) ==38752==by 0x5189619: g_malloc (gmem.c:130) ==38752==by 0x51A5BF2

Re: [PULL 0/8] tcg + linux-user patch queue

2024-01-22 Thread Richard Henderson
On 1/23/24 01:26, Peter Maydell wrote: On Sun, 21 Jan 2024 at 00:22, Richard Henderson wrote: The following changes since commit 3f2a357b95845ea0bf7463eff6661e43b97d1afc: Merge tag 'hw-cpus-20240119' of https://github.com/philmd/qemu into staging (2024-01-19 11:39:38 +) are available

Re: [PATCH v2] cpu-exec: simplify jump cache management

2024-01-22 Thread Richard Henderson
On 1/23/24 01:34, Paolo Bonzini wrote: Unless I'm missing something egregious, the jmp cache is only every populated with a valid entry by the same thread that reads the cache. Therefore, the contents of any valid entry are always consistent and there is no need for any acquire/release magic. I

Re: [PATCH v2 4/4] Exclude TPM ioctls definitions for the GNU/Hurd

2024-01-22 Thread Stefan Berger
On 1/22/24 15:46, Peter Maydell wrote: On Mon, 22 Jan 2024 at 19:30, Stefan Berger wrote: On 1/22/24 12:16, Peter Maydell wrote: On Thu, 18 Jan 2024 at 16:04, Manolo de Medici wrote: The Hurd currently doesn't have any TPM driver, compilation fails for missing symbols unless these are

Re: [PATCH 4/5] hw/s390x/css-bridge: switch virtual-css bus to 3-phase-reset

2024-01-22 Thread Eric Farman
On Fri, 2024-01-19 at 16:35 +, Peter Maydell wrote: > Switch the s390x virtual-css bus from using BusClass::reset to the > Resettable interface. > > This has no behavioural change, because the BusClass code to support > subclasses that use the legacy BusClass::reset will call that method > in

Re: [PATCH v3 15/38 6/6] target/s390x: Improve general case of disas_jcc

2024-01-22 Thread Ilya Leoshkevich
On Sat, Jan 20, 2024 at 12:23:02AM +0100, Philippe Mathieu-Daudé wrote: > From: Richard Henderson > > Avoid code duplication by handling 7 of the 14 cases > by inverting the test for the other 7 cases. > > Use TCG_COND_TSTNE for cc in {1,3}. > Use (cc - 1) <= 1 for cc in {1,2}. > > Signed-off-b

Re: Re: [PATCH v3 3/3] tests/tcg: Add the PROT_NONE gdbstub test

2024-01-22 Thread Ilya Leoshkevich
On Mon, Jan 22, 2024 at 03:54:32PM +, Alex Bennée wrote: > Ilya Leoshkevich writes: > > > Make sure that qemu gdbstub, like gdbserver, allows reading from and > > writing to PROT_NONE pages. > > > > Signed-off-by: Ilya Leoshkevich > > --- > > tests/tcg/multiarch/Makefile.target | 9 ++

Re: [PATCH 2/5] util/uri: Simplify uri_string_unescape()

2024-01-22 Thread Stefan Weil via
Am 22.01.24 um 20:17 schrieb Thomas Huth: uri_string_unescape() basically does the same as the glib function g_uri_unescape_string(), with just an additional length parameter. So we can simplify this function a lot by limiting the length with g_strndup() first and then by calling g_uri_unescape_

[Bug 1225187] Re: qemu hangs in windows 7 host with -serial pipe:windbg

2024-01-22 Thread Jacob
Thank you for the info. Current issues tracking this bug: https://gitlab.com/qemu-project/qemu/-/issues/675 https://gitlab.com/qemu-project/qemu/-/issues/1468 https://gitlab.com/qemu-project/qemu/-/issues/1802 -- You received this bug notification because you are a member of qemu- devel-ml, whic

[PATCH v2] docs/system/arm/virt.rst: Add note on CPU features off by default

2024-01-22 Thread Gustavo Romero
Add a note on CPU features that are off by default in `virt` machines. Some CPU features will remain off even if a CPU-capable CPU (e.g., `-cpu max`) is selected because they require support in both the CPU itself and in the wider system. Therefore, the user, besides selecting a CPU that supports s

[PATCH v2 1/3] hw/gpio: Implement STM32L4x5 GPIO

2024-01-22 Thread Inès Varhol
Features supported : - the 8 STM32L4x5 GPIOs are initialized with their reset values (except IDR, see below) - input mode : setting a pin in input mode "externally" (using input irqs) results in an out irq (transmitted to SYSCFG) - output mode : setting a bit in ODR sets the corresponding o

[PATCH v2 2/3] hw/arm: Connect STM32L4x5 GPIO to STM32L4x5 SoC

2024-01-22 Thread Inès Varhol
Signed-off-by: Arnaud Minier Signed-off-by: Inès Varhol --- hw/arm/Kconfig | 3 +- hw/arm/stm32l4x5_soc.c | 79 -- include/hw/arm/stm32l4x5_soc.h | 2 + 3 files changed, 69 insertions(+), 15 deletions(-) diff --git a/hw/arm/Kconfig b/hw/

Re: Re: [PATCH v3 2/3] tests/tcg: Factor out gdbstub test functions

2024-01-22 Thread Ilya Leoshkevich
On Mon, Jan 22, 2024 at 04:00:44PM +, Alex Bennée wrote: > Ilya Leoshkevich writes: > > > Both the report() function as well as the initial gdbstub test sequence > > are copy-pasted into ~10 files with slight modifications. This > > indicates that they are indeed generic, so factor them out.

[PATCH v2 0/3] Add device STM32L4x5 GPIO

2024-01-22 Thread Inès Varhol
This patch adds a new device STM32L4x5 GPIO device and is part of a series implementing the STM32L4x5 with a few peripherals. Changes from v1 : - replacing test GPIO register `DISCONNECTED_PINS` with an object property accessed using `qtest_qmp()` in the qtest (through helpers `get_disconnected_pi

[PATCH v2 3/3] tests/qtest: Add STM32L4x5 GPIO QTest testcase

2024-01-22 Thread Inès Varhol
The testcase contains : - `test_idr_reset_value()` : Checks the reset values of MODER, OTYPER, PUPDR, ODR and IDR. - `test_gpio_output_mode()` : Checks that writing a bit in register ODR results in the corresponding pin rising or lowering, if this pin is configured in output mode. - `test_gpio_inpu

Re: [PATCH 5/5] util/uri: Remove unused macros ISA_RESERVED() and ISA_GEN_DELIM()

2024-01-22 Thread Stefan Weil via
Am 22.01.24 um 20:17 schrieb Thomas Huth: They are not used anywhere, so there's no need to keep them around. Signed-off-by: Thomas Huth --- util/uri.c | 13 - 1 file changed, 13 deletions(-) Reviewed-by: Stefan Weil

Re: [PATCH 4/5] util/uri: Remove unused functions uri_resolve() and uri_resolve_relative()

2024-01-22 Thread Stefan Weil via
Am 22.01.24 um 20:17 schrieb Thomas Huth: These rather complex functions have never been used since they've been introduced in 2012, so looks like they are not really useful for QEMU. And since the static normalize_uri_path() function is also only used by uri_resolve(), we can remove that functi

[Bug 1225187] Re: qemu hangs in windows 7 host with -serial pipe:windbg

2024-01-22 Thread Peter Maydell
This bug tracker for QEMU has been obsolete for years. If you think there's a problem with QEMU, please file a full report in the gitlab bugtracker: https://gitlab.com/qemu-project/qemu/-/issues . Thanks. -- You received this bug notification because you are a member of qemu- devel-ml, which is s

Re: [PATCH 3/5] util/uri: Remove the uri_string_escape() function

2024-01-22 Thread Stefan Weil via
Am 22.01.24 um 20:17 schrieb Thomas Huth: It is not used in QEMU - and if somebody needs this functionality, they can simply use g_uri_escape_string() from the glib instead. Signed-off-by: Thomas Huth --- include/qemu/uri.h | 1 - util/uri.c | 64 ---

Re: [PATCH v2 4/4] Exclude TPM ioctls definitions for the GNU/Hurd

2024-01-22 Thread Peter Maydell
On Mon, 22 Jan 2024 at 19:30, Stefan Berger wrote: > > > > On 1/22/24 12:16, Peter Maydell wrote: > > On Thu, 18 Jan 2024 at 16:04, Manolo de Medici > > wrote: > >> > >> The Hurd currently doesn't have any TPM driver, compilation fails > >> for missing symbols unless these are left undefined. >

Re: [PATCH 1/2] target/xtensa: wrap MMU and MPU state into structures

2024-01-22 Thread Peter Maydell
On Mon, 22 Jan 2024 at 18:45, Max Filippov wrote: > > On Mon, Jan 22, 2024 at 10:29 AM Peter Maydell > wrote: > > > > On Fri, 19 Jan 2024 at 20:47, Max Filippov wrote: > > > +union { > > > +XtensaMMU mmu; > > > +XtensaMPU mpu; > > > +}; > > > > Is it really worth having

Re: [PATCH 1/5] util/uri: Remove the unused "target" argument from uri_string_unescape()

2024-01-22 Thread Stefan Weil via
Am 22.01.24 um 20:17 schrieb Thomas Huth: All callers pass NULL as target, so we can simplify the code by dropping this parameter. Signed-off-by: Thomas Huth --- include/qemu/uri.h | 2 +- util/uri.c | 32 ++-- 2 files changed, 15 insertions(+), 19 dele

[Bug 1225187] Re: qemu hangs in windows 7 host with -serial pipe:windbg

2024-01-22 Thread Jacob
Tested and this issue still affects the latest version of QEMU (8.2.0) compiled for Windows. Instructions in original post are still sufficient to reproduce the problem on Windows 7 x64. Both i386 and x86_64 were tested and both result in a hung QEMU process, except on my system the GUI for QEMU

Re: [PATCH v2 2/4] Avoid conflicting types for 'copy_file_range'

2024-01-22 Thread Sergey Bugaev
On Mon, Jan 22, 2024 at 9:23 PM Sergey Bugaev wrote: > call such a function. For example on GNU/Linux, remove(2) is a stub, (That was supposed to say revoke(2), of course.)

Re: [PATCH v2 2/4] Avoid conflicting types for 'copy_file_range'

2024-01-22 Thread Sergey Bugaev
Hello, On Mon, Jan 22, 2024 at 8:05 PM Peter Maydell wrote: > > On Thu, 18 Jan 2024 at 16:03, Manolo de Medici > wrote: > > > > Compilation fails on systems where copy_file_range is already defined as a > > stub. > > What do you mean by "stub" here ? If the system headers define > a prototype f

Re: [PATCH] crypto/gcrypt: prefer kernel as direct source of entropy

2024-01-22 Thread Cristian Rodríguez
On Mon, Jan 22, 2024 at 5:19 PM Daniel P. Berrangé wrote: > > If the DRBG is required for FIPS compliance, and QEMU hardcoded > the system RNG, then QEMU can't be used in a FIPS environment. > No, the library overrides this choice.. the DRBG has higher priority.

Re: [PATCH] crypto/gcrypt: prefer kernel as direct source of entropy

2024-01-22 Thread Daniel P . Berrangé
On Mon, Jan 22, 2024 at 05:08:16PM -0300, Cristian Rodríguez wrote: > On Mon, Jan 22, 2024 at 11:48 AM Daniel P. Berrangé > wrote: > > > On Fri, Jan 19, 2024 at 05:39:40PM -0300, Cristian Rodríguez wrote: > > > gcrypt by default uses an userspace RNG, which cannot know > > > when it is time to di

Re: [PATCH] crypto/gcrypt: prefer kernel as direct source of entropy

2024-01-22 Thread Cristian Rodríguez
On Mon, Jan 22, 2024 at 11:48 AM Daniel P. Berrangé wrote: > On Fri, Jan 19, 2024 at 05:39:40PM -0300, Cristian Rodríguez wrote: > > gcrypt by default uses an userspace RNG, which cannot know > > when it is time to discard/invalidate its buffer > > (suspend, resume, vm forks, other corner cases)

Re: [PATCH v6 08/10] migration/yank: Use channel features

2024-01-22 Thread Fabiano Rosas
Peter Xu writes: > On Mon, Sep 11, 2023 at 02:13:18PM -0300, Fabiano Rosas wrote: >> Stop using outside knowledge about the io channels when registering >> yank functions. Query for features instead. >> >> The yank method for all channels used with migration code currently is >> to call the qio_

Re: [PATCH v2 4/4] Exclude TPM ioctls definitions for the GNU/Hurd

2024-01-22 Thread Stefan Berger
On 1/22/24 12:16, Peter Maydell wrote: On Thu, 18 Jan 2024 at 16:04, Manolo de Medici wrote: The Hurd currently doesn't have any TPM driver, compilation fails for missing symbols unless these are left undefined. Signed-off-by: Manolo de Medici --- backends/tpm/tpm_ioctl.h | 2 +- 1 fil

Re: [PATCH 0/5] util/uri: Simplify the code, remove unused functions

2024-01-22 Thread Daniel P . Berrangé
On Mon, Jan 22, 2024 at 08:17:48PM +0100, Thomas Huth wrote: > The URI function uri_string_unescape() has some overlap with functions > from the glib, so we can simplify our code here quite a bit. > While at it, I also noticed that there are many unused functions in > here which we likely can drop

[PATCH 4/5] util/uri: Remove unused functions uri_resolve() and uri_resolve_relative()

2024-01-22 Thread Thomas Huth
These rather complex functions have never been used since they've been introduced in 2012, so looks like they are not really useful for QEMU. And since the static normalize_uri_path() function is also only used by uri_resolve(), we can remove that function now, too. Signed-off-by: Thomas Huth ---

[PATCH 5/5] util/uri: Remove unused macros ISA_RESERVED() and ISA_GEN_DELIM()

2024-01-22 Thread Thomas Huth
They are not used anywhere, so there's no need to keep them around. Signed-off-by: Thomas Huth --- util/uri.c | 13 - 1 file changed, 13 deletions(-) diff --git a/util/uri.c b/util/uri.c index 5f5ca79792..2deab91da3 100644 --- a/util/uri.c +++ b/util/uri.c @@ -163,19 +163,6 @@ stati

[PATCH 3/5] util/uri: Remove the uri_string_escape() function

2024-01-22 Thread Thomas Huth
It is not used in QEMU - and if somebody needs this functionality, they can simply use g_uri_escape_string() from the glib instead. Signed-off-by: Thomas Huth --- include/qemu/uri.h | 1 - util/uri.c | 64 -- 2 files changed, 65 deletions(-)

[PATCH 0/5] util/uri: Simplify the code, remove unused functions

2024-01-22 Thread Thomas Huth
The URI function uri_string_unescape() has some overlap with functions from the glib, so we can simplify our code here quite a bit. While at it, I also noticed that there are many unused functions in here which we likely can drop nowadays (it's better to use the functions from glib anyway). Thomas

[PATCH 1/5] util/uri: Remove the unused "target" argument from uri_string_unescape()

2024-01-22 Thread Thomas Huth
All callers pass NULL as target, so we can simplify the code by dropping this parameter. Signed-off-by: Thomas Huth --- include/qemu/uri.h | 2 +- util/uri.c | 32 ++-- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/include/qemu/uri.h b/incl

[PATCH 2/5] util/uri: Simplify uri_string_unescape()

2024-01-22 Thread Thomas Huth
uri_string_unescape() basically does the same as the glib function g_uri_unescape_string(), with just an additional length parameter. So we can simplify this function a lot by limiting the length with g_strndup() first and then by calling g_uri_unescape_string() instead of walking through the strin

Re: [PATCH 2/2] target/xtensa: tidy TLB way variability logic

2024-01-22 Thread Max Filippov
On Mon, Jan 22, 2024 at 10:42 AM Peter Maydell wrote: > > On Fri, 19 Jan 2024 at 20:47, Max Filippov wrote: > > > > Whether TLB ways 5 and 6 are variable is not a property of the TLB > > instance or a TLB entry instance, it's a property of the xtensa core > > configuration. > > Remove 'varway56'

[RFC v3 7/7] hw/nvme: make ZDED persistent

2024-01-22 Thread Sam Li
Zone descriptor extension data (ZDED) is not persistent across QEMU restarts. The zone descriptor extension valid bit (ZDEV) is part of zone attributes, which sets to one when the ZDED is associated with the zone. With the qcow2 img as the backing file, the NVMe ZNS device stores the zone attribut

[RFC v3 5/7] hw/nvme: make the metadata of ZNS emulation persistent

2024-01-22 Thread Sam Li
The NVMe ZNS devices follow NVMe ZNS spec but the state of namespace zones does not persist accross restarts of QEMU. This patch makes the metadata of ZNS emulation persistent by using new block layer APIs. The ZNS device calls zone report and zone mgmt APIs from the block layer which will handle z

[RFC v3 2/7] qcow2: add zd_extension configurations to zoned metadata

2024-01-22 Thread Sam Li
Zone descriptor extension data is host definied data that is associated with each zone. Add zone descriptor extensions to zonedmeta struct. Signed-off-by: Sam Li --- block/qcow2.c| 70 +--- block/qcow2.h| 2 + include/block/blo

[RFC v3 3/7] hw/nvme: use blk_get_*() to access zone info in the block layer

2024-01-22 Thread Sam Li
The zone information is contained in the BlockLimits fileds. Add blk_get_*() functions to access the block layer and update zone info accessing in the NVMe device emulation. Signed-off-by: Sam Li --- block/block-backend.c | 72 +++ hw/nvme/ctrl.c

[RFC v3 0/7] Add persistence to NVMe ZNS emulation

2024-01-22 Thread Sam Li
ZNS emulation follows NVMe ZNS spec but the state of namespace zones does not persist accross restarts of QEMU. This patch makes the metadata of ZNS emulation persistent by using new block layer APIs and the qcow2 img as backing file. It is the second part after the patches - adding full zoned stor

[RFC v3 1/7] docs/qcow2: add zd_extension_size option to the zoned format feature

2024-01-22 Thread Sam Li
The NVMe ZNS command set has the zone descriptor extension feature for associating the data to a zone. Devices that supports ZAC/ZBC have zero zone descriptor extension size. Signed-off-by: Sam Li --- docs/interop/qcow2.txt | 9 + 1 file changed, 9 insertions(+) diff --git a/docs/intero

[RFC v3 6/7] hw/nvme: refactor zone append write using block layer APIs

2024-01-22 Thread Sam Li
Signed-off-by: Sam Li --- block/qcow2.c| 2 +- hw/nvme/ctrl.c | 190 --- include/sysemu/dma.h | 3 + system/dma-helpers.c | 17 4 files changed, 162 insertions(+), 50 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 0bb

[RFC v3 4/7] hw/nvme: add blk_get_zone_extension to access zd_extensions

2024-01-22 Thread Sam Li
Signed-off-by: Sam Li --- block/block-backend.c | 16 hw/nvme/ctrl.c| 20 ++-- hw/nvme/ns.c | 24 hw/nvme/nvme.h| 7 --- include/sysemu/block-backend-io.h | 2 +

[PATCH v7 2/4] qcow2: add configurations for zoned format extension

2024-01-22 Thread Sam Li
To configure the zoned format feature on the qcow2 driver, it requires settings as: the device size, zone model, zone size, zone capacity, number of conventional zones, limits on zone resources (max append bytes, max open zones, and max_active_zones). To create a qcow2 image with zoned format feat

  1   2   3   >