x86/mm/encrypt: Simplify sme_pgtable_calc()
authorKirill A. Shutemov <[email protected]>
Wed, 31 Jan 2018 13:54:04 +0000 (16:54 +0300)
committerIngo Molnar <[email protected]>
Tue, 13 Feb 2018 14:59:49 +0000 (15:59 +0100)
commit1070730c1ad2bd49b0d11112728f1f4390137728
treefe3fceed092504ca19a4a66eb29eb45552dabd02
parentaad983913d77af2c3394f29b88d7bb75ebd7d172
x86/mm/encrypt: Simplify sme_pgtable_calc()

sme_pgtable_calc() is unnecessary complex. It can be re-written in a
more stream-lined way.

As a side effect, we would get the code ready to boot-time switching
between paging modes.

Tested-by: Tom Lendacky <[email protected]>
Signed-off-by: Kirill A. Shutemov <[email protected]>
Reviewed-by: Tom Lendacky <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/mm/mem_encrypt_identity.c