Re: [PATCH v4 00/11] target/arm: Fix M-profile helper loads/stores alignment checks

2025-07-04 Thread William Kosasih
This really made my day :-) Thanks Peter! Best regards, William On Fri, Jul 4, 2025 at 22:29 Peter Maydell wrote: > On Thu, 3 Jul 2025 at 09:56, William Kosasih > wrote: > > > > Historically, M-profile helper functions in m_helper.c and mve_helper.c > > used the

[PATCH v4 11/11] target/arm: Fix VST2 helper store alignment checks

2025-07-03 Thread William Kosasih
This patch adds alignment checks in the store operations in the VST2 instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih Reviewed-by: Richard Henderson --- target/arm/tcg/mve_helper.c | 12 +--- 1 file changed, 9 insertions(+), 3

[PATCH v4 08/11] target/arm: Fix VLD4 helper load alignment checks

2025-07-03 Thread William Kosasih
This patch adds alignment checks in the load operations in the VLD4 instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih Reviewed-by: Richard Henderson --- target/arm/tcg/mve_helper.c | 12 +--- 1 file changed, 9 insertions(+), 3

[PATCH v4 09/11] target/arm: Fix VLD2 helper load alignment checks

2025-07-03 Thread William Kosasih
This patch adds alignment checks in the load operations in the VLD2 instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih Reviewed-by: Richard Henderson --- target/arm/tcg/mve_helper.c | 12 +--- 1 file changed, 9 insertions(+), 3

[PATCH v4 10/11] target/arm: Fix VST4 helper store alignment checks

2025-07-03 Thread William Kosasih
This patch adds alignment checks in the store operations in the VST4 instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih Reviewed-by: Richard Henderson --- target/arm/tcg/mve_helper.c | 12 +--- 1 file changed, 9 insertions(+), 3

[PATCH v4 03/11] target/arm: Fix function_return helper load alignment checks

2025-07-03 Thread William Kosasih
This patch adds alignment checks in the load operations (when unstacking the return pc and psr) in the FunctionReturn pseudocode. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih Reviewed-by: Richard Henderson --- target/arm/tcg/m_helper.c | 2 +- 1

[PATCH v4 00/11] target/arm: Fix M-profile helper loads/stores alignment checks

2025-07-03 Thread William Kosasih
/-/issues/1154 Signed-off-by: William Kosasih William Kosasih (11): target/arm: Bring VLSTM/VLLDM helper store/load closer to the ARM pseudocode target/arm: Fix BLXNS helper store alignment checks target/arm: Fix function_return helper load alignment checks target/arm: Fix VLDR helper load

[PATCH v4 06/11] target/arm: Fix VLDR_SG helper load alignment checks

2025-07-03 Thread William Kosasih
This patch adds alignment checks in the load operations in the VLDR_SG instructions. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih Reviewed-by: Richard Henderson --- target/arm/tcg/mve_helper.c | 42 ++--- 1 file

[PATCH v4 05/11] target/arm: Fix VSTR helper store alignment checks

2025-07-03 Thread William Kosasih
This patch adds alignment checks in the store operations in the VSTR instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih Reviewed-by: Richard Henderson --- target/arm/tcg/mve_helper.c | 18 ++ 1 file changed, 10 insertions

[PATCH v4 07/11] target/arm: Fix VSTR_SG helper store alignment checks

2025-07-03 Thread William Kosasih
This patch adds alignment checks in the store operations in the VSTR_SG instructions. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih Reviewed-by: Richard Henderson --- target/arm/tcg/mve_helper.c | 30 +- 1 file changed

[PATCH v4 01/11] target/arm: Bring VLSTM/VLLDM helper store/load closer to the ARM pseudocode

2025-07-03 Thread William Kosasih
redundant lookups Signed-off-by: William Kosasih Reviewed-by: Richard Henderson --- target/arm/tcg/m_helper.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/target/arm/tcg/m_helper.c b/target/arm/tcg/m_helper.c index 6614719832..251e12edf9 100644

[PATCH v4 02/11] target/arm: Fix BLXNS helper store alignment checks

2025-07-03 Thread William Kosasih
This patch adds alignment checks in the store operations (when stacking the return pc and psr) in the BLXNS instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih Reviewed-by: Richard Henderson --- target/arm/tcg/m_helper.c | 7 +-- 1 file

[PATCH v4 04/11] target/arm: Fix VLDR helper load alignment checks

2025-07-03 Thread William Kosasih
This patch adds alignment checks in the load operations in the VLDR instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih Reviewed-by: Richard Henderson --- target/arm/tcg/mve_helper.c | 24 +--- 1 file changed, 13

Re: [PATCH v3 12/12] target/arm: Fix helper macros indentation in mve_helper.c

2025-07-03 Thread William Kosasih
Ah okay cool. I'll leave them as they are for now :-) Many thanks, William On Thu, Jul 3, 2025 at 12:23 AM Richard Henderson < richard.hender...@linaro.org> wrote: > On 7/2/25 05:19, William Kosasih wrote: > > Recent helper function load and store alignment fix cause

Re: [PATCH v3 04/12] target/arm: Fix VLDR helper load alignment checks

2025-07-03 Thread William Kosasih
M Richard Henderson < richard.hender...@linaro.org> wrote: > On 7/2/25 05:19, William Kosasih wrote: > > +DO_VLDR(vldrb_sh, MO_UB, 1, int8_t, ldb, 2, int16_t) > > +DO_VLDR(vldrb_sw, MO_UB, 1, int8_t, ldb, 4, int32_t) > ... > > +DO_VLDR(vldrh_sw, MO_TEUW, 2, int16_t, ldw, 4, i

[PATCH v3 07/12] target/arm: Fix VSTR_SG helper store alignment checks

2025-07-02 Thread William Kosasih
This patch adds alignment checks in the store operations in the VSTR_SG instructions. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 30 +- 1 file changed, 17 insertions(+), 13 deletions

[PATCH v3 09/12] target/arm: Fix VLD2 helper load alignment checks

2025-07-02 Thread William Kosasih
This patch adds alignment checks in the load operations in the VLD2 instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target

[PATCH v3 11/12] target/arm: Fix VST2 helper store alignment checks

2025-07-02 Thread William Kosasih
This patch adds alignment checks in the store operations in the VST2 instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target

[PATCH v3 03/12] target/arm: Fix function_return helper load alignment checks

2025-07-02 Thread William Kosasih
This patch adds alignment checks in the load operations (when unstacking the return pc and psr) in the FunctionReturn pseudocode. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/m_helper.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v3 00/12] target/arm: Fix M-profile helper loads/stores alignment checks

2025-07-02 Thread William Kosasih
/-/issues/1154 Signed-off-by: William Kosasih William Kosasih (12): target/arm: Bring VLSTM/VLLDM helper store/load closer to the ARM pseudocode target/arm: Fix BLXNS helper store alignment checks target/arm: Fix function_return helper load alignment checks target/arm: Fix VLDR helper load

[PATCH v3 04/12] target/arm: Fix VLDR helper load alignment checks

2025-07-02 Thread William Kosasih
This patch adds alignment checks in the load operations in the VLDR instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff

[PATCH v3 05/12] target/arm: Fix VSTR helper store alignment checks

2025-07-02 Thread William Kosasih
This patch adds alignment checks in the store operations in the VSTR instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a

[PATCH v3 10/12] target/arm: Fix VST4 helper store alignment checks

2025-07-02 Thread William Kosasih
This patch adds alignment checks in the store operations in the VST4 instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target

[PATCH v3 08/12] target/arm: Fix VLD4 helper load alignment checks

2025-07-02 Thread William Kosasih
This patch adds alignment checks in the load operations in the VLD4 instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target

[PATCH v3 12/12] target/arm: Fix helper macros indentation in mve_helper.c

2025-07-02 Thread William Kosasih
Recent helper function load and store alignment fix caused the continuation backslashes in those macro definitions to shift out of alignment. This patch restores a uniform indentation for those trailing backslashes, making them consistent. Signed-off-by: William Kosasih --- target/arm/tcg

[PATCH v3 02/12] target/arm: Fix BLXNS helper store alignment checks

2025-07-02 Thread William Kosasih
This patch adds alignment checks in the store operations (when stacking the return pc and psr) in the BLXNS instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/m_helper.c | 7 +-- 1 file changed, 5 insertions(+), 2

[PATCH v3 06/12] target/arm: Fix VLDR_SG helper load alignment checks

2025-07-02 Thread William Kosasih
This patch adds alignment checks in the load operations in the VLDR_SG instructions. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 42 ++--- 1 file changed, 25 insertions(+), 17

[PATCH v3 01/12] target/arm: Bring VLSTM/VLLDM helper store/load closer to the ARM pseudocode

2025-07-02 Thread William Kosasih
redundant lookups Signed-off-by: William Kosasih --- target/arm/tcg/m_helper.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/target/arm/tcg/m_helper.c b/target/arm/tcg/m_helper.c index 6614719832..251e12edf9 100644 --- a/target/arm/tcg/m_helper.c

Re: [PATCH v2 04/12] target/arm: Fix VLDR helper load alignment checks

2025-07-02 Thread William Kosasih
atches your intent -- but please let me know if you’d prefer a different approach, I'm happy to fix them again. Sorry for the back-and-forth, and thanks again for your guidance. Best regards, William On Wed, Jul 2, 2025 at 11:59 AM Richard Henderson < richard.hender...@linaro.org>

[PATCH v2 11/12] target/arm: Fix VST2 helper store alignment checks

2025-07-01 Thread William Kosasih
This patch adds alignment checks in the store operations in the VST2 instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target

[PATCH v2 06/12] target/arm: Fix VLDR_SG helper load alignment checks

2025-07-01 Thread William Kosasih
This patch adds alignment checks in the load operations in the VLDR_SG instructions. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 41 ++--- 1 file changed, 24 insertions(+), 17

[PATCH v2 07/12] target/arm: Fix VSTR_SG helper store alignment checks

2025-07-01 Thread William Kosasih
This patch adds alignment checks in the store operations in the VSTR_SG instructions. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 28 1 file changed, 16 insertions(+), 12 deletions

[PATCH v2 08/12] target/arm: Fix VLD4 helper load alignment checks

2025-07-01 Thread William Kosasih
This patch adds alignment checks in the load operations in the VLD4 instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target

[PATCH v2 10/12] target/arm: Fix VST4 helper store alignment checks

2025-07-01 Thread William Kosasih
This patch adds alignment checks in the store operations in the VST4 instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target

[PATCH v2 02/12] target/arm: Fix BLXNS helper store alignment checks

2025-07-01 Thread William Kosasih
This patch adds alignment checks in the store operations (when stacking the return pc and psr) in the BLXNS instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/m_helper.c | 7 +-- 1 file changed, 5 insertions(+), 2

[PATCH v2 09/12] target/arm: Fix VLD2 helper load alignment checks

2025-07-01 Thread William Kosasih
This patch adds alignment checks in the load operations in the VLD2 instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target

[PATCH v2 01/12] target/arm: Fix VLSTM/VLLDM helper load/store alignment checks

2025-07-01 Thread William Kosasih
loads/stores). References to cpu_*_data_* are still replaced with cpu_*_mmu(), so that the individual word accesses themselves also perform the standard alignment checks, in keeping with the ARM pseudocode. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih

[PATCH v2 12/12] target/arm: Fix helper macros indentation in mve_helper.c

2025-07-01 Thread William Kosasih
Recent helper function load and store alignment fix caused the continuation backslashes in those macro definitions to shift out of alignment. This patch restores a uniform indentation for those trailing backslashes, making them consistent. Signed-off-by: William Kosasih --- target/arm/tcg

[PATCH v2 04/12] target/arm: Fix VLDR helper load alignment checks

2025-07-01 Thread William Kosasih
This patch adds alignment checks in the load operations in the VLDR instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 41 - 1 file changed, 31 insertions(+), 10 deletions

[PATCH v2 05/12] target/arm: Fix VSTR helper store alignment checks

2025-07-01 Thread William Kosasih
This patch adds alignment checks in the store operations in the VSTR instruction. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/mve_helper.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a

[PATCH v2 03/12] target/arm: Fix function_return helper load alignment checks

2025-07-01 Thread William Kosasih
This patch adds alignment checks in the load operations (when unstacking the return pc and psr) in the FunctionReturn pseudocode. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 Signed-off-by: William Kosasih --- target/arm/tcg/m_helper.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v2 00/12] target/arm: Fix M-profile helper loads/stores alignment checks

2025-07-01 Thread William Kosasih
/-/issues/1154 Signed-off-by: William Kosasih William Kosasih (12): target/arm: Fix VLSTM/VLLDM helper load/store alignment checks target/arm: Fix BLXNS helper store alignment checks target/arm: Fix function_return helper load alignment checks target/arm: Fix VLDR helper load alignment checks

Re: [PATCH] target/arm: Fix M-profile helper loads/stores alignment checks

2025-07-01 Thread William Kosasih
Hi Peter, really appreciate your feedback, thank you so much. I'll split the patch into smaller series as you suggested, and keep changes to bare minimum for this fix. I'll create another patch for the refactoring of the helper macros indentation. Cheers, William On Tue, Jul 1, 2025

[PATCH] target/arm: Fix M-profile helper loads/stores alignment checks

2025-06-25 Thread William Kosasih
-based loads and stores will now correctly honor their alignment requirements. Signed-off-by: William Kosasih Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1154 --- target/arm/tcg/m_helper.c | 33 +-- target/arm/tcg/mve_helper.c | 408 2 files changed

[PATCH] ui/curses: Fix infinite loop on windows

2025-04-02 Thread William Hu via
>From a42046272f0544dd18ed58661e53ea17d1584c2c Mon Sep 17 00:00:00 2001 From: William Hu Date: Wed, 2 Apr 2025 12:00:00 -0400 Subject: [PATCH] ui/curses: Fix infinite loop on windows Replace -1 comparisons for wint_t with WEOF to fix infinite loop caused by a 65535 == -1 comparison. Resol

Re: [PATCH v8 0/3] Poisoned memory recovery on reboot

2025-02-13 Thread William Roche
On 2/11/25 23:35, Peter Xu wrote: On Tue, Feb 11, 2025 at 09:27:04PM +, “William Roche wrote: From: William Roche Here is a very simplified version of my fix only dealing with the recovery of huge pages on VM reset. --- This set of patches fixes an existing bug with hardware memory

[PATCH v8 0/3] Poisoned memory recovery on reboot

2025-02-11 Thread William Roche
From: William Roche Here is a very simplified version of my fix only dealing with the recovery of huge pages on VM reset. --- This set of patches fixes an existing bug with hardware memory errors impacting hugetlbfs memory backed VMs and its recovery on VM reset. When using hugetlbfs large

[PATCH v8 1/3] system/physmem: handle hugetlb correctly in qemu_ram_remap()

2025-02-11 Thread William Roche
From: William Roche The list of hwpoison pages used to remap the memory on reset is based on the backend real page size. To correctly handle hugetlb, we must mmap(MAP_FIXED) a complete hugetlb page; hugetlb pages cannot be partially mapped. Signed-off-by: William Roche Co-developed-by: David

[PATCH v8 3/3] target/arm/kvm: Report memory errors injection

2025-02-11 Thread William Roche
From: William Roche Generate an x86 similar error injection message on ras enabled ARM platforms. ARM qemu only deals with action required memory errors signaled with SIGBUS/BUS_MCEERR_AR, and will report a message on every memory error relayed to the VM. A message like: Guest Memory Error at

[PATCH v8 2/3] system/physmem: poisoned memory discard on reboot

2025-02-11 Thread William Roche
From: William Roche Repair poisoned memory location(s), calling ram_block_discard_range(): punching a hole in the backend file when necessary and regenerating a usable memory. If the kernel doesn't support the madvise calls used by this function and we are dealing with anonymous memory,

Re: [PATCH v7 3/6] accel/kvm: Report the loss of a large memory page

2025-02-11 Thread William Roche
On 2/10/25 17:48, Peter Xu wrote: On Fri, Feb 07, 2025 at 07:02:22PM +0100, William Roche wrote: [...] So the main reason is a KVM "weakness" with kvm_send_hwpoison_signal(), and the second reason is to have richer error messages. This seems true, and I also remember something whe

Re: [PATCH v7 3/6] accel/kvm: Report the loss of a large memory page

2025-02-07 Thread William Roche
On 2/5/25 18:07, Peter Xu wrote: On Wed, Feb 05, 2025 at 05:27:13PM +0100, William Roche wrote: [...] The HMP command "info ramblock" is implemented with the ram_block_format() function which returns a message buffer built with a string for each ramblock (protected by the RCU_READ_

Re: [PATCH v7 3/6] accel/kvm: Report the loss of a large memory page

2025-02-05 Thread William Roche
On 2/4/25 18:01, Peter Xu wrote: On Sat, Feb 01, 2025 at 09:57:23AM +, “William Roche wrote: From: William Roche In case of a large page impacted by a memory error, provide an information about the impacted large page before the memory error injection message. This message would also

Re: [PATCH v7 6/6] hostmem: Handle remapping of RAM

2025-02-05 Thread William Roche
'll remember. Said that, this still sounds like a per-ramblock thing, so instead of one hook function we can also have per-ramblock notifier lists. But I agree the perf issue isn't some immediate concern, so I'll leave that to you and William. If so I think we should discuss that

Re: [PATCH v7 2/6] system/physmem: poisoned memory discard on reboot

2025-02-05 Thread William Roche
On 2/4/25 18:09, Peter Xu wrote: On Sat, Feb 01, 2025 at 09:57:22AM +, “William Roche wrote: From: William Roche Repair poisoned memory location(s), calling ram_block_discard_range(): punching a hole in the backend file when necessary and regenerating a usable memory. If the kernel

[PATCH v7 4/6] numa: Introduce and use ram_block_notify_remap()

2025-02-01 Thread William Roche
From: David Hildenbrand Notify registered listeners about the remap at the end of qemu_ram_remap() so e.g., a memory backend can re-apply its settings correctly. Signed-off-by: David Hildenbrand Signed-off-by: William Roche --- hw/core/numa.c | 11 +++ include/exec/ramlist.h

[PATCH v7 6/6] hostmem: Handle remapping of RAM

2025-02-01 Thread William Roche
From: William Roche Let's register a RAM block notifier and react on remap notifications. Simply re-apply the settings. Exit if something goes wrong. Merging and dump settings are handled by the remap notification in addition to memory policy and preallocation. Co-developed-by:

[PATCH v7 1/6] system/physmem: handle hugetlb correctly in qemu_ram_remap()

2025-02-01 Thread William Roche
From: William Roche The list of hwpoison pages used to remap the memory on reset is based on the backend real page size. To correctly handle hugetlb, we must mmap(MAP_FIXED) a complete hugetlb page; hugetlb pages cannot be partially mapped. Signed-off-by: William Roche Co-developed-by: David

[PATCH v7 3/6] accel/kvm: Report the loss of a large memory page

2025-02-01 Thread William Roche
From: William Roche In case of a large page impacted by a memory error, provide an information about the impacted large page before the memory error injection message. This message would also appear on ras enabled ARM platforms, with the introduction of an x86 similar error injection message

[PATCH v7 0/6] Poisoned memory recovery on reboot

2025-02-01 Thread William Roche
From: William Roche Hello David, Here is the version with the small nits corrected. And the 'Acked-by' entries you gave me for patch 1 and 2. --- This set of patches fixes several problems with hardware memory errors impacting hugetlbfs memory backed VMs and the generic memory reco

[PATCH v7 5/6] hostmem: Factor out applying settings

2025-02-01 Thread William Roche
From: David Hildenbrand We want to reuse the functionality when remapping RAM. Signed-off-by: David Hildenbrand Signed-off-by: William Roche --- backends/hostmem.c | 155 - 1 file changed, 82 insertions(+), 73 deletions(-) diff --git a/backends

[PATCH v7 2/6] system/physmem: poisoned memory discard on reboot

2025-02-01 Thread William Roche
From: William Roche Repair poisoned memory location(s), calling ram_block_discard_range(): punching a hole in the backend file when necessary and regenerating a usable memory. If the kernel doesn't support the madvise calls used by this function and we are dealing with anonymous memory,

Re: [PATCH v6 3/6] accel/kvm: Report the loss of a large memory page

2025-02-01 Thread William Roche
On 1/30/25 18:02, David Hildenbrand wrote: On 27.01.25 22:31, “William Roche wrote: From: William Roche In case of a large page impacted by a memory error, provide an information about the impacted large page before the memory error injection message. This message would also appear on ras

[PATCH v6 6/6] hostmem: Handle remapping of RAM

2025-01-27 Thread William Roche
From: William Roche Let's register a RAM block notifier and react on remap notifications. Simply re-apply the settings. Exit if something goes wrong. Merging and dump settings are handled by the remap notification in addition to memory policy and preallocation. Co-developed-by:

[PATCH v6 4/6] numa: Introduce and use ram_block_notify_remap()

2025-01-27 Thread William Roche
From: David Hildenbrand Notify registered listeners about the remap at the end of qemu_ram_remap() so e.g., a memory backend can re-apply its settings correctly. Signed-off-by: David Hildenbrand Signed-off-by: William Roche --- hw/core/numa.c | 11 +++ include/exec/ramlist.h

[PATCH v6 3/6] accel/kvm: Report the loss of a large memory page

2025-01-27 Thread William Roche
From: William Roche In case of a large page impacted by a memory error, provide an information about the impacted large page before the memory error injection message. This message would also appear on ras enabled ARM platforms, with the introduction of an x86 similar error injection message

[PATCH v6 5/6] hostmem: Factor out applying settings

2025-01-27 Thread William Roche
From: David Hildenbrand We want to reuse the functionality when remapping RAM. Signed-off-by: David Hildenbrand Signed-off-by: William Roche --- backends/hostmem.c | 155 - 1 file changed, 82 insertions(+), 73 deletions(-) diff --git a/backends

[PATCH v6 2/6] system/physmem: poisoned memory discard on reboot

2025-01-27 Thread William Roche
From: William Roche Repair poisoned memory location(s), calling ram_block_discard_range(): punching a hole in the backend file when necessary and regenerating a usable memory. If the kernel doesn't support the madvise calls used by this function and we are dealing with anonymous memory,

[PATCH v6 1/6] system/physmem: handle hugetlb correctly in qemu_ram_remap()

2025-01-27 Thread William Roche
From: William Roche The list of hwpoison pages used to remap the memory on reset is based on the backend real page size. To correctly handle hugetlb, we must mmap(MAP_FIXED) a complete hugetlb page; hugetlb pages cannot be partially mapped. Co-developed-by: David Hildenbrand Signed-off-by

[PATCH v6 0/6] Poisoned memory recovery on reboot

2025-01-27 Thread William Roche
From: William Roche Hello David, I'm back on this topic. --- This set of patches fixes several problems with hardware memory errors impacting hugetlbfs memory backed VMs and the generic memory recovery on VM reset. When using hugetlbfs large pages, any large page location being impacted

Re: [PATCH v5 6/6] hostmem: Handle remapping of RAM

2025-01-27 Thread William Roche
On 1/14/25 15:11, David Hildenbrand wrote: On 10.01.25 22:14, “William Roche wrote: From: David Hildenbrand You can make yourself the author and just make me a Co-developed-by here. LGTM! Ok done. Thanks.

Re: [PATCH v5 0/6] Poisoned memory recovery on reboot

2025-01-27 Thread William Roche
On 1/14/25 15:12, David Hildenbrand wrote: On 10.01.25 22:13, “William Roche wrote: From: William Roche Hello David, I'm keeping the description of the patch set you already reviewed: Hi, one request, can you send it out next time (v6) *not* as reply to the previous thread, but just

Re: [PATCH v5 3/6] accel/kvm: Report the loss of a large memory page

2025-01-27 Thread William Roche
On 1/14/25 15:09, David Hildenbrand wrote: On 10.01.25 22:14, “William Roche wrote: From: William Roche In case of a large page impacted by a memory error, enhance the existing Qemu error message which indicates that the error is injected in the VM, adding "on lost large page SIZE

Re: [PATCH v5 2/6] system/physmem: poisoned memory discard on reboot

2025-01-27 Thread William Roche
On 1/14/25 15:07, David Hildenbrand wrote: On 10.01.25 22:14, “William Roche wrote: From: William Roche Repair poisoned memory location(s), calling ram_block_discard_range(): punching a hole in the backend file when necessary and regenerating a usable memory. If the kernel doesn't suppor

Re: [PATCH v4 2/7] system/physmem: poisoned memory discard on reboot

2025-01-27 Thread William Roche
On 1/14/25 15:00, David Hildenbrand wrote: If we can get the current set of fixes integrated, I'll submit another fix proposal to take the fd_offset into account in a second time. (Not enlarging the current set) But here is what I'm thinking about. That we can discuss later if you want: @@ -3

Re: [PATCH v5 1/6] system/physmem: handle hugetlb correctly in qemu_ram_remap()

2025-01-27 Thread William Roche
On 1/14/25 15:02, David Hildenbrand wrote: On 10.01.25 22:14, “William Roche wrote: From: William Roche The list of hwpoison pages used to remap the memory on reset is based on the backend real page size. When dealing with hugepages, we create a single entry for the entire page. To correctly

[PATCH v3 0/1] fallocate missing fd_offset

2025-01-22 Thread William Roche
From: William Roche Working on the poisoned memory recovery mechanisms with David Hildenbrand, it appeared that the file hole punching done with the memory discard functions are missing the file offset value fd_offset to correctly modify the right file location. Note that guest_memfd would not

[PATCH v3 1/1] system/physmem: take into account fd_offset for file fallocate

2025-01-22 Thread William Roche
From: William Roche Punching a hole in a file with fallocate needs to take into account the fd_offset value for a correct file location. But guest_memfd internal use doesn't currently consider fd_offset. Fixes: 4b870dc4d0c0 ("hostmem-file: add offset option") Signed-off-by

Re: [PATCH v2 1/1] system/physmem: take into account fd_offset for file fallocate

2025-01-22 Thread William Roche
On 1/22/25 09:01, David Hildenbrand wrote: On 21.01.25 23:54, “William Roche wrote: From: William Roche [...] --- a/system/physmem.c +++ b/system/physmem.c @@ -3655,6 +3655,7 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t start, size_t length)   need_madvise = (rb->page_s

[PATCH v2 1/1] system/physmem: take into account fd_offset for file fallocate

2025-01-21 Thread William Roche
From: William Roche Punching a hole in a file with fallocate needs to take into account the fd_offset value for a correct file location. But guest_memfd internal use doesn't currently consider fd_offset. Fixes: 4b870dc4d0c0 ("hostmem-file: add offset option") Signed-off-by

[PATCH v2 0/1] fallocate missing fd_offset

2025-01-21 Thread William Roche
From: William Roche Working on the poisoned memory recovery mechanisms with David Hildenbrand, it appeared that the file hole punching done with the memory discard functions are missing the file offset value fd_offset to correctly modify the right file location. Note that guest_memfd would not

Re: [PATCH 1/1] system/physmem: take into account fd_offset for file fallocate

2025-01-21 Thread William Roche
Thank you Peter and David for your feedback. On 1/21/25 19:25, David Hildenbrand wrote: On 21.01.25 19:17, Peter Xu wrote: On Tue, Jan 21, 2025 at 05:59:56PM +, “William Roche wrote: From: William Roche Punching a hole in a file with fallocate needs to take into account the fd_offset

[PATCH 1/1] system/physmem: take into account fd_offset for file fallocate

2025-01-21 Thread William Roche
From: William Roche Punching a hole in a file with fallocate needs to take into account the fd_offset value for a correct file location. Fixes: 4b870dc4d0c0 ("hostmem-file: add offset option") Signed-off-by: William Roche --- system/physmem.c | 14 -- 1 file changed, 8

[PATCH 0/1] fallocate missing fd_offset

2025-01-21 Thread William Roche
From: William Roche Working on the poisoned memory recovery mechanisms with David Hildenbrand, it appeared that the file hole punching done with the memory discard functions are missing the file offset value fd_offset to correctly modify the right file location. I'm not sure that guest_

[PATCH v5 6/6] hostmem: Handle remapping of RAM

2025-01-10 Thread William Roche
David Hildenbrand Signed-off-by: William Roche --- backends/hostmem.c | 34 ++ include/system/hostmem.h | 1 + system/physmem.c | 4 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index 46d80

[PATCH v5 4/6] numa: Introduce and use ram_block_notify_remap()

2025-01-10 Thread William Roche
From: David Hildenbrand Notify registered listeners about the remap at the end of qemu_ram_remap() so e.g., a memory backend can re-apply its settings correctly. Signed-off-by: David Hildenbrand Signed-off-by: William Roche --- hw/core/numa.c | 11 +++ include/exec/ramlist.h

[PATCH v5 3/6] accel/kvm: Report the loss of a large memory page

2025-01-10 Thread William Roche
From: William Roche In case of a large page impacted by a memory error, enhance the existing Qemu error message which indicates that the error is injected in the VM, adding "on lost large page SIZE@ADDR". Include also a similar message to the ARM platform. In the case of a large pag

[PATCH v5 5/6] hostmem: Factor out applying settings

2025-01-10 Thread William Roche
From: David Hildenbrand We want to reuse the functionality when remapping RAM. Signed-off-by: David Hildenbrand Signed-off-by: William Roche --- backends/hostmem.c | 155 - 1 file changed, 82 insertions(+), 73 deletions(-) diff --git a/backends

[PATCH v5 2/6] system/physmem: poisoned memory discard on reboot

2025-01-10 Thread William Roche
From: William Roche Repair poisoned memory location(s), calling ram_block_discard_range(): punching a hole in the backend file when necessary and regenerating a usable memory. If the kernel doesn't support the madvise calls used by this function and we are dealing with anonymous memory,

[PATCH v5 0/6] Poisoned memory recovery on reboot

2025-01-10 Thread William Roche
From: William Roche Hello David, I'm keeping the description of the patch set you already reviewed: --- This set of patches fixes several problems with hardware memory errors impacting hugetlbfs memory backed VMs and the generic memory recovery on VM reset. When using hugetlbfs large

[PATCH v5 1/6] system/physmem: handle hugetlb correctly in qemu_ram_remap()

2025-01-10 Thread William Roche
From: William Roche The list of hwpoison pages used to remap the memory on reset is based on the backend real page size. When dealing with hugepages, we create a single entry for the entire page. To correctly handle hugetlb, we must mmap(MAP_FIXED) a complete hugetlb page; hugetlb pages cannot

Re: [PATCH v4 1/7] hwpoison_page_list and qemu_ram_remap are based on pages

2025-01-10 Thread William Roche
On 1/8/25 22:34, David Hildenbrand wrote: On 14.12.24 14:45, “William Roche wrote: From: William Roche Subject should likely start with "system/physmem:". Maybe "system/physmem: handle hugetlb correctly in qemu_ram_remap()" I updated the commit title The list of

Re: [PATCH v4 5/7] hostmem: Factor out applying settings

2025-01-10 Thread William Roche
On 1/8/25 22:58, David Hildenbrand wrote: On 14.12.24 14:45, “William Roche wrote: From: David Hildenbrand We want to reuse the functionality when remapping or resizing RAM. We should drop the "or resizing of RAM." part, as that does no longer apply. Commit message corrected.

Re: [PATCH v4 7/7] system/physmem: Memory settings applied on remap notification

2025-01-10 Thread William Roche
On 1/8/25 22:53, David Hildenbrand wrote: On 14.12.24 14:45, “William Roche wrote: From: William Roche Merging and dump settings are handled by the remap notification in addition to memory policy and preallocation. Signed-off-by: William Roche ---   system/physmem.c | 2 --   1 file changed

Re: [PATCH v4 6/7] hostmem: Handle remapping of RAM

2025-01-10 Thread William Roche
On 1/8/25 22:51, David Hildenbrand wrote: On 14.12.24 14:45, “William Roche wrote: From: David Hildenbrand Let's register a RAM block notifier and react on remap notifications. Simply re-apply the settings. Exit if something goes wrong. Note: qemu_ram_remap() will not remap when RAM_PRE

Re: [PATCH v4 2/7] system/physmem: poisoned memory discard on reboot

2025-01-10 Thread William Roche
On 1/8/25 22:44, David Hildenbrand wrote: On 14.12.24 14:45, “William Roche wrote: +/* Try to simply remap the given location */ +static void qemu_ram_remap_mmap(RAMBlock *block, void* vaddr, size_t size, +    ram_addr_t offset) Can you make the parameters match

Re: [PATCH v4 0/7] Poisoned memory recovery on reboot

2025-01-10 Thread William Roche
On 1/8/25 22:22, David Hildenbrand wrote: On 14.12.24 14:45, “William Roche wrote: From: William Roche Hello David, Hi! Let me start reviewing today a bit (it's already late, and I'll continue tomorrow. Here is an new version of our code and an updated description of the

Ping (2): [PATCH v3] net/vmnet: Pad short Ethernet frames

2024-12-30 Thread William Hooper
On Sat, Nov 2, 2024 at 1:56 PM William Hooper wrote: > At least on macOS 12.7.2, vmnet doesn't pad Ethernet frames, such as the > host's ARP replies, to the minimum size (60 bytes before the frame check > sequence) defined in IEEE Std 802.3-2022, so guests' Ethernet device

[PATCH v4 7/7] system/physmem: Memory settings applied on remap notification

2024-12-14 Thread William Roche
From: William Roche Merging and dump settings are handled by the remap notification in addition to memory policy and preallocation. Signed-off-by: William Roche --- system/physmem.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/system/physmem.c b/system/physmem.c index 9fc74a5699

[PATCH v4 2/7] system/physmem: poisoned memory discard on reboot

2024-12-14 Thread William Roche
From: William Roche Repair poisoned memory location(s), calling ram_block_discard_range(): punching a hole in the backend file when necessary and regenerating a usable memory. If the kernel doesn't support the madvise calls used by this function and we are dealing with anonymous memory,

  1   2   3   4   >