On 2/4/25 18:09, Peter Xu wrote:
On Sat, Feb 01, 2025 at 09:57:22AM +0000, “William Roche wrote:
From: William Roche <william.roche@xxxxxxxxxx>
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, fall back to remapping the
location(s).
Signed-off-by: William Roche <william.roche@xxxxxxxxxx>
Acked-by: David Hildenbrand <david@xxxxxxxxxx>
---
system/physmem.c | 58 ++++++++++++++++++++++++++++++------------------
1 file changed, 36 insertions(+), 22 deletions(-)
diff --git a/system/physmem.c b/system/physmem.c
index 3dd2adde73..e8ff930bc9 100644
--- a/system/physmem.c
+++ b/system/physmem.c
...
/*
* qemu_ram_remap - remap a single RAM page
*
@@ -2184,9 +2201,7 @@ void qemu_ram_remap(ram_addr_t addr)
{
RAMBlock *block;
uint64_t offset;
- int flags;
- void *area, *vaddr;
- int prot;
+ void *vaddr;
size_t page_size;
RAMBLOCK_FOREACH(block) {
@@ -2201,25 +2216,24 @@ void qemu_ram_remap(ram_addr_t addr)
;
} else if (xen_enabled()) {
abort();
- } else {
Do we need to keep this line? Otherwise it looks to me the new code won't
be executed at all in !xen..
Very true, this is a mistake I made in a very recent version - sorry!
I'll fix it with my next version.
Thanks.