x86/sev-es: Handle DR7 read/write events
authorTom Lendacky <thomas.lendacky@amd.com>
Mon, 7 Sep 2020 13:15:53 +0000 (15:15 +0200)
committerBorislav Petkov <bp@suse.de>
Wed, 9 Sep 2020 09:33:20 +0000 (11:33 +0200)
commit479a7bf5c1f7f14eb37c6d6aeb401562efc1fcad
tree8744143417c70aaf89adba42f5ffb25de1d6f042
parenta4afa6081c88701635e1e20090f953a25f9444e0
x86/sev-es: Handle DR7 read/write events

Add code to handle #VC exceptions on DR7 register reads and writes.
This is needed early because show_regs() reads DR7 to print it out.

Under SEV-ES, there is currently no support for saving/restoring the
DRx registers but software expects to be able to write to the DR7
register. For now, cache the value written to DR7 and return it on
read attempts, but do not touch the real hardware DR7.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
[ jroedel@suse.de: - Adapt to #VC handling framework
                   - Support early usage ]
Co-developed-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20200907131613.12703-53-joro@8bytes.org
arch/x86/kernel/sev-es.c