]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitbea5126974c90608b825bcf7c54bde915a555c80
treeb9b9e513e9908128d5788f1cee870419293d40c8
parent4dfb271623c08208fb69f4c7d21ff8ab74bbde33
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