diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2017-03-29 22:00:46 +1100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-03-31 23:09:57 +1100 |
commit | a336f2f5b05c3c02876a365b8f17b3d10920dbd5 (patch) | |
tree | 3988ca0b64a437539be9619805bb3dfb852ec62f /arch/powerpc/mm/mmu_context_book3s64.c | |
parent | 302413cad56820d4cd0d4fb66d01c81b4fcb1a10 (diff) |
powerpc/mm/hash: Abstract context id allocation for KVM
KVM wants to be able to allocate an MMU context id, which it does
currently by calling __init_new_context().
We're about to rework that code, so provide a wrapper for KVM so it
can not worry about the details.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/mmu_context_book3s64.c')
-rw-r--r-- | arch/powerpc/mm/mmu_context_book3s64.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/powerpc/mm/mmu_context_book3s64.c b/arch/powerpc/mm/mmu_context_book3s64.c index 73bf6e14c3aa..650a498b1de9 100644 --- a/arch/powerpc/mm/mmu_context_book3s64.c +++ b/arch/powerpc/mm/mmu_context_book3s64.c @@ -30,7 +30,7 @@ static DEFINE_SPINLOCK(mmu_context_lock); static DEFINE_IDA(mmu_context_ida); -int __init_new_context(void) +static int __init_new_context(void) { int index; int err; @@ -57,7 +57,13 @@ again: return index; } -EXPORT_SYMBOL_GPL(__init_new_context); + +int hash__alloc_context_id(void) +{ + return __init_new_context(); +} +EXPORT_SYMBOL_GPL(hash__alloc_context_id); + static int radix__init_new_context(struct mm_struct *mm, int index) { unsigned long rts_field; |