On 12/9/2024 2:54 PM, Peter Xu wrote:
On Mon, Dec 02, 2024 at 05:19:56AM -0800, Steve Sistare wrote:
diff --git a/system/physmem.c b/system/physmem.c
index 36f0811..0bcb2cc 100644
--- a/system/physmem.c
+++ b/system/physmem.c
@@ -2164,6 +2164,9 @@ RAMBlock *qemu_ram_alloc_internal(ram_addr_t size,
ram_addr_t max_size,
new_block->flags = ram_flags;
if (!host && !xen_enabled()) {
+ if (!share_flags && current_machine->aux_ram_share) {
+ new_block->flags |= RAM_SHARED;
+ }
Just to mention that if you agree with what I said in patch 2, here it will
need some trivial rebase change. IOW, IMO we shouldn't special case xen
either here, so it should also apply to xen if one chose to, changing aux
alloc to RAM_SHARED.
OK.
So, if this only requires a trivial change, do I get your RB?
- Steve
Frankly I don't know whether xen respects RAM_SHARED at all for anonymous,
but it's a separate question to ask..
Basically what will happen later is in cpr-transfer migrate cmd, it'll fail
for xen properly seeing fd==-1. That'll be fine, IMHO.
if ((new_block->flags & RAM_SHARED) &&
!qemu_ram_alloc_shared(new_block, &local_err)) {
goto err;