diff options
author | Tom Lendacky <thomas.lendacky@amd.com> | 2020-09-07 16:15:55 +0300 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2020-09-09 12:33:20 +0300 |
commit | 4711e7acaa125d8cc242f06e1f4d6c74e177454b (patch) | |
tree | 7bc55a6cbc7294f14fdbbc28a39239f6aef1f293 /arch/x86/boot/compressed | |
parent | a14a92fc4b420ae6713800a8ae8c3686c1a1fa20 (diff) | |
download | linux-4711e7acaa125d8cc242f06e1f4d6c74e177454b.tar.xz |
x86/sev-es: Handle RDTSC(P) Events
Implement a handler for #VC exceptions caused by RDTSC and RDTSCP
instructions. Also make it available in the pre-decompression stage
because the KASLR code uses RDTSC/RDTSCP to gather entropy and some
hypervisors intercept these instructions.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
[ jroedel@suse.de: - Adapt to #VC handling infrastructure
- Make it available early ]
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-55-joro@8bytes.org
Diffstat (limited to 'arch/x86/boot/compressed')
-rw-r--r-- | arch/x86/boot/compressed/sev-es.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/boot/compressed/sev-es.c b/arch/x86/boot/compressed/sev-es.c index b1790f487456..5f15e5864e0c 100644 --- a/arch/x86/boot/compressed/sev-es.c +++ b/arch/x86/boot/compressed/sev-es.c @@ -181,6 +181,10 @@ void do_boot_stage2_vc(struct pt_regs *regs, unsigned long exit_code) goto finish; switch (exit_code) { + case SVM_EXIT_RDTSC: + case SVM_EXIT_RDTSCP: + result = vc_handle_rdtsc(boot_ghcb, &ctxt, exit_code); + break; case SVM_EXIT_IOIO: result = vc_handle_ioio(boot_ghcb, &ctxt); break; |