RE: [RFC PATCH 0/5] hw/arm/virt: Add support for user-creatable nested SMMUv3

2024-11-13 Thread Shameerali Kolothum Thodi via
> -Original Message- > From: Nicolin Chen > Sent: Tuesday, November 12, 2024 11:00 PM > To: Shameerali Kolothum Thodi > ; nath...@nvidia.com > Cc: qemu-...@nongnu.org; qemu-devel@nongnu.org; > eric.au...@redhat.com; peter.mayd...@linaro.org; j...@nvidia.com; > ddut...@redhat.com; Linuxa

[PATCH v2] hw/net/rocker/rocker_of_dpa.c: Remove superfluous error check

2024-11-13 Thread Rodrigo Dias Correa
of_dpa_cmd_add_acl_ip() is called from a single place, and despite the fact that it always returns ROCKER_OK, its return value is still checked by the caller. Change of_dpa_cmd_add_acl_ip() to return void and remove the superfluous check from of_dpa_cmd_add_acl(). Resolves: https://gitlab.com/qemu-

Re: [PATCH v2 00/18] Fix write incorrect data into flash in user mode

2024-11-13 Thread Cédric Le Goater
Hello Jamin, On 11/14/24 06:30, Jamin Lin wrote: Hi Cedric, Subject: RE: [PATCH v2 00/18] Fix write incorrect data into flash in user mode Hi Cedric, Subject: Re: [PATCH v2 00/18] Fix write incorrect data into flash in user mode Hello Jamin, On 10/22/24 11:40, Jamin Lin wrote: change fro

Re: [PATCH v2 2/3] hw/sd/sdhci: Introduce a new Write Protected pin inverted property

2024-11-13 Thread Cédric Le Goater
On 11/4/24 04:21, Jamin Lin wrote: The Write Protect pin of SDHCI model is default active low to match the SDHCI spec. So, write enable the bit 19 should be 1 and write protected the bit 19 should be 0 at the Present State Register (0x24). However, some boards are design Write Protected pin activ

Re: [PATCH v2 0/3] Introduce a new Write Protected pin inverted property

2024-11-13 Thread Cédric Le Goater
Hello Jamin, On 11/14/24 06:32, Jamin Lin wrote: Hi Cedric, Andrew Subject: [PATCH v2 0/3] Introduce a new Write Protected pin inverted property change from v1: 1. Support RTC for AST2700. 2. Support SDHCI write protected pin inverted for AST2500 and AST2600. 3. Introduce Capabilities Registe

Re: [PATCH] vdpa: Support setting vring_base for packed svq

2024-11-13 Thread Michael S. Tsirkin
On Mon, Nov 04, 2024 at 09:51:24PM +0530, Sahil Siddiq wrote: > Linux commit v5.14-rc1~30^2~8 enabled the vp_vdpa driver to set the > vq state to the device's initial state. This works differently for > split and packed vqs. > > With shadow virtqueues enabled, vhost-vdpa sets the vring base using

[PATCH v2] hw/riscv/riscv-iommu.c: Correct the validness check of iova

2024-11-13 Thread Jason Chien
>From RISCV IOMMU spec section 2.1.3: When SXL is 1, the following rules apply: - If the first-stage is not Bare, then a page fault corresponding to the original access type occurs if the IOVA has bits beyond bit 31 set to 1. - If the second-stage is not Bare, then a guest page fault corresponding

Re: [PATCH v5 08/20] intel_iommu: Check stage-1 translation result with interrupt range

2024-11-13 Thread CLEMENT MATHIEU--DRIF
On 13/11/2024 09:49, Duan, Zhenzhong wrote: > Caution: External email. Do not open attachments or click links, unless this > email comes from a known sender and you know the content is safe. > > >> -Original Message- >> From: CLEMENT MATHIEU--DRIF >> Sent: Wednesday, November 13, 2024

RE: [PATCH v2 00/18] Fix write incorrect data into flash in user mode

2024-11-13 Thread Jamin Lin
Hi Cedric, > Subject: RE: [PATCH v2 00/18] Fix write incorrect data into flash in user mode > > Hi Cedric, > > > Subject: Re: [PATCH v2 00/18] Fix write incorrect data into flash in > > user mode > > > > Hello Jamin, > > > > On 10/22/24 11:40, Jamin Lin wrote: > > > change from v1: > > > 1. Fi

RE: [PATCH v2 0/3] Introduce a new Write Protected pin inverted property

2024-11-13 Thread Jamin Lin
Hi Cedric, Andrew > Subject: [PATCH v2 0/3] Introduce a new Write Protected pin inverted property > > change from v1: > 1. Support RTC for AST2700. > 2. Support SDHCI write protected pin inverted for AST2500 and AST2600. > 3. Introduce Capabilities Register 2 for SD slot 0 and 1. > 4. Support cre

[PATCH v2 00/22] tests/qtest: migration-test refactoring

2024-11-13 Thread Fabiano Rosas
v2: changelog: - s/migration-common/test-framework/ - call hooks migrate_hook_start|end_* - added migration-qmp.h - minor stuff Refactor migration-test.c and migration-helpers.c into multiple smaller files structured like so: qtest/migration/ test-framework.h test-framewor

Re: [PATCH 24/24] exec: Move 'ram_addr.h' header under sysemu/ namespace

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:13, Philippe Mathieu-Daudé wrote: "ram_addr.h" contains declarations specific to system emulation, move it under the sysemu/ directory to clarify the API namespace. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 2 +- include/exec/cpu-common.h

Re: [PATCH 23/24] exec/memory: Move qemu_map_ram_ptr() declaration to 'exec/ram_addr.h'

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:13, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 2 +- include/exec/ram_addr.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 9458e2801d..58faa3eb08 1

Re: [PATCH 22/24] exec/cpu-common: Move ram_addr_t related methods to 'exec/ram_addr.h'

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:13, Philippe Mathieu-Daudé wrote: Move methods related to the ram_addr_t type to the specific "exec/ram_addr.h" header. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-common.h| 56 +--- include/exec/ram_addr.h | 56 +

Re: [PATCH 21/24] exec: Extract CPU physical memory API to 'sysemu/physmem-target.h'

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:13, Philippe Mathieu-Daudé wrote: In order to keep "exec/ram_addr.h" focused on (target agnostic) methods related to the ram_addr_t type, move all (target specific) CPU physical memory API to a new "sysemu/physmem-target.h" header. Signed-off-by: Philippe Mathieu-Daudé --- MAIN

Re: [PATCH 20/24] exec: Declare tlb_vaddr_to_host() in 'exec/cputlb.h'

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:13, Philippe Mathieu-Daudé wrote: Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu_ldst.h | 25 - include/exec/cputlb.h | 26 ++ target/arm/tcg/helper-a64.c

Re: [PATCH 19/24] exec: Declare tlb_hit*() in 'exec/cputlb.h'

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:13, Philippe Mathieu-Daudé wrote: Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-all.h | 23 --- accel/tcg/cputlb.c | 23 +++ 2 files changed, 23 insertions(+), 23 delet

Re: [PATCH 18/24] exec: Declare tlb_flush*() in 'exec/cputlb.h'

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:13, Philippe Mathieu-Daudé wrote: Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h| 187 +++ include/exec/exec-all.h | 183 -- accel/tc

Re: [PATCH 15/24] exec: Declare tlb_set_page_full() in 'exec/cputlb.h'

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:13, Philippe Mathieu-Daudé wrote: Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h | 23 +++ include/exec/exec-all.h | 22 -- target/sparc/mmu_helper.c | 2 +- 3 fi

Re: [PATCH 16/24] exec: Declare tlb_set_page_with_attrs() in 'exec/cputlb.h'

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:13, Philippe Mathieu-Daudé wrote: Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h| 28 include/exec/exec-all.h | 25 - target/i38

Re: [PATCH 13/24] exec: Declare tlb_reset_dirty*() in 'exec/cputlb.h'

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote: Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h | 7 +++ include/exec/exec-all.h | 3 --- include/exec/ram_addr.h | 1 + system/physmem.c| 1 + 4 files changed,

Re: [PATCH 17/24] exec: Declare tlb_set_page() in 'exec/cputlb.h'

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:13, Philippe Mathieu-Daudé wrote: Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h | 11 +++ include/exec/exec-all.h | 9 - 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/inclu

Re: [PATCH 05/24] target/i386/helper: Include missing 'exec/translation-block.h' header

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote: TB compile flags are defined in "exec/translation-block.h". Include it in order to avoid when refactoring: target/i386/helper.c:536:28: error: use of undeclared identifier 'CF_PCREL' 536 | if (tcg_cflags_has(cs, CF_PCREL)) {

Re: [PATCH 12/24] accel/tcg: Have tlb_vaddr_to_host() use vaddr type

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote: abi_ptr is expected to be used in user emulation. tlb_vaddr_to_host() uses it, but can be used in system emulation. Replace the type by 'vaddr' which is equivalent on user emulation but also works on system. Signed-off-by: Philippe Mathieu-Daudé

Re: [PATCH 14/24] exec: Declare tlb_init/destroy() in 'exec/cputlb.h'

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote: Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h | 28 +++- include/exec/exec-all.h | 17 - accel/tcg/cpu-exec.c| 1 + 3 files cha

Re: [PATCH 08/24] linux-user/aarch64/mte: Include missing 'user/abitypes.h' header

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote: abi_long type is defined in "user/abitypes.h". Include it in order to avoid when refactoring: linux-user/aarch64/mte_user_helper.h:30:42: error: unknown type name ‘abi_long’; did you mean ‘u_long’? 30 | void arm_set_mte_tcf0(CPUArchSta

Re: [PATCH 06/24] target/rx/cpu: Include missing 'exec/translation-block.h' header

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote: The TranslationBlock structure is declared in "exec/translation-block.h", along with the TB compile flag definitions. Include the header in order to avoid when refactoring: target/rx/cpu.c:50:42: error: use of undeclared identifier 'CF_PCREL'

Re: [PATCH 11/24] exec: Introduce 'user/guest-host.h' header

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote: Extract all declarations related to 'guest from/to host' address translation to a new "user/guest-host.h" header. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-all.h| 34 +-- include/exec/cpu_ldst.h | 47 +---

Re: [PATCH 10/24] target/arm/cpu: Restrict cpu_untagged_addr() to user emulation

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote: Move the #endif guard where it belongs to restrict the cpu_untagged_addr() implementation to user emulation. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/cpu.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/

Re: [PATCH 09/24] target/arm/mte: Restrict 'exec/ram_addr.h' to system emulation

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote: "exec/ram_addr.h" contains system specific declarations. Restrict its inclusion to sysemu to avoid build errors when refactoring. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/tcg/mte_helper.c | 2 ++ 1 file changed, 2 insertions(+)

Re: [PATCH 04/24] accel/tcg: Include missing 'exec/translation-block.h' header

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote: TB compile flags are defined in "exec/translation-block.h". Include it in order to avoid when refactoring: accel/tcg/tcg-accel-ops.c:62:36: error: use of undeclared identifier 'CF_CLUSTER_SHIFT' 62 | cflags = cpu->cluster_index <<

Re: [PATCH 07/24] system/watchpoint: Include missing 'exec/cpu-all.h' header

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote: TARGET_PAGE_MASK is defined in "exec/cpu-all.h". Include it in order to avoid when refactoring: system/watchpoint.c:52:24: error: use of undeclared identifier 'TARGET_PAGE_MASK' 52 | in_page = -(addr | TARGET_PAGE_MASK); |

Re: [PATCH 03/24] exec/translation-block: Include missing 'exec/vaddr.h' header

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote: 'vaddr' is declared in "exec/vaddr.h". Include it in order to avoid when refactoring: include/exec/translation-block.h:56:5: error: unknown type name 'vaddr' 56 | vaddr pc; | ^ Signed-off-by: Philippe Mathieu-Daudé ---

Re: [PATCH 01/24] exec/cpu-all: Include missing 'exec/cpu-defs.h' header

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote: TARGET_PAGE_BITS is defined in "exec/cpu-defs.h". Include it in order to avoid when refactoring: In file included from ../../system/watchpoint.c:23: include/exec/cpu-all.h:356:19: error: use of undeclared identifier 'TARGET_PAGE_BITS'

Re: [PATCH 02/24] exec/cpu-defs: Remove unnecessary headers

2024-11-13 Thread Pierrick Bouvier
On 11/13/24 17:12, Philippe Mathieu-Daudé wrote: "exec/cpu-defs.h" should be kept as minimal as possible; besides these includes don't seem necessay. Remove them. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-defs.h | 8 1 file changed, 8 deletions(-) diff --git a/in

Re: [RFC PATCH v6 2/2] tests/qtest: QTest example for RISC-V CSR register

2024-11-13 Thread Fabiano Rosas
Ivan Klokov writes: > Added demo for reading CSR register from qtest environment. > > Signed-off-by: Ivan Klokov You forgot to carry my reviewed-by. Please include it when you resend: Reviewed-by: Fabiano Rosas

[PATCH 23/24] exec/memory: Move qemu_map_ram_ptr() declaration to 'exec/ram_addr.h'

2024-11-13 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 2 +- include/exec/ram_addr.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 9458e2801d..58faa3eb08 100644 --- a/include/exec/memory.h +++ b/include/exec/m

[PATCH v2 01/22] tests/qtest/migration: Fix indentations

2024-11-13 Thread Fabiano Rosas
Select all the code and hit tab. I'll be moving functions around quite a lot in the next patches, so make sure all indentation is correct now. Add parentheses around some expressions to preserve readability. Reviewed-by: Daniel P. Berrangé Signed-off-by: Fabiano Rosas --- tests/qtest/migration

[PATCH 13/24] exec: Declare tlb_reset_dirty*() in 'exec/cputlb.h'

2024-11-13 Thread Philippe Mathieu-Daudé
Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h | 7 +++ include/exec/exec-all.h | 3 --- include/exec/ram_addr.h | 1 + system/physmem.c| 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/ex

[PATCH 09/24] target/arm/mte: Restrict 'exec/ram_addr.h' to system emulation

2024-11-13 Thread Philippe Mathieu-Daudé
"exec/ram_addr.h" contains system specific declarations. Restrict its inclusion to sysemu to avoid build errors when refactoring. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/tcg/mte_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/arm/tcg/mte_helper.c b/target/arm/t

[PATCH 11/24] exec: Introduce 'user/guest-host.h' header

2024-11-13 Thread Philippe Mathieu-Daudé
Extract all declarations related to 'guest from/to host' address translation to a new "user/guest-host.h" header. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-all.h| 34 +-- include/exec/cpu_ldst.h | 47 + include/user/guest-host.h | 87 +++

[PATCH 16/24] exec: Declare tlb_set_page_with_attrs() in 'exec/cputlb.h'

2024-11-13 Thread Philippe Mathieu-Daudé
Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h| 28 include/exec/exec-all.h | 25 - target/i386/tcg/sysemu/excp_helper.c | 2 +- target/microblaze/

[PATCH 08/24] linux-user/aarch64/mte: Include missing 'user/abitypes.h' header

2024-11-13 Thread Philippe Mathieu-Daudé
abi_long type is defined in "user/abitypes.h". Include it in order to avoid when refactoring: linux-user/aarch64/mte_user_helper.h:30:42: error: unknown type name ‘abi_long’; did you mean ‘u_long’? 30 | void arm_set_mte_tcf0(CPUArchState *env, abi_long value); |

[PATCH 19/24] exec: Declare tlb_hit*() in 'exec/cputlb.h'

2024-11-13 Thread Philippe Mathieu-Daudé
Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-all.h | 23 --- accel/tcg/cputlb.c | 23 +++ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/exec/cpu-all.h b/include/e

[PATCH 18/24] exec: Declare tlb_flush*() in 'exec/cputlb.h'

2024-11-13 Thread Philippe Mathieu-Daudé
Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h| 187 +++ include/exec/exec-all.h | 183 -- accel/tcg/tcg-accel-ops.c| 1 + cpu-target.c

[PATCH 22/24] exec/cpu-common: Move ram_addr_t related methods to 'exec/ram_addr.h'

2024-11-13 Thread Philippe Mathieu-Daudé
Move methods related to the ram_addr_t type to the specific "exec/ram_addr.h" header. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-common.h| 56 +--- include/exec/ram_addr.h | 56 include/exec/translation

[PATCH 17/24] exec: Declare tlb_set_page() in 'exec/cputlb.h'

2024-11-13 Thread Philippe Mathieu-Daudé
Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h | 11 +++ include/exec/exec-all.h | 9 - 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/exec/cputlb.h b/include/exec/cputlb.h index ae4798a

[PATCH 01/24] exec/cpu-all: Include missing 'exec/cpu-defs.h' header

2024-11-13 Thread Philippe Mathieu-Daudé
TARGET_PAGE_BITS is defined in "exec/cpu-defs.h". Include it in order to avoid when refactoring: In file included from ../../system/watchpoint.c:23: include/exec/cpu-all.h:356:19: error: use of undeclared identifier 'TARGET_PAGE_BITS' 356 | QEMU_BUILD_BUG_ON(TLB_FLAGS_MASK & TLB_SLOW_FLAG

Re: [PATCH 21/24] exec: Extract CPU physical memory API to 'sysemu/physmem-target.h'

2024-11-13 Thread Philippe Mathieu-Daudé
On 14/11/24 01:13, Philippe Mathieu-Daudé wrote: In order to keep "exec/ram_addr.h" focused on (target agnostic) methods related to the ram_addr_t type, move all (target specific) CPU physical memory API to a new "sysemu/physmem-target.h" header. Signed-off-by: Philippe Mathieu-Daudé --- MAIN

[PATCH 20/24] exec: Declare tlb_vaddr_to_host() in 'exec/cputlb.h'

2024-11-13 Thread Philippe Mathieu-Daudé
Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu_ldst.h | 25 - include/exec/cputlb.h | 26 ++ target/arm/tcg/helper-a64.c | 1 + target/ppc/mem_helper.c | 1 + 4 files chan

[PATCH 04/24] accel/tcg: Include missing 'exec/translation-block.h' header

2024-11-13 Thread Philippe Mathieu-Daudé
TB compile flags are defined in "exec/translation-block.h". Include it in order to avoid when refactoring: accel/tcg/tcg-accel-ops.c:62:36: error: use of undeclared identifier 'CF_CLUSTER_SHIFT' 62 | cflags = cpu->cluster_index << CF_CLUSTER_SHIFT; |

[PATCH 12/24] accel/tcg: Have tlb_vaddr_to_host() use vaddr type

2024-11-13 Thread Philippe Mathieu-Daudé
abi_ptr is expected to be used in user emulation. tlb_vaddr_to_host() uses it, but can be used in system emulation. Replace the type by 'vaddr' which is equivalent on user emulation but also works on system. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu_ldst.h | 3 ++- accel/tcg/cpu

[PATCH 07/24] system/watchpoint: Include missing 'exec/cpu-all.h' header

2024-11-13 Thread Philippe Mathieu-Daudé
TARGET_PAGE_MASK is defined in "exec/cpu-all.h". Include it in order to avoid when refactoring: system/watchpoint.c:52:24: error: use of undeclared identifier 'TARGET_PAGE_MASK' 52 | in_page = -(addr | TARGET_PAGE_MASK); |^ Signed-off-by: Philippe Mathi

[PATCH 06/24] target/rx/cpu: Include missing 'exec/translation-block.h' header

2024-11-13 Thread Philippe Mathieu-Daudé
The TranslationBlock structure is declared in "exec/translation-block.h", along with the TB compile flag definitions. Include the header in order to avoid when refactoring: target/rx/cpu.c:50:42: error: use of undeclared identifier 'CF_PCREL' 50 | tcg_debug_assert(!tcg_cflags_has(cs, CF

[PATCH 03/24] exec/translation-block: Include missing 'exec/vaddr.h' header

2024-11-13 Thread Philippe Mathieu-Daudé
'vaddr' is declared in "exec/vaddr.h". Include it in order to avoid when refactoring: include/exec/translation-block.h:56:5: error: unknown type name 'vaddr' 56 | vaddr pc; | ^ Signed-off-by: Philippe Mathieu-Daudé --- include/exec/translation-block.h | 1 + 1 file change

[PATCH 24/24] exec: Move 'ram_addr.h' header under sysemu/ namespace

2024-11-13 Thread Philippe Mathieu-Daudé
"ram_addr.h" contains declarations specific to system emulation, move it under the sysemu/ directory to clarify the API namespace. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 2 +- include/exec/cpu-common.h | 2 +- include/exec/memory.h

[PATCH 21/24] exec: Extract CPU physical memory API to 'sysemu/physmem-target.h'

2024-11-13 Thread Philippe Mathieu-Daudé
In order to keep "exec/ram_addr.h" focused on (target agnostic) methods related to the ram_addr_t type, move all (target specific) CPU physical memory API to a new "sysemu/physmem-target.h" header. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 + include/exec/

[PATCH v2 12/22] tests/qtest/migration: Split TLS tests from migration-test.c

2024-11-13 Thread Fabiano Rosas
The migration-test.c file has become unwieldy large. It's quite confusing to navigate with all the test definitions mixed with hook definitions. The TLS tests make this worse with ifdef'ery. Since we're planning on having a smaller set of tests to run as smoke testing on all architectures, I'm tak

[PATCH 15/24] exec: Declare tlb_set_page_full() in 'exec/cputlb.h'

2024-11-13 Thread Philippe Mathieu-Daudé
Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h | 23 +++ include/exec/exec-all.h | 22 -- target/sparc/mmu_helper.c | 2 +- 3 files changed, 24 insertions(+), 23 deletions(-) diff --

[PATCH 10/24] target/arm/cpu: Restrict cpu_untagged_addr() to user emulation

2024-11-13 Thread Philippe Mathieu-Daudé
Move the #endif guard where it belongs to restrict the cpu_untagged_addr() implementation to user emulation. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/cpu.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index d86e641280..1

[PATCH 00/24] exec: Build up 'cputlb.h' and 'ram_addr.h' headers

2024-11-13 Thread Philippe Mathieu-Daudé
Hi, "exec/exec-all.h" and "exec/cpu-all.h" both contains a mess of unrelated APIs. More importantly, they contain target specific declarations, making any file including them to become target specific, thus not buildable in common meson sets. This series first extract the CPU TLB API scattered in

[PATCH 14/24] exec: Declare tlb_init/destroy() in 'exec/cputlb.h'

2024-11-13 Thread Philippe Mathieu-Daudé
Move CPU TLB related methods to "exec/cputlb.h". Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cputlb.h | 28 +++- include/exec/exec-all.h | 17 - accel/tcg/cpu-exec.c| 1 + 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/i

[PATCH 05/24] target/i386/helper: Include missing 'exec/translation-block.h' header

2024-11-13 Thread Philippe Mathieu-Daudé
TB compile flags are defined in "exec/translation-block.h". Include it in order to avoid when refactoring: target/i386/helper.c:536:28: error: use of undeclared identifier 'CF_PCREL' 536 | if (tcg_cflags_has(cs, CF_PCREL)) { |^ Signed-off-by: Philippe

[PATCH 02/24] exec/cpu-defs: Remove unnecessary headers

2024-11-13 Thread Philippe Mathieu-Daudé
"exec/cpu-defs.h" should be kept as minimal as possible; besides these includes don't seem necessay. Remove them. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/cpu-defs.h | 8 1 file changed, 8 deletions(-) diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h index 0

Re: [PATCH 2/7] target/i386/kvm: introduce 'pmu-cap-disabled' to set KVM_PMU_CAP_DISABLE

2024-11-13 Thread dongli . zhang
On 11/13/24 9:15 AM, Zhao Liu wrote: >>> Further, considering that this is currently the only case that needs to >>> to set the VM level's capability in the CPU context, there is no need to >>> introduce a new kvm interface (in your previous patch), which can instead >>> be set in kvm_cpu_realiz

Re: [PATCH] i386/kvm: Fix kvm_enable_x2apic link error in non-KVM builds

2024-11-13 Thread Shukla, Santosh
On 11/13/2024 11:41 PM, Paolo Bonzini wrote: > On 11/13/24 15:49, Phil Dennis-Jordan wrote: >> It appears that existing call sites for the kvm_enable_x2apic() >> function rely on the compiler eliding the calls during optimisation >> when building with KVM disabled, or on platforms other than Lin

[PATCH v2 14/22] tests/qtest/migration: Split postcopy tests

2024-11-13 Thread Fabiano Rosas
Split the next group of tests from migration-test.c, the postcopy tests. This is another well-defined group of tests and postcopy is a unique enough feature that it deserves it's own file. Signed-off-by: Fabiano Rosas --- tests/qtest/meson.build| 1 + tests/qtest/migration-test

Re: [PATCH v10 01/15] ui & main loop: Redesign of system-specific main thread event handling

2024-11-13 Thread Phil Dennis-Jordan
On Wed, 13 Nov 2024 at 19:36, Paolo Bonzini wrote: > On Wed, Nov 13, 2024 at 7:16 PM BALATON Zoltan wrote: > > > int main(int argc, char **argv) > > > { > > > +QemuThread main_loop_thread; > > > + > > > qemu_init(argc, argv); > > > -return qemu_main(); > > > +if (qemu_main) { > >

Re: [RFC PATCH 2/5] qtest/libqos/pci: Fix msix_enable sharing bar0

2024-11-13 Thread Fabiano Rosas
Nicholas Piggin writes: > Devices where the MSI-X addresses are shared with other MMIO on BAR0 > can not use msi_enable because it unmaps and remaps BAR0, which > interferes with device MMIO mappings. xhci-nec is one such device we > would like to test msix with. > > Keep track of each the BAR io

Re: [PATCH V3 12/16] tests/migration-test: memory_backend

2024-11-13 Thread Fabiano Rosas
Steve Sistare writes: > Allow each migration test to define its own memory backend, replacing > the standard "-m " specification. > > Signed-off-by: Steve Sistare Reviewed-by: Fabiano Rosas > --- > tests/qtest/migration-test.c | 20 > 1 file changed, 16 insertions(+), 4

Re: [PATCH V3 13/16] tests/qtest: defer connection

2024-11-13 Thread Peter Xu
On Fri, Nov 01, 2024 at 06:47:52AM -0700, Steve Sistare wrote: > +void qtest_connect_deferred(QTestState *s) > +{ > +g_autofree gchar *socket_path = NULL; > +g_autofree gchar *qmp_socket_path = NULL; > + > +socket_path = g_strdup_printf("%s/qtest-%d.sock", > +

Re: [PATCH V3 13/16] tests/qtest: defer connection

2024-11-13 Thread Fabiano Rosas
Steve Sistare writes: > Add an option to defer making the connecting to the monitor and qtest > sockets when calling qtest_init_with_env. The client makes the connection > later by calling qtest_connect_deferred and qtest_qmp_handshake. > > Signed-off-by: Steve Sistare > --- > tests/qtest/libq

[PATCH v2 15/22] tests/qtest/migration: Split file tests

2024-11-13 Thread Fabiano Rosas
Split the file tests from migration-test.c. These are being moved to their own file due to being special enough compared with the regular stream migration. There is also the entire mapped-ram feature which depends on file migration. Signed-off-by: Fabiano Rosas --- tests/qtest/meson.build

Re: [PATCH V3 16/16] migration: cpr-transfer documentation

2024-11-13 Thread Peter Xu
On Fri, Nov 01, 2024 at 06:47:55AM -0700, Steve Sistare wrote: > +Caveats > +^^^ > + > +cpr-transfer mode may not be used with postcopy, background-snapshot, > +or COLO. > + > +memory-backend-epc and memory-backend-ram are not supported. Just to double check: now the plan is to allow memory-ba

Re: [PATCH] fuzz: disable tcg for OSS-Fuzz builds

2024-11-13 Thread Philippe Mathieu-Daudé
On 13/11/24 16:37, Alexander Bulekov wrote: OSS-Fuzz builds have been failing due to some strange issues that seem to be related to color codes from libffi: https://oss-fuzz-build-logs.storage.googleapis.com/log-8d5435ee-1677-40af-9656-b4162fa881e1.txt Disable tcg to disable libffi. Signed-off-

Re: [RFC PATCH v6 1/2] target/riscv: Add RISC-V CSR qtest support

2024-11-13 Thread Fabiano Rosas
Ivan Klokov writes: > The RISC-V architecture supports the creation of custom > CSR-mapped devices. It would be convenient to test them in the same way > as MMIO-mapped devices. To do this, a new call has been added > to read/write CSR registers. > > Signed-off-by: Ivan Klokov > --- > hw/riscv/

Re: [PATCH V3 11/16] migration: cpr-transfer mode

2024-11-13 Thread Peter Xu
On Fri, Nov 01, 2024 at 06:47:50AM -0700, Steve Sistare wrote: > Add the cpr-transfer migration mode. Usage: > qemu-system-$arch -machine anon-alloc=memfd ... > > start new QEMU with "-incoming -cpr-uri " > > Issue commands to old QEMU: > migrate_set_parameter mode cpr-transfer > migr

Re: [RFC PATCH 0/5] hw/arm/virt: Add support for user-creatable nested SMMUv3

2024-11-13 Thread Nicolin Chen
On Fri, Nov 08, 2024 at 12:52:37PM +, Shameer Kolothum wrote: > This RFC is for initial discussion/test purposes only and includes patches > that are only relevant for adding the "arm-smmuv3-nested" support. For the > complete branch please find, > https://github.com/hisilicon/qemu/commits/priv

[PATCH v2 04/22] tests/migration: Disambiguate guestperf vs. a-b

2024-11-13 Thread Fabiano Rosas
The current build structure for migration tests is confusing. There is the tests/migration directory, which contains two different guest code implementations, one for the qtests (a-b-{bootblock|kernel}.S) and another for the guestperf script (stress.c). One uses a Makefile, while the other uses mes

Re: [PULL 2/2] migration: fix-possible-int-overflow

2024-11-13 Thread Peter Xu
On Wed, Nov 13, 2024 at 09:40:50PM +0100, Philippe Mathieu-Daudé wrote: > Hi, > > On 13/11/24 20:16, Peter Xu wrote: > > From: Dmitry Frolov > > > > stat64_add() takes uint64_t as 2nd argument, but both > > "p->next_packet_size" and "p->packet_len" are uint32_t. > > Thus, theyr sum may overflow

[PATCH v2 03/22] tests/qtest/migration: Stop calling everything "test"

2024-11-13 Thread Fabiano Rosas
Test frameworks usually prefix "test_" to the entry point of the test code. Having every function prefixed with test_ makes it hard to understand the code and to grep for the actual tests. Remove the "test" prefix from everything that is not a test. In order to still keep some namespacing, stick

Re: [PATCH] tests/qtest: add TIMEOUT_MULTIPLIER

2024-11-13 Thread Fabiano Rosas
Dmitry Frolov writes: > Some tests need more time when qemu is built with > "--enable-asan --enable-ubsan" > > As was discussed here: > https://patchew.org/QEMU/20241112120100.176492-2-fro...@swemel.ru/ > > TIMEOUT_MULTIPLIER enviroment variable will be > a useful option, allowing non-invasive ti

Re: [PATCH V3 10/16] migration: split qmp_migrate

2024-11-13 Thread Peter Xu
On Fri, Nov 01, 2024 at 06:47:49AM -0700, Steve Sistare wrote: > Split qmp_migrate into start and finish functions. Finish will be > called asynchronously in a subsequent patch, but for now, call it > immediately. No functional change. > > Signed-off-by: Steve Sistare > --- > migration/migrati

[PATCH v2 18/22] tests/qtest/migration: Split validation tests + misc

2024-11-13 Thread Fabiano Rosas
Move the remaining tests into a misc-tests.c file. These tests are mostly about validation of input and should be in the future replaced by unit testing. Signed-off-by: Fabiano Rosas --- tests/qtest/meson.build| 1 + tests/qtest/migration-test.c | 275 +---

[PATCH for-10.0 4/9] target/riscv: add shvstvala

2024-11-13 Thread Daniel Henrique Barboza
shvstvala is defined in RVA22 as: "vstval must be written in all cases described above for stval." By "cases describe above" the doc refer to the description of sstvala: "stval must be written with the faulting virtual address for load, store, and instruction page-fault, access-fault, and misali

[PATCH for-10.0 5/9] target/riscv: add shtvala

2024-11-13 Thread Daniel Henrique Barboza
shtvala is described in RVA22 as: "htval must be written with the faulting guest physical address in all circumstances permitted by the ISA." This is the case since commit 3067553993, so claim support for shtvala. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 1 + 1 file chan

Re: [PATCH] fuzz: disable tcg for OSS-Fuzz builds

2024-11-13 Thread Paolo Bonzini
Queued, thanks. Paolo

[PATCH for-10.0 6/9] target/riscv: add shvstvecd

2024-11-13 Thread Daniel Henrique Barboza
shvstvecd is defined in RVA22 as: "vstvec.MODE must be capable of holding the value 0 (Direct). When vstvec.MODE=Direct, vstvec.BASE must be capable of holding any valid four-byte-aligned address." This is always true for TCG so let's claim support for it. Signed-off-by: Daniel Henrique Barboza

Re: [PATCH V3 06/16] migration: VMSTATE_FD

2024-11-13 Thread Peter Xu
On Fri, Nov 01, 2024 at 06:47:45AM -0700, Steve Sistare wrote: > Define VMSTATE_FD for declaring a file descriptor field in a > VMStateDescription. > > Signed-off-by: Steve Sistare Reviewed-by: Peter Xu -- Peter Xu

Re: [PATCH V3 05/16] migration: SCM_RIGHTS for QEMUFile

2024-11-13 Thread Peter Xu
On Fri, Nov 01, 2024 at 06:47:44AM -0700, Steve Sistare wrote: > Define functions to put/get file descriptors to/from a QEMUFile, for qio > channels that support SCM_RIGHTS. Maintain ordering such that > put(A), put(fd), put(B) > followed by > get(A), get(fd), get(B) > always succeeds. Other

Re: [PATCH] hw/s390x: Restrict "loadparm" property to devices that can be used for booting

2024-11-13 Thread Jared Rossi
On 11/13/24 6:47 AM, Thomas Huth wrote: Commit bb185de423 ("s390x: Add individual loadparm assignment to CCW device") added a "loadparm" property to all CCW devices. This was a little bit unfortunate, since this property is only useful for devices that can be used for booting, but certainly it

Re: [PATCH v1 2/2] migration: Do not perform RAMBlock dirty sync during the first iteration

2024-11-13 Thread Peter Xu
On Wed, Nov 13, 2024 at 07:49:44PM +0100, David Hildenbrand wrote: > I think I had precisely that, and I recall you suggested to have it only > after the initial sync. Would work for me, but I'd still like to understand > why essentially none of the "discard" was effective -- all of guest RAM got >

Re: [PATCH] fuzz: disable tcg for OSS-Fuzz builds

2024-11-13 Thread Philippe Mathieu-Daudé
On 13/11/24 20:02, Alexander Bulekov wrote: On 241113 2040, Philippe Mathieu-Daud?? wrote: On 13/11/24 16:37, Alexander Bulekov wrote: OSS-Fuzz builds have been failing due to some strange issues that seem to be related to color codes from libffi: https://oss-fuzz-build-logs.storage.googleapis.

[PULL 0/2] Migration 20241113 patches

2024-11-13 Thread Peter Xu
The following changes since commit f0cfd067867668870931c9411d96cd518564b7a8: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2024-11-09 12:34:01 +) are available in the Git repository at: https://gitlab.com/peterx/qemu.git tags/migration-20241113-pu

Re: [PULL 2/2] migration: fix-possible-int-overflow

2024-11-13 Thread Philippe Mathieu-Daudé
Hi, On 13/11/24 20:16, Peter Xu wrote: From: Dmitry Frolov stat64_add() takes uint64_t as 2nd argument, but both "p->next_packet_size" and "p->packet_len" are uint32_t. Thus, theyr sum may overflow uint32_t. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmi

Re: [PATCH V3 02/16] migration: cpr-state

2024-11-13 Thread Peter Xu
On Fri, Nov 01, 2024 at 06:47:41AM -0700, Steve Sistare wrote: > CPR must save state that is needed after QEMU is restarted, when devices > are realized. Thus the extra state cannot be saved in the migration stream, > as objects must already exist before that stream can be loaded. Instead, > defi

[PULL 2/2] migration: fix-possible-int-overflow

2024-11-13 Thread Peter Xu
From: Dmitry Frolov stat64_add() takes uint64_t as 2nd argument, but both "p->next_packet_size" and "p->packet_len" are uint32_t. Thus, theyr sum may overflow uint32_t. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Dmitry Frolov Link: https://lore.kernel.org/

[PULL 1/2] migration: Check current_migration in migration_is_running()

2024-11-13 Thread Peter Xu
Report shows that commit 34a8892dec broke iotest 055: https://lore.kernel.org/r/b8806360-a2b6-4608-83a3-db67e264c...@linaro.org Denis Rastyogin reported more such issue: https://lore.kernel.org/r/20241107114256.106831-1-ger...@altlinux.org In this merge, the migration_is_idle() function was r

[PATCH v2 08/22] tests/qtest/migration: Move ufd_version_check to utils

2024-11-13 Thread Fabiano Rosas
Move ufd_version_check() to migration-util.c file. This is a helper function that is used during tests definition so it should be available outside of migration-test.c Signed-off-by: Fabiano Rosas --- tests/qtest/migration-test.c | 47 ++--- tests/qtest/migration/mi

Re: [PATCH] fuzz: disable tcg for OSS-Fuzz builds

2024-11-13 Thread Alexander Bulekov
On 241113 2040, Philippe Mathieu-Daud?? wrote: > On 13/11/24 16:37, Alexander Bulekov wrote: > > OSS-Fuzz builds have been failing due to some strange issues that seem > > to be related to color codes from libffi: > > https://oss-fuzz-build-logs.storage.googleapis.com/log-8d5435ee-1677-40af-9656-b4

  1   2   3   >