diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2018-01-31 16:54:02 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-02-13 15:59:48 +0100 |
commit | 1cd9c22fee3ac21db52a0997d08cf2f065d2c0c0 (patch) | |
tree | 9315ad91a89b13c5b182e25380496a94dbc7f4b9 /arch/x86/include/asm/mem_encrypt.h | |
parent | 515ab7c41306aad1f80a980e1936ef635c61570c (diff) | |
download | linux-stable-1cd9c22fee3ac21db52a0997d08cf2f065d2c0c0.tar.gz linux-stable-1cd9c22fee3ac21db52a0997d08cf2f065d2c0c0.tar.bz2 linux-stable-1cd9c22fee3ac21db52a0997d08cf2f065d2c0c0.zip |
x86/mm/encrypt: Move page table helpers into separate translation unit
There are bunch of functions in mem_encrypt.c that operate on the
identity mapping, which means they want virtual addresses to be equal to
physical one, without PAGE_OFFSET shift.
We also need to avoid paravirtualizaion call there.
Getting this done is tricky. We cannot use usual page table helpers.
It forces us to open-code a lot of things. It makes code ugly and hard
to modify.
We can get it work with the page table helpers, but it requires few
preprocessor tricks. These tricks may have side effects for the rest of
the file.
Let's isolate such functions into own translation unit.
Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/20180131135404.40692-2-kirill.shutemov@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/include/asm/mem_encrypt.h')
-rw-r--r-- | arch/x86/include/asm/mem_encrypt.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/include/asm/mem_encrypt.h b/arch/x86/include/asm/mem_encrypt.h index 22c5f3e6f820..8fe61ad21047 100644 --- a/arch/x86/include/asm/mem_encrypt.h +++ b/arch/x86/include/asm/mem_encrypt.h @@ -22,6 +22,7 @@ #ifdef CONFIG_AMD_MEM_ENCRYPT extern u64 sme_me_mask; +extern bool sev_enabled; void sme_encrypt_execute(unsigned long encrypted_kernel_vaddr, unsigned long decrypted_kernel_vaddr, |