From: Gerd Hoffmann <kraxel@redhat.com>
To: linux-coco@lists.linux.dev, kvm@vger.kernel.org
Cc: Gerd Hoffmann <kraxel@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
"H. Peter Anvin" <hpa@zytor.com>,
linux-kernel@vger.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()
Date: Thu, 26 Jun 2025 13:40:12 +0200 [thread overview]
Message-ID: <20250626114014.373748-3-kraxel@redhat.com> (raw)
In-Reply-To: <20250626114014.373748-1-kraxel@redhat.com>
Pass up error codes from kernel_map_pages_in_pgd() instead of
returning '1' on failure.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.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
next prev parent reply other threads:[~2025-06-26 11:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-26 11:40 [PATCH v4 0/3] x86/sev: improve efi runtime code support Gerd Hoffmann
2025-06-26 11:40 ` [PATCH v4 1/3] x86/sev/vc: fix efi runtime instruction emulation Gerd Hoffmann
2025-06-27 8:33 ` Gupta, Pankaj
2025-06-26 11:40 ` Gerd Hoffmann [this message]
2025-06-27 12:01 ` [PATCH v4 2/3] x86/sev: fix error handling in sev_es_efi_map_ghcbs_caas() Borislav Petkov
2025-06-26 11:40 ` [PATCH v4 3/3] x86/sev: Let sev_es_efi_map_ghcbs() map the caa pages too Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250626114014.373748-3-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).