The gpa_inside_migration_helper_shared_area will be used to skip migrating RAM pages that are used by the migration helper at the target.
Signed-off-by: Dov Murik <dovmu...@linux.vnet.ibm.com> --- migration/confidential-ram.h | 2 ++ migration/confidential-ram.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/migration/confidential-ram.h b/migration/confidential-ram.h index ebe4073bce..9a1027bdaf 100644 --- a/migration/confidential-ram.h +++ b/migration/confidential-ram.h @@ -8,6 +8,8 @@ #include "exec/cpu-common.h" #include "qemu-file.h" +bool gpa_inside_migration_helper_shared_area(ram_addr_t gpa); + void cgs_mh_init(void); void cgs_mh_cleanup(void); diff --git a/migration/confidential-ram.c b/migration/confidential-ram.c index fe317ee74b..0b821af774 100644 --- a/migration/confidential-ram.c +++ b/migration/confidential-ram.c @@ -68,6 +68,12 @@ static CGSMigHelperState cmhs = {0}; #define MH_SHARED_CMD_PARAMS_ADDR 0x820000 #define MH_SHARED_IO_PAGE_HDR_ADDR (MH_SHARED_CMD_PARAMS_ADDR + 0x800) #define MH_SHARED_IO_PAGE_ADDR (MH_SHARED_CMD_PARAMS_ADDR + 0x1000) +#define MH_SHARED_LAST_BYTE (MH_SHARED_CMD_PARAMS_ADDR + 0x1fff) + +bool gpa_inside_migration_helper_shared_area(ram_addr_t gpa) +{ + return gpa >= MH_SHARED_CMD_PARAMS_ADDR && gpa <= MH_SHARED_LAST_BYTE; +} void cgs_mh_init(void) { -- 2.20.1