diff options
| author | Peter Zijlstra <peterz@infradead.org> | 2018-01-23 10:18:50 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2018-02-21 03:05:04 -0500 |
| commit | 531bb52a869a9c6e08c8d17ba955fcbfc18037ad (patch) | |
| tree | b54175a5031511f536f1fd31c3fd300d9d9cf328 | |
| parent | bd89004f6305cbf7352238f61da093207ee518d6 (diff) | |
x86/mm/sme, objtool: Annotate indirect call in sme_encrypt_execute()
This is boot code and thus Spectre-safe: we run this _way_ before userspace
comes along to have a chance to poison our branch predictor.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Borislav Petkov <bp@suse.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
| -rw-r--r-- | arch/x86/mm/mem_encrypt_boot.S | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/mm/mem_encrypt_boot.S b/arch/x86/mm/mem_encrypt_boot.S index 01f682cf77a8..40a6085063d6 100644 --- a/arch/x86/mm/mem_encrypt_boot.S +++ b/arch/x86/mm/mem_encrypt_boot.S | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <asm/page.h> | 15 | #include <asm/page.h> |
| 16 | #include <asm/processor-flags.h> | 16 | #include <asm/processor-flags.h> |
| 17 | #include <asm/msr-index.h> | 17 | #include <asm/msr-index.h> |
| 18 | #include <asm/nospec-branch.h> | ||
| 18 | 19 | ||
| 19 | .text | 20 | .text |
| 20 | .code64 | 21 | .code64 |
| @@ -59,6 +60,7 @@ ENTRY(sme_encrypt_execute) | |||
| 59 | movq %rax, %r8 /* Workarea encryption routine */ | 60 | movq %rax, %r8 /* Workarea encryption routine */ |
| 60 | addq $PAGE_SIZE, %r8 /* Workarea intermediate copy buffer */ | 61 | addq $PAGE_SIZE, %r8 /* Workarea intermediate copy buffer */ |
| 61 | 62 | ||
| 63 | ANNOTATE_RETPOLINE_SAFE | ||
| 62 | call *%rax /* Call the encryption routine */ | 64 | call *%rax /* Call the encryption routine */ |
| 63 | 65 | ||
| 64 | pop %r12 | 66 | pop %r12 |
