diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 20:16:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 20:16:21 -0400 |
commit | 98edb6ca4174f17a64890a02f44c211c8b44fb3c (patch) | |
tree | 033bc5f7da410046d28dd1cefcd2d63cda33d25b /arch/powerpc/mm | |
parent | a8251096b427283c47e7d8f9568be6b388dd68ec (diff) | |
parent | 8fbf065d625617bbbf6b72d5f78f84ad13c8b547 (diff) |
Merge branch 'kvm-updates/2.6.35' of git://git.kernel.org/pub/scm/virt/kvm/kvm
* 'kvm-updates/2.6.35' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (269 commits)
KVM: x86: Add missing locking to arch specific vcpu ioctls
KVM: PPC: Add missing vcpu_load()/vcpu_put() in vcpu ioctls
KVM: MMU: Segregate shadow pages with different cr0.wp
KVM: x86: Check LMA bit before set_efer
KVM: Don't allow lmsw to clear cr0.pe
KVM: Add cpuid.txt file
KVM: x86: Tell the guest we'll warn it about tsc stability
x86, paravirt: don't compute pvclock adjustments if we trust the tsc
x86: KVM guest: Try using new kvm clock msrs
KVM: x86: export paravirtual cpuid flags in KVM_GET_SUPPORTED_CPUID
KVM: x86: add new KVMCLOCK cpuid feature
KVM: x86: change msr numbers for kvmclock
x86, paravirt: Add a global synchronization point for pvclock
x86, paravirt: Enable pvclock flags in vcpu_time_info structure
KVM: x86: Inject #GP with the right rip on efer writes
KVM: SVM: Don't allow nested guest to VMMCALL into host
KVM: x86: Fix exception reinjection forced to true
KVM: Fix wallclock version writing race
KVM: MMU: Don't read pdptrs with mmu spinlock held in mmu_alloc_roots
KVM: VMX: enable VMXON check with SMX enabled (Intel TXT)
...
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/mmu_context_hash32.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/arch/powerpc/mm/mmu_context_hash32.c b/arch/powerpc/mm/mmu_context_hash32.c index 0dfba2bf7f3..d0ee554e86e 100644 --- a/arch/powerpc/mm/mmu_context_hash32.c +++ b/arch/powerpc/mm/mmu_context_hash32.c | |||
@@ -60,11 +60,7 @@ | |||
60 | static unsigned long next_mmu_context; | 60 | static unsigned long next_mmu_context; |
61 | static unsigned long context_map[LAST_CONTEXT / BITS_PER_LONG + 1]; | 61 | static unsigned long context_map[LAST_CONTEXT / BITS_PER_LONG + 1]; |
62 | 62 | ||
63 | 63 | unsigned long __init_new_context(void) | |
64 | /* | ||
65 | * Set up the context for a new address space. | ||
66 | */ | ||
67 | int init_new_context(struct task_struct *t, struct mm_struct *mm) | ||
68 | { | 64 | { |
69 | unsigned long ctx = next_mmu_context; | 65 | unsigned long ctx = next_mmu_context; |
70 | 66 | ||
@@ -74,19 +70,38 @@ int init_new_context(struct task_struct *t, struct mm_struct *mm) | |||
74 | ctx = 0; | 70 | ctx = 0; |
75 | } | 71 | } |
76 | next_mmu_context = (ctx + 1) & LAST_CONTEXT; | 72 | next_mmu_context = (ctx + 1) & LAST_CONTEXT; |
77 | mm->context.id = ctx; | 73 | |
74 | return ctx; | ||
75 | } | ||
76 | EXPORT_SYMBOL_GPL(__init_new_context); | ||
77 | |||
78 | /* | ||
79 | * Set up the context for a new address space. | ||
80 | */ | ||
81 | int init_new_context(struct task_struct *t, struct mm_struct *mm) | ||
82 | { | ||
83 | mm->context.id = __init_new_context(); | ||
78 | 84 | ||
79 | return 0; | 85 | return 0; |
80 | } | 86 | } |
81 | 87 | ||
82 | /* | 88 | /* |
89 | * Free a context ID. Make sure to call this with preempt disabled! | ||
90 | */ | ||
91 | void __destroy_context(unsigned long ctx) | ||
92 | { | ||
93 | clear_bit(ctx, context_map); | ||
94 | } | ||
95 | EXPORT_SYMBOL_GPL(__destroy_context); | ||
96 | |||
97 | /* | ||
83 | * We're finished using the context for an address space. | 98 | * We're finished using the context for an address space. |
84 | */ | 99 | */ |
85 | void destroy_context(struct mm_struct *mm) | 100 | void destroy_context(struct mm_struct *mm) |
86 | { | 101 | { |
87 | preempt_disable(); | 102 | preempt_disable(); |
88 | if (mm->context.id != NO_CONTEXT) { | 103 | if (mm->context.id != NO_CONTEXT) { |
89 | clear_bit(mm->context.id, context_map); | 104 | __destroy_context(mm->context.id); |
90 | mm->context.id = NO_CONTEXT; | 105 | mm->context.id = NO_CONTEXT; |
91 | } | 106 | } |
92 | preempt_enable(); | 107 | preempt_enable(); |