x86/sev: Make sure IRQs are disabled while GHCB is active
authorJoerg Roedel <jroedel@suse.de>
Fri, 18 Jun 2021 11:54:08 +0000 (13:54 +0200)
committerBorislav Petkov <bp@suse.de>
Mon, 21 Jun 2021 13:51:21 +0000 (15:51 +0200)
commitd187f217335dba2b49fc9002aab2004e04acddee
treeb9b9e513e9908128d5788f1cee870419293d40c8
parent07570cef5e5c3fcec40f82a9075abb4c1da63319
x86/sev: Make sure IRQs are disabled while GHCB is active

The #VC handler only cares about IRQs being disabled while the GHCB is
active, as it must not be interrupted by something which could cause
another #VC while it holds the GHCB (NMI is the exception for which the
backup GHCB exits).

Make sure nothing interrupts the code path while the GHCB is active
by making sure that callers of __sev_{get,put}_ghcb() have disabled
interrupts upfront.

 [ bp: Massage commit message. ]

Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210618115409.22735-2-joro@8bytes.org
arch/x86/kernel/sev.c