diff options
author | Tom Lendacky <thomas.lendacky@amd.com> | 2020-09-07 15:15:55 +0200 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2020-09-09 11:33:20 +0200 |
commit | 4711e7acaa125d8cc242f06e1f4d6c74e177454b (patch) | |
tree | 7bc55a6cbc7294f14fdbbc28a39239f6aef1f293 /arch/x86/kernel/sev-es.c | |
parent | a14a92fc4b420ae6713800a8ae8c3686c1a1fa20 (diff) | |
download | linux-stable-4711e7acaa125d8cc242f06e1f4d6c74e177454b.tar.gz linux-stable-4711e7acaa125d8cc242f06e1f4d6c74e177454b.tar.bz2 linux-stable-4711e7acaa125d8cc242f06e1f4d6c74e177454b.zip |
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/kernel/sev-es.c')
-rw-r--r-- | arch/x86/kernel/sev-es.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kernel/sev-es.c b/arch/x86/kernel/sev-es.c index aba27c3c1633..4d468ec325c3 100644 --- a/arch/x86/kernel/sev-es.c +++ b/arch/x86/kernel/sev-es.c @@ -866,6 +866,10 @@ static enum es_result vc_handle_exitcode(struct es_em_ctxt *ctxt, case SVM_EXIT_WRITE_DR7: result = vc_handle_dr7_write(ghcb, ctxt); break; + case SVM_EXIT_RDTSC: + case SVM_EXIT_RDTSCP: + result = vc_handle_rdtsc(ghcb, ctxt, exit_code); + break; case SVM_EXIT_CPUID: result = vc_handle_cpuid(ghcb, ctxt); break; |