[PATCH v4 2/3] x86/sev: fix error handling in sev_es_efi_map_ghcbs_caas()
From: Gerd Hoffmann
Date: Thu Jun 26 2025 - 07:40:45 EST
Pass up error codes from kernel_map_pages_in_pgd() instead of
returning '1' on failure.
Signed-off-by: Gerd Hoffmann <kraxel@xxxxxxxxxx>
---
arch/x86/coco/sev/core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
index b6db4e0b936b..3de8c3d2b55d 100644
--- a/arch/x86/coco/sev/core.c
+++ b/arch/x86/coco/sev/core.c
@@ -1050,6 +1050,7 @@ int __init sev_es_efi_map_ghcbs(pgd_t *pgd)
{
struct sev_es_runtime_data *data;
unsigned long address, pflags;
+ int retval;
int cpu;
u64 pfn;
@@ -1064,8 +1065,9 @@ int __init sev_es_efi_map_ghcbs(pgd_t *pgd)
address = __pa(&data->ghcb_page);
pfn = address >> PAGE_SHIFT;
- if (kernel_map_pages_in_pgd(pgd, pfn, address, 1, pflags))
- return 1;
+ retval = kernel_map_pages_in_pgd(pgd, pfn, address, 1, pflags);
+ if (retval != 0)
+ return retval;
}
return 0;
--
2.50.0