This is a note to let you know that I've just added the patch titled x86/sev-es: Correctly track IRQ states in runtime #VC handler to the 5.11-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: x86-sev-es-correctly-track-irq-states-in-runtime-vc-handler.patch and it can be found in the queue-5.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 62441a1fb53263bda349b6e5997c3cc5c120d89e Mon Sep 17 00:00:00 2001 From: Joerg Roedel <jroedel@xxxxxxx> Date: Wed, 3 Mar 2021 15:17:15 +0100 Subject: x86/sev-es: Correctly track IRQ states in runtime #VC handler From: Joerg Roedel <jroedel@xxxxxxx> commit 62441a1fb53263bda349b6e5997c3cc5c120d89e upstream. Call irqentry_nmi_enter()/irqentry_nmi_exit() in the #VC handler to correctly track the IRQ state during its execution. Fixes: 0786138c78e79 ("x86/sev-es: Add a Runtime #VC Exception Handler") Reported-by: Andy Lutomirski <luto@xxxxxxxxxx> Signed-off-by: Joerg Roedel <jroedel@xxxxxxx> Signed-off-by: Borislav Petkov <bp@xxxxxxx> Cc: stable@xxxxxxxxxxxxxxx # v5.10+ Link: https://lkml.kernel.org/r/20210303141716.29223-5-joro@xxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/x86/kernel/sev-es.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/arch/x86/kernel/sev-es.c +++ b/arch/x86/kernel/sev-es.c @@ -1258,13 +1258,12 @@ static __always_inline bool on_vc_fallba DEFINE_IDTENTRY_VC_SAFE_STACK(exc_vmm_communication) { struct sev_es_runtime_data *data = this_cpu_read(runtime_data); + irqentry_state_t irq_state; struct ghcb_state state; struct es_em_ctxt ctxt; enum es_result result; struct ghcb *ghcb; - lockdep_assert_irqs_disabled(); - /* * Handle #DB before calling into !noinstr code to avoid recursive #DB. */ @@ -1273,6 +1272,8 @@ DEFINE_IDTENTRY_VC_SAFE_STACK(exc_vmm_co return; } + irq_state = irqentry_nmi_enter(regs); + lockdep_assert_irqs_disabled(); instrumentation_begin(); /* @@ -1335,6 +1336,7 @@ DEFINE_IDTENTRY_VC_SAFE_STACK(exc_vmm_co out: instrumentation_end(); + irqentry_nmi_exit(regs, irq_state); return; Patches currently in stable-queue which might be from jroedel@xxxxxxx are queue-5.11/iommu-vt-d-clear-prq-overflow-only-when-prq-is-empty.patch queue-5.11/x86-sev-es-check-regs-sp-is-trusted-before-adjusting-vc-ist-stack.patch queue-5.11/iommu-amd-fix-performance-counter-initialization.patch queue-5.11/x86-sev-es-introduce-ip_within_syscall_gap-helper.patch queue-5.11/x86-sev-es-use-__copy_from_user_inatomic.patch queue-5.11/x86-sev-es-correctly-track-irq-states-in-runtime-vc-handler.patch