x86/sev: Avoid using __x86_return_thunk
authorKim Phillips <kim.phillips@amd.com>
Tue, 14 Jun 2022 21:15:44 +0000 (23:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Jul 2022 10:54:00 +0000 (12:54 +0200)
commit6c45176bc2ae4c3c2417202903f19cd86b9d7651
treee2e903712e181f2f6bdca731dd184fa1ada7c2fe
parentf3d9f990586c8f85ed2ced627f15801d39a7ed87
x86/sev: Avoid using __x86_return_thunk

commit 0ee9073000e8791f8b134a8ded31bcc767f7f232 upstream.

Specifically, it's because __enc_copy() encrypts the kernel after
being relocated outside the kernel in sme_encrypt_execute(), and the
RET macro's jmp offset isn't amended prior to execution.

Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/mm/mem_encrypt_boot.S