[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250527144546.42981-1-kraxel@redhat.com>
Date: Tue, 27 May 2025 16:45:44 +0200
From: Gerd Hoffmann <kraxel@...hat.com>
To: 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,
"H. Peter Anvin" <hpa@...or.com>
Cc: kvm@...r.kernel.org,
linux-coco@...ts.linux.dev,
Gerd Hoffmann <kraxel@...hat.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] x86/sev/vc: fix efi runtime instruction emulation
In case efi_mm is active go use the userspace instruction decoder which
supports fetching instructions from active_mm. This is needed to make
instruction emulation work for EFI runtime code, so it can use cpuid
and rdmsr.
Signed-off-by: Gerd Hoffmann <kraxel@...hat.com>
---
arch/x86/coco/sev/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
index 36beaac713c1..145f594d7e6b 100644
--- a/arch/x86/coco/sev/core.c
+++ b/arch/x86/coco/sev/core.c
@@ -346,7 +346,7 @@ static enum es_result __vc_decode_kern_insn(struct es_em_ctxt *ctxt)
static enum es_result vc_decode_insn(struct es_em_ctxt *ctxt)
{
- if (user_mode(ctxt->regs))
+ if (user_mode(ctxt->regs) || current->active_mm == &efi_mm)
return __vc_decode_user_insn(ctxt);
else
return __vc_decode_kern_insn(ctxt);
--
2.49.0
Powered by blists - more mailing lists