[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250626114014.373748-3-kraxel@redhat.com>
Date: Thu, 26 Jun 2025 13:40:12 +0200
From: Gerd Hoffmann <kraxel@...hat.com>
To: linux-coco@...ts.linux.dev,
kvm@...r.kernel.org
Cc: Gerd Hoffmann <kraxel@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
"H. Peter Anvin" <hpa@...or.com>,
linux-kernel@...r.kernel.org (open list:X86 ARCHITECTURE (32-BIT AND 64-BIT))
Subject: [PATCH v4 2/3] x86/sev: fix error handling in sev_es_efi_map_ghcbs_caas()
Pass up error codes from kernel_map_pages_in_pgd() instead of
returning '1' on failure.
Signed-off-by: Gerd Hoffmann <kraxel@...hat.com>
---
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
Powered by blists - more mailing lists