diff options
author | Pavel Tatashin <pasha.tatashin@oracle.com> | 2017-05-31 11:25:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-06 16:45:28 -0400 |
commit | c4415235b2be0cc791572e8e7f7466ab8f73a2bf (patch) | |
tree | 5d11513cee206ba86d7151d01e1bdde3fba3cb9f /arch/sparc | |
parent | 14d0334c6748ff2aedb3f2f7fdc51ee90a9b54e7 (diff) |
sparc64: redefine first version
CTX_FIRST_VERSION defines the first context version, but also it defines
first context. This patch redefines it to only include the first context
version.
Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Reviewed-by: Bob Picco <bob.picco@oracle.com>
Reviewed-by: Steven Sistare <steven.sistare@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/mmu_64.h | 2 | ||||
-rw-r--r-- | arch/sparc/mm/init_64.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/sparc/include/asm/mmu_64.h b/arch/sparc/include/asm/mmu_64.h index f7de0dbc38af..83b36a5371ff 100644 --- a/arch/sparc/include/asm/mmu_64.h +++ b/arch/sparc/include/asm/mmu_64.h | |||
@@ -52,7 +52,7 @@ | |||
52 | #define CTX_NR_MASK TAG_CONTEXT_BITS | 52 | #define CTX_NR_MASK TAG_CONTEXT_BITS |
53 | #define CTX_HW_MASK (CTX_NR_MASK | CTX_PGSZ_MASK) | 53 | #define CTX_HW_MASK (CTX_NR_MASK | CTX_PGSZ_MASK) |
54 | 54 | ||
55 | #define CTX_FIRST_VERSION ((_AC(1,UL) << CTX_VERSION_SHIFT) + _AC(1,UL)) | 55 | #define CTX_FIRST_VERSION BIT(CTX_VERSION_SHIFT) |
56 | #define CTX_VALID(__ctx) \ | 56 | #define CTX_VALID(__ctx) \ |
57 | (!(((__ctx.sparc64_ctx_val) ^ tlb_context_cache) & CTX_VERSION_MASK)) | 57 | (!(((__ctx.sparc64_ctx_val) ^ tlb_context_cache) & CTX_VERSION_MASK)) |
58 | #define CTX_HWBITS(__ctx) ((__ctx.sparc64_ctx_val) & CTX_HW_MASK) | 58 | #define CTX_HWBITS(__ctx) ((__ctx.sparc64_ctx_val) & CTX_HW_MASK) |
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index f8e30a3906be..63b50447bb62 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
@@ -707,7 +707,7 @@ EXPORT_SYMBOL(__flush_dcache_range); | |||
707 | 707 | ||
708 | /* get_new_mmu_context() uses "cache + 1". */ | 708 | /* get_new_mmu_context() uses "cache + 1". */ |
709 | DEFINE_SPINLOCK(ctx_alloc_lock); | 709 | DEFINE_SPINLOCK(ctx_alloc_lock); |
710 | unsigned long tlb_context_cache = CTX_FIRST_VERSION - 1; | 710 | unsigned long tlb_context_cache = CTX_FIRST_VERSION; |
711 | #define MAX_CTX_NR (1UL << CTX_NR_BITS) | 711 | #define MAX_CTX_NR (1UL << CTX_NR_BITS) |
712 | #define CTX_BMAP_SLOTS BITS_TO_LONGS(MAX_CTX_NR) | 712 | #define CTX_BMAP_SLOTS BITS_TO_LONGS(MAX_CTX_NR) |
713 | DECLARE_BITMAP(mmu_context_bmap, MAX_CTX_NR); | 713 | DECLARE_BITMAP(mmu_context_bmap, MAX_CTX_NR); |
@@ -738,9 +738,9 @@ void get_new_mmu_context(struct mm_struct *mm) | |||
738 | if (new_ctx >= ctx) { | 738 | if (new_ctx >= ctx) { |
739 | int i; | 739 | int i; |
740 | new_ctx = (tlb_context_cache & CTX_VERSION_MASK) + | 740 | new_ctx = (tlb_context_cache & CTX_VERSION_MASK) + |
741 | CTX_FIRST_VERSION; | 741 | CTX_FIRST_VERSION + 1; |
742 | if (new_ctx == 1) | 742 | if (new_ctx == 1) |
743 | new_ctx = CTX_FIRST_VERSION; | 743 | new_ctx = CTX_FIRST_VERSION + 1; |
744 | 744 | ||
745 | /* Don't call memset, for 16 entries that's just | 745 | /* Don't call memset, for 16 entries that's just |
746 | * plain silly... | 746 | * plain silly... |