Re: [PATCH v3 9/9] h264: register shutdown notifiers, stop pipeline in destroy_encoder_context

2025-04-21 Thread Marc-André Lureau
Hi On Tue, Apr 22, 2025 at 10:37 AM Dietmar Maurer wrote: > > > On Fri, Apr 18, 2025 at 3:30 PM Dietmar Maurer wrote: > > > > > > Some encoders can hang indefinetly (i.e. nvh264enc) if > > > > indefinitely > > > > > the pipeline is not stopped before it is destroyed > > > (Observed on Debian boo

Re: [PATCH v2 15/20] Disable options unsupported on Emscripten

2025-04-21 Thread Philippe Mathieu-Daudé
On 22/4/25 07:27, Kohei Tokunaga wrote: Daemonizing and run-with aren't supported on Emscripten so disable these flags. Signed-off-by: Kohei Tokunaga --- qemu-options.hx | 4 ++-- system/vl.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Philippe Mathieu-Daud

Re: [PATCH v2 12/20] block: Add including of ioctl header for Emscripten build

2025-04-21 Thread Philippe Mathieu-Daudé
On 22/4/25 07:27, Kohei Tokunaga wrote: Including is still required on Emscripten, just like on other platforms, to make the ioctl function available. Signed-off-by: Kohei Tokunaga --- block/file-posix.c | 4 1 file changed, 4 insertions(+) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v2 11/20] util/cacheflush.c: Update cache flushing mechanism for Emscripten

2025-04-21 Thread Philippe Mathieu-Daudé
On 22/4/25 07:27, Kohei Tokunaga wrote: Although __builtin___clear_cache is used to flush the instruction cache for a specified memory region[1], this operation doesn't apply to wasm, as its memory isn't executable. Moreover, Emscripten does not support this builtin and fails to compile it with t

Re: [PATCH v2 13/20] block: Fix type confict of the copy_file_range stub

2025-04-21 Thread Philippe Mathieu-Daudé
On 22/4/25 07:27, Kohei Tokunaga wrote: Emscripten doesn't provide copy_file_range implementation but it declares this function in its headers. Meson correctly detects the missing implementation and unsets HAVE_COPY_FILE_RANGE. However, the stub defined in file-posix.c causes a type conflict with

Re: [PATCH v2 11/20] util/cacheflush.c: Update cache flushing mechanism for Emscripten

2025-04-21 Thread Philippe Mathieu-Daudé
On 22/4/25 07:27, Kohei Tokunaga wrote: Although __builtin___clear_cache is used to flush the instruction cache for a specified memory region[1], this operation doesn't apply to wasm, as its memory isn't executable. Moreover, Emscripten does not support this builtin and fails to compile it with t

Re: [PATCH v2 03/20] system/vl.c: Fix type conflict of GLib function pointers

2025-04-21 Thread Philippe Mathieu-Daudé
On 22/4/25 07:27, Kohei Tokunaga wrote: On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoi

Re: [PATCH v2 01/20] hw/core/loader.c: Fix type conflict of GLib function pointers

2025-04-21 Thread Philippe Mathieu-Daudé
On 22/4/25 07:27, Kohei Tokunaga wrote: On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoi

Re: [PATCH v2 5/5] qapi: delete un-needed python static analysis configs

2025-04-21 Thread Markus Armbruster
John Snow writes: > Since the previous commit, python/setup.cfg applies to scripts/qapi/ as > well. Configuration files in scripts/qapi/ override python/setup.cfg. > > scripts/qapi/.flake8 and scripts/qapi/.isort.cfg actually match > python/setup.cfg exactly, and can go. > > The differences betw

Re: [PATCH v2 06/20] contrib/plugins: Fix type conflict of GLib function pointers

2025-04-21 Thread Philippe Mathieu-Daudé
On 22/4/25 07:27, Kohei Tokunaga wrote: On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoi

Re: [PATCH v3 9/9] h264: register shutdown notifiers, stop pipeline in destroy_encoder_context

2025-04-21 Thread Dietmar Maurer
> On Fri, Apr 18, 2025 at 3:30 PM Dietmar Maurer wrote: > > > > Some encoders can hang indefinetly (i.e. nvh264enc) if > > indefinitely > > > the pipeline is not stopped before it is destroyed > > (Observed on Debian bookworm). > > but why do you need the extra shutdown notifier? Because Qemu

RE: [PATCH v4 09/10] tests/functional/aspeed: Add to test vbootrom for AST2700

2025-04-21 Thread Jamin Lin
Hi Cedric, > Subject: Re: [PATCH v4 09/10] tests/functional/aspeed: Add to test vbootrom > for AST2700 > > On 4/17/25 05:12, Jamin Lin wrote: > > Add the AST2700 functional test to boot using the vbootrom image > > instead of manually loading boot components with -device loader. > > The boot ROM

Re: [RFC PATCH v3 13/14] qemu/target_info: Add target_aarch64() helper

2025-04-21 Thread Markus Armbruster
Pierrick Bouvier writes: [...] > At this point, I would like to focus on having a first version of TargetInfo > API, and not reviewing any other changes, as things may be modified, and they > would need to be reviewed again. It's hard to follow the same abstraction > done multiple times in mu

Re: [PATCH v6 2/2] target/ppc: Deprecate Power8E and Power8NVL

2025-04-21 Thread Cédric Le Goater
On 4/22/25 08:00, Aditya Gupta wrote: Power8E and Power8NVL variants are not of much use in QEMU now, and not being maintained either. Power8NVL CPU doesn't boot since skiboot v7.0, or following skiboot commit to be exact: commit c5424f683ee3 ("Remove support for POWER8 DD1") Deprecate th

Re: [PATCH v5 2/2] target/ppc: Deprecate Power8E and Power8NVL

2025-04-21 Thread Aditya Gupta
On 25/04/22 07:53AM, Cédric Le Goater wrote: > On 4/22/25 06:41, Aditya Gupta wrote: > > <...snip...> > > > > diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst > > index 05381441a9ff..527f2613dcb5 100644 > > --- a/docs/about/deprecated.rst > > +++ b/docs/about/deprecated.rst > > @@

[PATCH v6 2/2] target/ppc: Deprecate Power8E and Power8NVL

2025-04-21 Thread Aditya Gupta
Power8E and Power8NVL variants are not of much use in QEMU now, and not being maintained either. Power8NVL CPU doesn't boot since skiboot v7.0, or following skiboot commit to be exact: commit c5424f683ee3 ("Remove support for POWER8 DD1") Deprecate the 8E and 8NVL variants. Suggested-by: Cé

[PATCH v6 1/2] target/ppc: Introduce macro for deprecating PowerPC CPUs

2025-04-21 Thread Aditya Gupta
QEMU has a way to deprecate CPUs by setting the 'deprecation_note' in CPUClass. Currently PowerPC CPUs don't use this deprecation process. Introduce 'POWERPC_DEPRECATED_CPU' macro to deprecate particular PowerPC CPUs in future. With the change, QEMU will print a warning like below when the depre

[PATCH v6 0/2] Deprecate Power8E and Power8NVL

2025-04-21 Thread Aditya Gupta
Power8E and Power8NVL are not maintained, and not useful to qemu, and upstream skiboot also has removed support till Power8 DD1. Power8NVL CPU doesn't boot since skiboot v7.0, or following skiboot commit to be exact: commit c5424f683ee3 ("Remove support for POWER8 DD1") No direct way to depre

Re: [RFC PATCH v3 01/14] qapi: Rename TargetInfo structure as BinaryTargetInfo

2025-04-21 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > The QAPI-generated 'TargetInfo' structure name is only used > in a single file. We want to heavily use another structure > similarly named. Rename the QAPI one, since structure names > are not part of the public API. > > Suggested-by: Pierrick Bouvier > Signed-of

Re: [PATCH v5 2/2] target/ppc: Deprecate Power8E and Power8NVL

2025-04-21 Thread Cédric Le Goater
On 4/22/25 06:41, Aditya Gupta wrote: Power8E and Power8NVL variants are not of much use in QEMU now, and not being maintained either. Power8NVL CPU doesn't boot since skiboot v7.0, or following skiboot commit to be exact: commit c5424f683ee3 ("Remove support for POWER8 DD1") Deprecate th

Re: [PATCH v5 1/2] target/ppc: Introduce macro for deprecating PowerPC CPUs

2025-04-21 Thread Cédric Le Goater
On 4/22/25 06:41, Aditya Gupta wrote: QEMU has a way to deprecate CPUs by setting the 'deprecation_note' in CPUClass. Currently PowerPC CPUs don't use this deprecation process. Introduce 'POWERPC_DEPRECATED_CPU' macro to deprecate particular PowerPC CPUs in future. With the change, QEMU will p

Re: [PATCH v4 02/10] hw/arm/aspeed_ast27x0 Introduce vbootrom memory region

2025-04-21 Thread Cédric Le Goater
On 4/22/25 03:59, Jamin Lin wrote: Hi Cedric, Subject: Re: [PATCH v4 02/10] hw/arm/aspeed_ast27x0 Introduce vbootrom memory region On 4/17/25 05:11, Jamin Lin wrote: Introduce a new vbootrom memory region. The region is mapped at address "0x" and has a size of 128KB, identical to the

[PATCH v2 12/20] block: Add including of ioctl header for Emscripten build

2025-04-21 Thread Kohei Tokunaga
Including is still required on Emscripten, just like on other platforms, to make the ioctl function available. Signed-off-by: Kohei Tokunaga --- block/file-posix.c | 4 1 file changed, 4 insertions(+) V2: - Split this from the previous 12th patch into a separate commit and revised the c

[PATCH v2 16/20] util: exclude mmap-alloc.c from compilation target on Emscripten

2025-04-21 Thread Kohei Tokunaga
Emscripten does not support partial unmapping of mmapped memory regions[1]. This limitation prevents correct implementation of qemu_ram_mmap and qemu_ram_munmap, which rely on partial unmap behavior. As a workaround, this commit excludes mmap-alloc.c from the Emscripten build. Instead, for Emscrip

[PATCH v2 14/20] include/qemu/osdep.h: Add Emscripten-specific OS dependencies

2025-04-21 Thread Kohei Tokunaga
On emscripten, some implementations in os-posix.c can't be used such as daemonizing and changing user. This commit introduces os-wasm.c and os-wasm.h which are forked from os-posix.c and os-posix.h and patched for targetting Emscripten. Signed-off-by: Kohei Tokunaga --- MAINTAINERS

[PATCH v2 17/20] util: Add coroutine backend for emscripten

2025-04-21 Thread Kohei Tokunaga
Emscripten does not support couroutine methods currently used by QEMU but provides a coroutine implementation called "fiber". This commit introduces a coroutine backend using fiber. Note that fiber does not support submitting coroutines to other threads. Signed-off-by: Kohei Tokunaga --- MAINTAI

[PATCH v2 19/20] tests: Add Dockerfile containing dependencies for Emscripten build

2025-04-21 Thread Kohei Tokunaga
The added Dockerfile is based on the emsdk image, which includes the Emscripten toolchain. It also cross-compiles the necessary dependencies (glib, libffi, pixman, and zlib) for the Emscripten target environment. Signed-off-by: Kohei Tokunaga --- MAINTAINERS |

[PATCH v2 18/20] meson: Add wasm build in build scripts

2025-04-21 Thread Kohei Tokunaga
has_int128_type is set to false on emscripten as of now to avoid errors by libffi. Tests are disabled on emscripten because they rely on host features that aren't supported by emscripten (e.g. fork and unix socket). Signed-off-by: Kohei Tokunaga --- MAINTAINERS | 1 + configs/

[PATCH v2 15/20] Disable options unsupported on Emscripten

2025-04-21 Thread Kohei Tokunaga
Daemonizing and run-with aren't supported on Emscripten so disable these flags. Signed-off-by: Kohei Tokunaga --- qemu-options.hx | 4 ++-- system/vl.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) V2: - Unified two consecutive #ifndef macros into a single condition in qemu-o

[PATCH v2 20/20] gitlab: Enable CI for wasm build

2025-04-21 Thread Kohei Tokunaga
Add GitLab CI job that builds QEMU using emscripten. The build runs in the container defined in tests/docker/dockerfiles/emsdk-wasm32-cross.docker. Signed-off-by: Kohei Tokunaga --- .gitlab-ci.d/buildtest-template.yml | 27 +++ .gitlab-ci.d/buildtest.yml | 9 +++

[PATCH v2 06/20] contrib/plugins: Fix type conflict of GLib function pointers

2025-04-21 Thread Kohei Tokunaga
On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and

[PATCH v2 07/20] hw/net/can: Fix type conflict of GLib function pointers

2025-04-21 Thread Kohei Tokunaga
On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and

[PATCH v2 01/20] hw/core/loader.c: Fix type conflict of GLib function pointers

2025-04-21 Thread Kohei Tokunaga
On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and

[PATCH v2 13/20] block: Fix type confict of the copy_file_range stub

2025-04-21 Thread Kohei Tokunaga
Emscripten doesn't provide copy_file_range implementation but it declares this function in its headers. Meson correctly detects the missing implementation and unsets HAVE_COPY_FILE_RANGE. However, the stub defined in file-posix.c causes a type conflict with the declaration from Emscripten during co

[PATCH v2 10/20] include/glib-compat.h: Poison g_list_sort and g_slist_sort

2025-04-21 Thread Kohei Tokunaga
On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and

[PATCH v2 03/20] system/vl.c: Fix type conflict of GLib function pointers

2025-04-21 Thread Kohei Tokunaga
On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and

[PATCH v2 09/20] target/s390x: Fix type conflict of GLib function pointers

2025-04-21 Thread Kohei Tokunaga
On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and

[PATCH v2 05/20] target/i386/cpu.c: Fix type conflict of GLib function pointers

2025-04-21 Thread Kohei Tokunaga
On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and

[PATCH v2 04/20] target/arm/helper.c: Fix type conflict of GLib function pointers

2025-04-21 Thread Kohei Tokunaga
On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and

[PATCH v2 08/20] target/ppc: Fix type conflict of GLib function pointers

2025-04-21 Thread Kohei Tokunaga
On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and

[PATCH v2 11/20] util/cacheflush.c: Update cache flushing mechanism for Emscripten

2025-04-21 Thread Kohei Tokunaga
Although __builtin___clear_cache is used to flush the instruction cache for a specified memory region[1], this operation doesn't apply to wasm, as its memory isn't executable. Moreover, Emscripten does not support this builtin and fails to compile it with the following error. > fatal error: error

[PATCH v2 00/20] Enable QEMU TCI to run 32bit guests on browsers

2025-04-21 Thread Kohei Tokunaga
V2: - Updated the commit message to explicitly explain that function pointer casts are performed internally by GLib. - Fixed typo in the comment in include/glib-compat.h: s/insted/instead/ - In util/cacheflush.c patch, added an explanation for the change to both the code comment and the commit

[PATCH v2 02/20] qom/object.c: Fix type conflict of GLib function pointers

2025-04-21 Thread Kohei Tokunaga
On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_list_sort_with_data and

Re: [PATCH v4 1/8] hw/ppc: Implement skeleton code for fadump in PSeries

2025-04-21 Thread Aditya Gupta
Hi Harsh, Thanks for reviewing. On 25/04/21 04:21PM, Harsh Prateek Bora wrote: > > > On 3/23/25 23:10, Aditya Gupta wrote: > > <...snip...> > > > > +switch (cmd) { > > +case FADUMP_CMD_REGISTER: > > +ret_val = do_fadump_register(); > > +if (ret_val != RTAS_OUT_SUCCESS) {

Re: [PATCH 13/27] target/riscv: add more RISCVCPUDef fields

2025-04-21 Thread Alistair Francis
On Sun, Apr 6, 2025 at 5:03 PM Paolo Bonzini wrote: > > Allow using RISCVCPUDef to replicate all the logic of custom .instance_init > functions. To simulate inheritance, merge the child's RISCVCPUDef with > the parent and then finally move it to the CPUState at the end of > TYPE_RISCV_CPU's own i

[PATCH v5 1/2] target/ppc: Introduce macro for deprecating PowerPC CPUs

2025-04-21 Thread Aditya Gupta
QEMU has a way to deprecate CPUs by setting the 'deprecation_note' in CPUClass. Currently PowerPC CPUs don't use this deprecation process. Introduce 'POWERPC_DEPRECATED_CPU' macro to deprecate particular PowerPC CPUs in future. With the change, QEMU will print a warning like below when the depre

[PATCH v5 2/2] target/ppc: Deprecate Power8E and Power8NVL

2025-04-21 Thread Aditya Gupta
Power8E and Power8NVL variants are not of much use in QEMU now, and not being maintained either. Power8NVL CPU doesn't boot since skiboot v7.0, or following skiboot commit to be exact: commit c5424f683ee3 ("Remove support for POWER8 DD1") Deprecate the 8E and 8NVL variants. Suggested-by: Cé

[PATCH v5 0/2] Deprecate Power8E and Power8NVL

2025-04-21 Thread Aditya Gupta
Power8E and Power8NVL are not maintained, and not useful to qemu, and upstream skiboot also has removed support till Power8 DD1. Power8NVL CPU doesn't boot since skiboot v7.0, or following skiboot commit to be exact: commit c5424f683ee3 ("Remove support for POWER8 DD1") No direct way to depre

Re: [PATCH v5 0/2] Deprecate Power8E and Power8NVL

2025-04-21 Thread Aditya Gupta
Please ignore this mail (only cover letter got sent). Resent another v5. Sorry for posting this so late, had gone on a vacation. Thanks, - Aditya G

[PATCH v5 0/2] Deprecate Power8E and Power8NVL

2025-04-21 Thread Aditya Gupta
Power8E and Power8NVL are not maintained, and not useful to qemu, and upstream skiboot also has removed support till Power8 DD1. Power8NVL CPU doesn't boot since skiboot v7.0, or following skiboot commit to be exact: commit c5424f683ee3 ("Remove support for POWER8 DD1") No direct way to depre

[PATCH v5 0/2] Deprecate Power8E and Power8NVL

2025-04-21 Thread Aditya Gupta
Power8E and Power8NVL are not maintained, and not useful to qemu, and upstream skiboot also has removed support till Power8 DD1. Power8NVL CPU doesn't boot since skiboot v7.0, or following skiboot commit to be exact: commit c5424f683ee3 ("Remove support for POWER8 DD1") No direct way to depre

RE: [PATCH v4 06/10] hw/arm/aspeed: Add support for loading vbootrom image via "-bios"

2025-04-21 Thread Jamin Lin
Hi Cedric, > Cc: Troy Lee ; nabiheste...@google.com > Subject: Re: [PATCH v4 06/10] hw/arm/aspeed: Add support for loading > vbootrom image via "-bios" > > On 4/17/25 05:12, Jamin Lin wrote: > > Introduce "aspeed_load_vbootrom()" to support loading a virtual boot > > ROM image into the vbootrom

[PATCH v3 3/9] target/loongarch: Move function get_dir_base_width to common directory

2025-04-21 Thread Bibo Mao
Function get_dir_base_width() is used by loongarch_page_table_walker(), so it is used by KVM mode also, here move this function from directory tcg to common directory. Signed-off-by: Bibo Mao Reviewed-by: Philippe Mathieu-Daudé --- target/loongarch/cpu_helper.c | 28

[PATCH v3 5/9] target/loongarch: Set function loongarch_map_address() with common code

2025-04-21 Thread Bibo Mao
Function loongarch_map_address is to get physical address from virtual address, it is used by qmp commands to dump memory from virtual address. It is used by kvm mode also, here move function loongarch_map_address() out of macro CONFIG_TCG. And it is common code, the similar with function loongarc

[PATCH v3 9/9] target/loongarch: Move definition of TCG specified function to tcg directory

2025-04-21 Thread Bibo Mao
Function loongarch_cpu_tlb_fill() only works in TCG mode, move its definition from header file internals.h to file tcg/tcg_loongarch.h Signed-off-by: Bibo Mao --- target/loongarch/cpu.c | 1 + target/loongarch/internals.h | 5 - target/loongarch/tcg/tcg_loongarch.h | 4

[PATCH v3 1/9] target/loongarch: Move header file helper.h to directory tcg

2025-04-21 Thread Bibo Mao
Header file helper.h is specified for tcg mode, move this file to directory tcg. And create new file helper.h to include header file in tcg mode. Signed-off-by: Bibo Mao Reviewed-by: Philippe Mathieu-Daudé --- target/loongarch/helper.h | 720 + target/loongar

[PATCH v3 7/9] target/loongarch: Move function loongarch_tlb_search to directory tcg

2025-04-21 Thread Bibo Mao
Function loongarch_tlb_search() and loongarch_map_tlb_entry() works only in TCG mode, move these functions to directory tcg. There is no any function change, only code moving. Signed-off-by: Bibo Mao --- target/loongarch/cpu_helper.c | 146 -- target/loongarch/tc

[PATCH v3 8/9] target/loongarch: Add static definition with function loongarch_tlb_search()

2025-04-21 Thread Bibo Mao
Function loongarch_tlb_search() is only referenced in file tcg/tlb_helper.c, define this function with static attribution. Signed-off-by: Bibo Mao --- target/loongarch/internals.h | 2 -- target/loongarch/tcg/tlb_helper.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --gi

[PATCH v3 0/9] target/loongarch: Code cleanup with function loongarch_map_address

2025-04-21 Thread Bibo Mao
Get physical address from virtual address is important for qmp command to dump memory content. In TCG mode, it searches TLB tables firstly and then do page table walker. In KVM mode, there are no TLB tables and page table walker is used directly. Here TLB tables searching is moved to directory tcg

[PATCH v3 4/9] target/loongarch: Add stub function loongarch_get_addr_from_tlb

2025-04-21 Thread Bibo Mao
Stub function loongarch_get_addr_from_tlb() is added if option CONFIG_TCG is not enabled, so this function can be called in KVM only mode. Signed-off-by: Bibo Mao Reviewed-by: Philippe Mathieu-Daudé --- target/loongarch/cpu_helper.c | 9 + 1 file changed, 9 insertions(+) diff --git a/t

[PATCH v3 2/9] target/loongarch: Add function loongarch_get_addr_from_tlb

2025-04-21 Thread Bibo Mao
Function loongarch_get_addr_from_tlb() is added to get physical address from TLB tables. TLB table only works in TCG mode, in future this function will be moved to TCG directory. Signed-off-by: Bibo Mao Reviewed-by: Philippe Mathieu-Daudé --- target/loongarch/cpu_helper.c | 32 +

[PATCH v3 6/9] target/loongarch: Define function loongarch_get_addr_from_tlb() non-static

2025-04-21 Thread Bibo Mao
Define function loongarch_get_addr_from_tlb() non-static, and add its definition in header file tcg/tcg_loongarch.h Signed-off-by: Bibo Mao --- target/loongarch/cpu_helper.c| 10 ++ target/loongarch/tcg/tcg_loongarch.h | 16 2 files changed, 18 insertions(+), 8 d

[PATCH] MAINTAINERS: Add common-user/host/riscv to RISC-V section

2025-04-21 Thread Alistair Francis
Signed-off-by: Alistair Francis --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index d54b5578f8..d1551d9cc6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -328,6 +328,7 @@ F: include/hw/char/riscv_htif.h F: include/hw/riscv/ F: linux-user/host/riscv

Re: [PATCH] common-user/host/riscv: use tail pseudoinstruction for calling tail

2025-04-21 Thread Alistair Francis
On Thu, Apr 17, 2025 at 5:24 PM Icenowy Zheng wrote: > > The j pseudoinstruction maps to a JAL instruction, which can only handle > a jump to somewhere with a signed 20-bit destination. In case of static > linking and LTO'ing this easily leads to "relocation truncated to fit" > error. > > Switch t

Re: [PATCH v8 06/55] i386/tdx: Introduce is_tdx_vm() helper and cache tdx_guest object

2025-04-21 Thread Xiaoyao Li
On 4/18/2025 5:45 PM, Zhao Liu wrote: On Tue, Apr 01, 2025 at 09:01:16AM -0400, Xiaoyao Li wrote: Date: Tue, 1 Apr 2025 09:01:16 -0400 From: Xiaoyao Li Subject: [PATCH v8 06/55] i386/tdx: Introduce is_tdx_vm() helper and cache tdx_guest object X-Mailer: git-send-email 2.34.1 It will need sp

Re: [PATCH v8 02/55] i386: Introduce tdx-guest object

2025-04-21 Thread Xiaoyao Li
On 4/18/2025 5:17 PM, Zhao Liu wrote: configs/devices/i386-softmmu/default.mak | 1 + hw/i386/Kconfig | 5 +++ qapi/qom.json| 15 + target/i386/kvm/meson.build | 2 ++ target/i386/kvm/tdx.c| 43

RE: [PATCH v4 02/10] hw/arm/aspeed_ast27x0 Introduce vbootrom memory region

2025-04-21 Thread Jamin Lin
Hi Cedric, > Subject: Re: [PATCH v4 02/10] hw/arm/aspeed_ast27x0 Introduce vbootrom > memory region > > On 4/17/25 05:11, Jamin Lin wrote: > > Introduce a new vbootrom memory region. The region is mapped at > > address "0x" and has a size of 128KB, identical to the SRAM region > size. > >

Re: [PATCH v8 01/55] *** HACK *** linux-headers: Update headers to pull in TDX API changes

2025-04-21 Thread Xiaoyao Li
On 4/18/2025 5:47 PM, Zhao Liu wrote: diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h index 86f2c34e7afa..baca2d479365 100644 --- a/linux-headers/asm-x86/kvm.h +++ b/linux-headers/asm-x86/kvm.h @@ -925,4 +925,73 @@ struct kvm_hyperv_eventfd { #define KVM_X86_SNP_VM

RE: [PATCH v4 02/10] hw/arm/aspeed_ast27x0 Introduce vbootrom memory region

2025-04-21 Thread Jamin Lin
Hi Cedric, > Cc: Troy Lee ; nabiheste...@google.com > Subject: Re: [PATCH v4 02/10] hw/arm/aspeed_ast27x0 Introduce vbootrom > memory region > > On 4/17/25 05:11, Jamin Lin wrote: > > Introduce a new vbootrom memory region. The region is mapped at > > address "0x" and has a size of 128KB

[PATCH] hw/ssi/aspeed_smc: Allow 64-bit wide flash accesses

2025-04-21 Thread Joe Komlodi
cde3247651dc998da5dc1005148302a90d72f21f fixed atomicity for LDRD, which ends up making accesses 64-bits wide. However, the AST2600 bootloader can sometimes compile with LDRD instructions, which causes the acceses to fail when accessing the memory-mapped SPI flash. To fix this, increase the MMIO r

Re: riscv: AMO exception is incorrect

2025-04-21 Thread Richard Henderson
On 4/21/25 10:58, Eric DeVolder wrote: Hi, I've noticed what I believe to be an error in the RISC-V implementation.  The RISC-V spec[1] states:  Note that load and load-reserved instructions generate load  exceptions, whereas store, storeconditional, and AMO instructions  generate store/AMO

Re: [PATCH v4 09/10] tests/functional/aspeed: Add to test vbootrom for AST2700

2025-04-21 Thread Cédric Le Goater
On 4/17/25 05:12, Jamin Lin wrote: Add the AST2700 functional test to boot using the vbootrom image instead of manually loading boot components with -device loader. The boot ROM binary is now passed via the -bios option, using the image located in pc-bios/ast27x0_bootrom.bin. Signed-off-by: Jami

Re: [PATCH v4 08/10] tests/functional/aspeed: Update test ASPEED SDK v09.06

2025-04-21 Thread Cédric Le Goater
On 4/17/25 05:12, Jamin Lin wrote: Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater Thanks, C. --- tests/functional/test_aarch64_aspeed.py | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/functional/test_aarch64_aspeed.py b/tests

Re: [PATCH v4 07/10] tests/functional/aspeed: Move I2C test into shared helper for AST2700 reuse

2025-04-21 Thread Cédric Le Goater
On 4/17/25 05:12, Jamin Lin wrote: Move the I2C test case into a common helper function (do_ast2700_i2c_test) so it can be reused across multiple AST2700-based test cases. This reduces duplication and improves maintainability. Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater Thanks,

Re: [PATCH v4 02/10] hw/arm/aspeed_ast27x0 Introduce vbootrom memory region

2025-04-21 Thread Cédric Le Goater
On 4/17/25 05:11, Jamin Lin wrote: Introduce a new vbootrom memory region. The region is mapped at address "0x" and has a size of 128KB, identical to the SRAM region size. This memory region is intended for loading a vbootrom image file as part of the boot process. The vbootrom registere

Re: [PATCH v4 06/10] hw/arm/aspeed: Add support for loading vbootrom image via "-bios"

2025-04-21 Thread Cédric Le Goater
On 4/17/25 05:12, Jamin Lin wrote: Introduce "aspeed_load_vbootrom()" to support loading a virtual boot ROM image into the vbootrom memory region, using the "-bios" command-line option. Signed-off-by: Jamin Lin Reviewed-by: Nabih Estefan Tested-by: Nabih Estefan --- include/hw/arm/aspeed.h

[PATCH v2] block: Remove unused callback function *bdrv_aio_pdiscard

2025-04-21 Thread Sunny Zhu
The bytes type in *bdrv_aio_pdiscard should be int64_t rather than int. There are no drivers implementing the *bdrv_aio_pdiscard() callback, it appears to be an unused function. Therefore, we'll simply remove it instead of fixing it. Additionally, coroutine-based callbacks are preferred. If someo

riscv: AMO exception is incorrect

2025-04-21 Thread Eric DeVolder
Hi, I've noticed what I believe to be an error in the RISC-V implementation.  The RISC-V spec[1] states:  Note that load and load-reserved instructions generate load  exceptions, whereas store, storeconditional, and AMO instructions  generate store/AMO exceptions. For an AMO operation, a transla

Re: [PATCH] block: change type of bytes from int to int64_t for *bdrv_aio_pdiscard

2025-04-21 Thread Sunny Zhu
Eric Blake wrote: >On Mon, Apr 21, 2025 at 12:19:14AM +0800, Sunny Zhu wrote: >> Keep it consistent with *bdrv_co_pdiscard. >> >> Currently, there is no BlockDriver implemented the bdrv_aio_pdiscard() >> function, >> so we don’t need to make any adaptations either. > >If there are no drivers impl

Re: Trying cpr

2025-04-21 Thread Dr. David Alan Gilbert
* Dongli Zhang (dongli.zh...@oracle.com) wrote: > > > On 4/21/25 6:38 AM, Dr. David Alan Gilbert wrote: > > Hi Steve, > > I've just had a go with cpr-transfer, it's quite interesting. > > I was just trying it on my (AMD) desktop. > > > > * I was running with qemu displaying graphics, and after

Re: [PATCH v4 02/10] hw/arm/aspeed_ast27x0 Introduce vbootrom memory region

2025-04-21 Thread Cédric Le Goater
On 4/17/25 05:11, Jamin Lin wrote: Introduce a new vbootrom memory region. The region is mapped at address "0x" and has a size of 128KB, identical to the SRAM region size. This memory region is intended for loading a vbootrom image file as part of the boot process. The vbootrom registere

[PATCH 09/11] vfio/igd: Only emulate GGC register when x-igd-gms is set

2025-04-21 Thread Tomita Moeko
x-igd-gms is used for overriding DSM region size in GGC register in both config space and MMIO BAR0, by default host value is used. There is no need to emulate it in default case. Signed-off-by: Tomita Moeko --- hw/vfio/igd.c | 49 ++--- 1 file changed

[PATCH 11/11] vfio/igd: Update IGD passthrough documentation

2025-04-21 Thread Tomita Moeko
In previous commits, several changes were made to IGD passthrough: * Legacy mode now requires the IGD to be Gen6–Gen9. * OpRegion quirk is enabled by default. * "etc/igd-bdsm-size" is set to 0 when guest firmware does not need to allocate Data Stolen Memory and write BDSM register. Update the doc

[PATCH 05/11] vfio/igd: Check vendor and device ID on GVT-g mdev

2025-04-21 Thread Tomita Moeko
Check the vendor and device ID on GVT-g mdev to ensure it is a supported device [1]. This extra check is required for automatically enabling OpRegion access later. Note that Cherryview and Gemini Lake are marked as supported here since current code cannot distinguish them with other Gen8 and Gen9

[PATCH 10/11] vfio/igd: Remove generation limitation for IGD passthrough

2025-04-21 Thread Tomita Moeko
Starting from Intel Core Ultra Series (Meteor Lake), Data Stolen Memory has became a part of LMEMBAR (MMIO BAR2) [1][2], meaning that BDSM and GGC register quirks are no longer needed on these platforms. To support Meteor/Arrow/Lunar Lake and future IGD devices, remove the generation limitation in

[PATCH 07/11] vfio/igd: Allow hotplugging with OpRegion enabled

2025-04-21 Thread Tomita Moeko
OpRegion is exposed to guest as a read-only fw_cfg item, so hotplugging with it wouldn't cause issues. Since OpRegion needs to be set up by guest firmware, a guest reboot is typically required. For linux guests, i915 driver is able to mock VBT [1] when OpRegion is not present, the reboot may not re

[PATCH 08/11] vfio/igd: Allow overriding GMS with 0xf0 to 0xfe on Gen9+

2025-04-21 Thread Tomita Moeko
On Gen9 and later IGD devices, GMS 0xf0 to 0xfe represents 4MB to 60MB pre-allocated memory size in 4MB increments. Allow users overriding GMS with these values. Signed-off-by: Tomita Moeko --- hw/vfio/igd.c | 59 +++ 1 file changed, 41 insertions(

[PATCH 04/11] vfio/igd: Remove vfio_pci_igd_setup_opregion

2025-04-21 Thread Tomita Moeko
Since the last commit, vfio_pci_igd_setup_opregion is only called in GVT-g mode. Move its functionality into vfio_pci_kvmgt_config_quirk for more GVT-g-specific error logging. Also, hotplugging GVT-g vGPU is now always disallowed regardless of OpRegion to prevent potential issues. Intel has never

[PATCH 00/11] vfio/igd: Detect IGD by OpRegion and enable OpRegion automatically

2025-04-21 Thread Tomita Moeko
As proposed in a previous discussion [1], detect IGD devices based on whether it has VFIO_REGION_SUBTYPE_INTEL_IGD_OPREGION exposed by kernel and enables OpRegion access by default. This enables out-of-the-box display output support for IGD passthrough without having to manually set x-igd-opregion=

[PATCH 06/11] vfio/igd: Enable OpRegion by default

2025-04-21 Thread Tomita Moeko
As the presence of OpRegion is used to detect IGD device now, and guest driver usually depends on OpRegion to work. Enable OpRegion on IGD devices by default for out-of-the-box passthrough experience (except pre-boot display output), especially for libvirt users. Example of IGD passthrough with li

[PATCH 03/11] vfio/igd: Detect IGD device by OpRegion

2025-04-21 Thread Tomita Moeko
There is currently no straightforward way to distinguish if a Intel graphics device is IGD or discrete GPU. However, only IGD devices expose OpRegion. Use the presence of VFIO_REGION_SUBTYPE_INTEL_IGD_OPREGION to identify IGD devices. Signed-off-by: Tomita Moeko --- hw/vfio/igd.c | 26 ++

Re: [PATCH v2 08/10] pc-bios: Add AST27x0 vBootrom

2025-04-21 Thread Cédric Le Goater
Jamin, On 4/14/25 08:50, Jamin Lin wrote: Hi Cedric and all, Subject: Re: [PATCH v2 08/10] pc-bios: Add AST27x0 vBootrom On 4/10/25 04:38, Jamin Lin wrote: The boot ROM is a minimal implementation designed to load an AST27x0 boot image. Its source code is available at: https://github.com/g

[PATCH 02/11] vfio/igd: Always emulate ASLS (OpRegion) register

2025-04-21 Thread Tomita Moeko
ASLS register represents the base address of OpRegion, and it is programmed with HPA. In IGD passthrough scenario, it needs to be reprogrammed with GPA by guest firmware. To prevent guest accessing wrong memory range, ASLS should always be emulated and cleared. In GVT-g scenario, emulating ASLS is

[PATCH 01/11] vfio/igd: Restrict legacy mode to Gen6-9 devices

2025-04-21 Thread Tomita Moeko
Intel only provides legacy VBIOS for IGD up to Gen9, and there is no CSM support on later devices. Additionally, Seabios can only handle 32-bit BDSM register used until Gen9. Since legacy mode requires VGA capability, restrict it to Gen6 through Gen9 devices. Link: https://lore.kernel.org/qemu-de

Re: [PATCH v4 153/163] tcg: Assign TCGOP_TYPE in liveness_pass_2

2025-04-21 Thread Richard Henderson
On 4/18/25 03:46, Nicholas Piggin wrote: On Wed Apr 16, 2025 at 5:25 AM AEST, Richard Henderson wrote: Here we cannot rely on the default copied from tcg_op_insert_{after,before}, because the relevant op could be typeless, such as INDEX_op_call. Fixes: ... Missing ^ Yeah, I filled in that b

Re: [PATCH v2 00/10] Support vbootrom for AST2700

2025-04-21 Thread Cédric Le Goater
Hello Jamin On 4/14/25 03:20, Jamin Lin wrote: Hi Cedric, Subject: Re: [PATCH v2 00/10] Support vbootrom for AST2700 Hello Jamin On 4/10/25 04:38, Jamin Lin wrote: v1: Add initial support for AST27x0 The purpose of vbootrom here is to simulate the work of BootMCU SPL (riscv) i

Re: [RFC PATCH v3 02/14] qemu: Convert target_name() to TargetInfo API

2025-04-21 Thread Richard Henderson
On 4/18/25 10:28, Philippe Mathieu-Daudé wrote: include/hw/core/cpu.h | 2 -- include/qemu/target_info-impl.h | 23 +++ include/qemu/target_info.h | 19 +++ cpu-target.c| 5 - hw/core/machine-qmp-cmds.c | 1 +

Re: [RFC PATCH v3 01/14] qapi: Rename TargetInfo structure as BinaryTargetInfo

2025-04-21 Thread Richard Henderson
On 4/18/25 10:28, Philippe Mathieu-Daudé wrote: The QAPI-generated 'TargetInfo' structure name is only used in a single file. We want to heavily use another structure similarly named. Rename the QAPI one, since structure names are not part of the public API. Suggested-by: Pierrick Bouvier Signe

Re: Trying cpr

2025-04-21 Thread Dongli Zhang
On 4/21/25 6:38 AM, Dr. David Alan Gilbert wrote: > Hi Steve, > I've just had a go with cpr-transfer, it's quite interesting. > I was just trying it on my (AMD) desktop. > > * I was running with qemu displaying graphics, and after migration > the source display got updated every time I moved

Re: [PATCH v4 07/10] tests/functional/aspeed: Move I2C test into shared helper for AST2700 reuse

2025-04-21 Thread Nabih Estefan
On Wed, Apr 16, 2025 at 8:12 PM Jamin Lin wrote: > > Move the I2C test case into a common helper function (do_ast2700_i2c_test) so > it > can be reused across multiple AST2700-based test cases. This reduces > duplication > and improves maintainability. > > Signed-off-by: Jamin Lin Reviewed-by:

  1   2   >