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

MIPS: Separate MAAR V bit into VL and VH for XPA

The MAAR V bit has been renamed VL since another bit called VH is added
at the top of the register when it is extended to 64-bits on a 32-bit
processor with XPA. Rename the V definition, fix the various users, and
add definitions for the VH bit. Also add a definition for the MAARI
Index field.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org

+13 -7
+5 -5
arch/mips/include/asm/maar.h
··· 36 36 * @upper: The highest address that the MAAR pair will affect. Must be 37 37 * aligned to one byte before a 2^16 byte boundary. 38 38 * @attrs: The accessibility attributes to program, eg. MIPS_MAAR_S. The 39 - * MIPS_MAAR_V attribute will automatically be set. 39 + * MIPS_MAAR_VL attribute will automatically be set. 40 40 * 41 41 * Program the pair of MAAR registers specified by idx to apply the attributes 42 42 * specified by attrs to the range of addresses from lower to higher. ··· 49 49 BUG_ON(((upper & 0xffff) != 0xffff) 50 50 || ((upper & ~0xffffull) & ~(MIPS_MAAR_ADDR << 4))); 51 51 52 - /* Automatically set MIPS_MAAR_V */ 53 - attrs |= MIPS_MAAR_V; 52 + /* Automatically set MIPS_MAAR_VL */ 53 + attrs |= MIPS_MAAR_VL; 54 54 55 - /* Write the upper address & attributes (only MIPS_MAAR_V matters) */ 55 + /* Write the upper address & attributes (only MIPS_MAAR_VL matters) */ 56 56 write_c0_maari(idx << 1); 57 57 back_to_back_c0_hazard(); 58 58 write_c0_maar(((upper >> 4) & MIPS_MAAR_ADDR) | attrs); ··· 81 81 * @upper: The highest address that the MAAR pair will affect. Must be 82 82 * aligned to one byte before a 2^16 byte boundary. 83 83 * @attrs: The accessibility attributes to program, eg. MIPS_MAAR_S. The 84 - * MIPS_MAAR_V attribute will automatically be set. 84 + * MIPS_MAAR_VL attribute will automatically be set. 85 85 * 86 86 * Describes the configuration of a pair of Memory Accessibility Attribute 87 87 * Registers - applying attributes from attrs to the range of physical
+7 -1
arch/mips/include/asm/mipsregs.h
··· 34 34 */ 35 35 #ifdef __ASSEMBLY__ 36 36 #define _ULCAST_ 37 + #define _U64CAST_ 37 38 #else 38 39 #define _ULCAST_ (unsigned long) 40 + #define _U64CAST_ (u64) 39 41 #endif 40 42 41 43 /* ··· 721 719 #define XLR_PERFCTRL_ALLTHREADS (_ULCAST_(1) << 13) 722 720 723 721 /* MAAR bit definitions */ 722 + #define MIPS_MAAR_VH (_U64CAST_(1) << 63) 724 723 #define MIPS_MAAR_ADDR ((BIT_ULL(BITS_PER_LONG - 12) - 1) << 12) 725 724 #define MIPS_MAAR_ADDR_SHIFT 12 726 725 #define MIPS_MAAR_S (_ULCAST_(1) << 1) 727 - #define MIPS_MAAR_V (_ULCAST_(1) << 0) 726 + #define MIPS_MAAR_VL (_ULCAST_(1) << 0) 727 + 728 + /* MAARI bit definitions */ 729 + #define MIPS_MAARI_INDEX (_ULCAST_(0x3f) << 0) 728 730 729 731 /* EBase bit definitions */ 730 732 #define MIPS_EBASE_CPUNUM_SHIFT 0
+1 -1
arch/mips/mm/init.c
··· 348 348 upper = ((upper & MIPS_MAAR_ADDR) << 4) | 0xffff; 349 349 350 350 pr_info(" [%d]: ", i / 2); 351 - if (!(attr & MIPS_MAAR_V)) { 351 + if (!(attr & MIPS_MAAR_VL)) { 352 352 pr_cont("disabled\n"); 353 353 continue; 354 354 }