Skip to content

Commit f5300db

Browse files
committed
Merge tag 'migration-20250327-pull-request' of https://gitlab.com/farosas/qemu into staging
Migration pull request Fix crash due to cpr migration blocker (affects SEV-SNP guest) # -----BEGIN PGP SIGNATURE----- # # iQJEBAABCAAuFiEEqhtIsKIjJqWkw2TPx5jcdBvsMZ0FAmflnA4QHGZhcm9zYXNA # c3VzZS5kZQAKCRDHmNx0G+wxnToTEACblWuLFBjnjJNZoW1f4LT27cT8s98huolA # audigd4xqYQEya1VTiyYckeJKeGp/aC7A4YkjrsFNCwknmIpzqGh4bhRdezerM16 # hlv/mfD9GGDYBS5jMXs8pMo442Lpn7/q78UUflfZwi+ad+XE4xdHkbh0i/GYuuj/ # Z4E2F62tboUfJ0RGeDcV/xjiaxnWkru2x9fMX5BCEez2Jj0Axk80W2lcfcu6tZL4 # s/uEmc235B5f6JtoIVdnr4IllenaukzBt+vPSD+QwweiPwLDTZ+IjBk/Q8Dh4jb8 # Q6E1Paf7ZfeHRlRM1XqZgRACPBQ/gTeCslbCDxjQgCfiS4dL70rdbTSpWOQyYUc3 # DYtqGnJO6t0dHFcH2m2envYT5u5cN+S80yVU+hA4LjefJ1cCu2IWiHwMF5EIYfO4 # eE9CNPALW09mi8OkPNsXRiplLZekIjQPV7znmLh82GWWaTa2GpJYZhD5jhUmyRex # jvdrsLBK1dLgv5PjMMhO6cQobgZQaxbzHMGW+IvobEZ2jjGCNTCZ2/YfXQOGcPcs # pN5Q+8U5IvmhVCTiN7kVRL6TThwT2KqAdWA/UXi5lLQiTHTrEEVJip6JWLJs4zmf # q3g9VIhr8x7Room6TKex6pkeO/7OqSik/pjOvjVCE6RGfi6yNd9a3KLfvCePDjdN # kLWoyan8eQ== # =fZ+v # -----END PGP SIGNATURE----- # gpg: Signature made Thu 27 Mar 2025 14:42:22 EDT # gpg: using RSA key AA1B48B0A22326A5A4C364CFC798DC741BEC319D # gpg: issuer "[email protected]" # gpg: Good signature from "Fabiano Rosas <[email protected]>" [unknown] # gpg: aka "Fabiano Almeida Rosas <[email protected]>" [unknown] # gpg: WARNING: The key's User ID is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: AA1B 48B0 A223 26A5 A4C3 64CF C798 DC74 1BEC 319D * tag 'migration-20250327-pull-request' of https://gitlab.com/farosas/qemu: migration: Avoid SNP guest crash due to duplicate cpr blocker Signed-off-by: Stefan Hajnoczi <[email protected]>
2 parents 3a0ff62 + 694b5a9 commit f5300db

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

system/physmem.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ static void io_mem_init(void);
158158
static void memory_map_init(void);
159159
static void tcg_log_global_after_sync(MemoryListener *listener);
160160
static void tcg_commit(MemoryListener *listener);
161+
static bool ram_is_cpr_compatible(RAMBlock *rb);
161162

162163
/**
163164
* CPUAddressSpace: all the information a CPU needs about an AddressSpace
@@ -1908,13 +1909,18 @@ static void ram_block_add(RAMBlock *new_block, Error **errp)
19081909
goto out_free;
19091910
}
19101911

1911-
error_setg(&new_block->cpr_blocker,
1912-
"Memory region %s uses guest_memfd, "
1913-
"which is not supported with CPR.",
1914-
memory_region_name(new_block->mr));
1915-
migrate_add_blocker_modes(&new_block->cpr_blocker, errp,
1916-
MIG_MODE_CPR_TRANSFER,
1917-
-1);
1912+
/*
1913+
* Add a specific guest_memfd blocker if a generic one would not be
1914+
* added by ram_block_add_cpr_blocker.
1915+
*/
1916+
if (ram_is_cpr_compatible(new_block)) {
1917+
error_setg(&new_block->cpr_blocker,
1918+
"Memory region %s uses guest_memfd, "
1919+
"which is not supported with CPR.",
1920+
memory_region_name(new_block->mr));
1921+
migrate_add_blocker_modes(&new_block->cpr_blocker, errp,
1922+
MIG_MODE_CPR_TRANSFER, -1);
1923+
}
19181924
}
19191925

19201926
ram_size = (new_block->offset + new_block->max_length) >> TARGET_PAGE_BITS;

0 commit comments

Comments
 (0)