|
@@ -639,9 +639,10 @@ void get_new_mmu_context(struct mm_struct *mm)
|
|
{
|
|
{
|
|
unsigned long ctx, new_ctx;
|
|
unsigned long ctx, new_ctx;
|
|
unsigned long orig_pgsz_bits;
|
|
unsigned long orig_pgsz_bits;
|
|
|
|
+ unsigned long flags;
|
|
int new_version;
|
|
int new_version;
|
|
|
|
|
|
- spin_lock(&ctx_alloc_lock);
|
|
|
|
|
|
+ spin_lock_irqsave(&ctx_alloc_lock, flags);
|
|
orig_pgsz_bits = (mm->context.sparc64_ctx_val & CTX_PGSZ_MASK);
|
|
orig_pgsz_bits = (mm->context.sparc64_ctx_val & CTX_PGSZ_MASK);
|
|
ctx = (tlb_context_cache + 1) & CTX_NR_MASK;
|
|
ctx = (tlb_context_cache + 1) & CTX_NR_MASK;
|
|
new_ctx = find_next_zero_bit(mmu_context_bmap, 1 << CTX_NR_BITS, ctx);
|
|
new_ctx = find_next_zero_bit(mmu_context_bmap, 1 << CTX_NR_BITS, ctx);
|
|
@@ -677,7 +678,7 @@ void get_new_mmu_context(struct mm_struct *mm)
|
|
out:
|
|
out:
|
|
tlb_context_cache = new_ctx;
|
|
tlb_context_cache = new_ctx;
|
|
mm->context.sparc64_ctx_val = new_ctx | orig_pgsz_bits;
|
|
mm->context.sparc64_ctx_val = new_ctx | orig_pgsz_bits;
|
|
- spin_unlock(&ctx_alloc_lock);
|
|
|
|
|
|
+ spin_unlock_irqrestore(&ctx_alloc_lock, flags);
|
|
|
|
|
|
if (unlikely(new_version))
|
|
if (unlikely(new_version))
|
|
smp_new_mmu_context_version();
|
|
smp_new_mmu_context_version();
|