Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Peter Zijlstra and committed by
Ingo Molnar
531bb52a bd89004f

+2
+2
arch/x86/mm/mem_encrypt_boot.S
··· 15 15 #include <asm/page.h> 16 16 #include <asm/processor-flags.h> 17 17 #include <asm/msr-index.h> 18 + #include <asm/nospec-branch.h> 18 19 19 20 .text 20 21 .code64 ··· 60 59 movq %rax, %r8 /* Workarea encryption routine */ 61 60 addq $PAGE_SIZE, %r8 /* Workarea intermediate copy buffer */ 62 61 62 + ANNOTATE_RETPOLINE_SAFE 63 63 call *%rax /* Call the encryption routine */ 64 64 65 65 pop %r12