x86/mm: Factor out LDT init from context init
authorDave Hansen <[email protected]>
Fri, 12 Feb 2016 21:02:34 +0000 (13:02 -0800)
committerIngo Molnar <[email protected]>
Thu, 18 Feb 2016 18:46:31 +0000 (19:46 +0100)
commit39a0526fb3f7d93433d146304278477eb463f8af
tree3239029ebec8e3bd43213ed00ec69051e8c9e0e2
parent66d375709d2c891acc639538fd3179fa0cbb0daf
x86/mm: Factor out LDT init from context init

The arch-specific mm_context_t is a great place to put
protection-key allocation state.

But, we need to initialize the allocation state because pkey 0 is
always "allocated".  All of the runtime initialization of
mm_context_t is done in *_ldt() manipulation functions.  This
renames the existing LDT functions like this:

init_new_context() -> init_new_context_ldt()
destroy_context() -> destroy_context_ldt()

and makes init_new_context() and destroy_context() available for
generic use.

Signed-off-by: Dave Hansen <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/include/asm/mmu_context.h
arch/x86/kernel/ldt.c