* [PULL 0/1] Migration patches for 2025-03-27
@ 2025-03-27 18:53 Fabiano Rosas
2025-03-27 18:53 ` [PULL 1/1] migration: Avoid SNP guest crash due to duplicate cpr blocker Fabiano Rosas
2025-03-28 16:36 ` [PULL 0/1] Migration patches for 2025-03-27 Stefan Hajnoczi
0 siblings, 2 replies; 3+ messages in thread
From: Fabiano Rosas @ 2025-03-27 18:53 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Xu
The following changes since commit b876e721f1c939f3e83ac85bd3c1c2821e12b3fa:
Update version for v10.0.0-rc1 release (2025-03-25 13:58:14 -0400)
are available in the Git repository at:
https://gitlab.com/farosas/qemu.git tags/migration-20250327-pull-request
for you to fetch changes up to 694b5a913d03fd7233edf6961c54edac78684519:
migration: Avoid SNP guest crash due to duplicate cpr blocker (2025-03-27 15:29:42 -0300)
----------------------------------------------------------------
Migration pull request
Fix crash due to cpr migration blocker (affects SEV-SNP guest)
----------------------------------------------------------------
Steve Sistare (1):
migration: Avoid SNP guest crash due to duplicate cpr blocker
system/physmem.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
--
2.35.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PULL 1/1] migration: Avoid SNP guest crash due to duplicate cpr blocker
2025-03-27 18:53 [PULL 0/1] Migration patches for 2025-03-27 Fabiano Rosas
@ 2025-03-27 18:53 ` Fabiano Rosas
2025-03-28 16:36 ` [PULL 0/1] Migration patches for 2025-03-27 Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Fabiano Rosas @ 2025-03-27 18:53 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Xu, Steve Sistare, Tom Lendacky, Michael Roth
From: Steve Sistare <steven.sistare@oracle.com>
With aux-ram-share=off, booting an SNP guest fails with:
../util/error.c:68: error_setv: Assertion `*errp == NULL' failed.
This is because a CPR blocker for the guest_memfd ramblock is added
twice, once in ram_block_add_cpr_blocker because aux-ram-share=off so
rb->fd < 0, and once in ram_block_add for a specific guest_memfd blocker.
To fix, add the guest_memfd blocker iff a generic one would not be
added by ram_block_add_cpr_blocker.
Fixes: 094a3dbc55df ("migration: ram block cpr blockers")
Reported-by: Tom Lendacky <thomas.lendacky@amd.com>
Reported-by: Michael Roth <michael.roth@amd.com>
Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Message-ID: <1743087130-429075-1-git-send-email-steven.sistare@oracle.com>
[reword subject line]
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
system/physmem.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/system/physmem.c b/system/physmem.c
index e97de3ef65..333a5eb94d 100644
--- a/system/physmem.c
+++ b/system/physmem.c
@@ -158,6 +158,7 @@ static void io_mem_init(void);
static void memory_map_init(void);
static void tcg_log_global_after_sync(MemoryListener *listener);
static void tcg_commit(MemoryListener *listener);
+static bool ram_is_cpr_compatible(RAMBlock *rb);
/**
* CPUAddressSpace: all the information a CPU needs about an AddressSpace
@@ -1908,13 +1909,18 @@ static void ram_block_add(RAMBlock *new_block, Error **errp)
goto out_free;
}
- error_setg(&new_block->cpr_blocker,
- "Memory region %s uses guest_memfd, "
- "which is not supported with CPR.",
- memory_region_name(new_block->mr));
- migrate_add_blocker_modes(&new_block->cpr_blocker, errp,
- MIG_MODE_CPR_TRANSFER,
- -1);
+ /*
+ * Add a specific guest_memfd blocker if a generic one would not be
+ * added by ram_block_add_cpr_blocker.
+ */
+ if (ram_is_cpr_compatible(new_block)) {
+ error_setg(&new_block->cpr_blocker,
+ "Memory region %s uses guest_memfd, "
+ "which is not supported with CPR.",
+ memory_region_name(new_block->mr));
+ migrate_add_blocker_modes(&new_block->cpr_blocker, errp,
+ MIG_MODE_CPR_TRANSFER, -1);
+ }
}
ram_size = (new_block->offset + new_block->max_length) >> TARGET_PAGE_BITS;
--
2.35.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PULL 0/1] Migration patches for 2025-03-27
2025-03-27 18:53 [PULL 0/1] Migration patches for 2025-03-27 Fabiano Rosas
2025-03-27 18:53 ` [PULL 1/1] migration: Avoid SNP guest crash due to duplicate cpr blocker Fabiano Rosas
@ 2025-03-28 16:36 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2025-03-28 16:36 UTC (permalink / raw)
To: Fabiano Rosas; +Cc: qemu-devel, Peter Xu
[-- Attachment #1: Type: text/plain, Size: 116 bytes --]
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-28 19:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-27 18:53 [PULL 0/1] Migration patches for 2025-03-27 Fabiano Rosas
2025-03-27 18:53 ` [PULL 1/1] migration: Avoid SNP guest crash due to duplicate cpr blocker Fabiano Rosas
2025-03-28 16:36 ` [PULL 0/1] Migration patches for 2025-03-27 Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).