]> git.baikalelectronics.ru Git - kernel.git/commit
x86/mm/encrypt: Move page table helpers into separate translation unit
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Wed, 31 Jan 2018 13:54:02 +0000 (16:54 +0300)
committerIngo Molnar <mingo@kernel.org>
Tue, 13 Feb 2018 14:59:48 +0000 (15:59 +0100)
commit0428a9603c29b9b493686fb46fe7feb29fc5a9f1
tree9315ad91a89b13c5b182e25380496a94dbc7f4b9
parent7c2f6c8766f361a1adf426710013a4d5dc472100
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>
arch/x86/include/asm/mem_encrypt.h
arch/x86/mm/Makefile
arch/x86/mm/mem_encrypt.c
arch/x86/mm/mem_encrypt_identity.c [new file with mode: 0644]