Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Pavel Tatashin and committed by
David S. Miller
c4415235 14d0334c

+4 -4
+1 -1
arch/sparc/include/asm/mmu_64.h
··· 52 52 #define CTX_NR_MASK TAG_CONTEXT_BITS 53 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 56 #define CTX_VALID(__ctx) \ 57 57 (!(((__ctx.sparc64_ctx_val) ^ tlb_context_cache) & CTX_VERSION_MASK)) 58 58 #define CTX_HWBITS(__ctx) ((__ctx.sparc64_ctx_val) & CTX_HW_MASK)
+3 -3
arch/sparc/mm/init_64.c
··· 707 707 708 708 /* get_new_mmu_context() uses "cache + 1". */ 709 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 711 #define MAX_CTX_NR (1UL << CTX_NR_BITS) 712 712 #define CTX_BMAP_SLOTS BITS_TO_LONGS(MAX_CTX_NR) 713 713 DECLARE_BITMAP(mmu_context_bmap, MAX_CTX_NR); ··· 738 738 if (new_ctx >= ctx) { 739 739 int i; 740 740 new_ctx = (tlb_context_cache & CTX_VERSION_MASK) + 741 - CTX_FIRST_VERSION; 741 + CTX_FIRST_VERSION + 1; 742 742 if (new_ctx == 1) 743 - new_ctx = CTX_FIRST_VERSION; 743 + new_ctx = CTX_FIRST_VERSION + 1; 744 744 745 745 /* Don't call memset, for 16 entries that's just 746 746 * plain silly...