aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSteven J. Hill <sjhill@mips.com>2012-09-13 17:51:46 -0400
committerSteven J. Hill <sjhill@mips.com>2012-09-13 18:00:34 -0400
commit05857c64ecf897209c16ffad9bb3e8d359dd5dca (patch)
treee62c65d30be08409bb48ac6f9969ef083443e0aa /arch
parentb2ab4f08e84d4031f82255447180c559bd076bbf (diff)
MIPS: Replace 'kernel_uses_smartmips_rixi' with 'cpu_has_rixi'.
Remove usage of the 'kernel_uses_smartmips_rixi' macro from all files and use new 'cpu_has_rixi' instead. Signed-off-by: Steven J. Hill <sjhill@mips.com> Acked-by: David Daney <david.daney@cavium.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/include/asm/cpu-features.h3
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h2
-rw-r--r--arch/mips/include/asm/pgtable-bits.h18
-rw-r--r--arch/mips/include/asm/pgtable.h12
-rw-r--r--arch/mips/mm/cache.c2
-rw-r--r--arch/mips/mm/fault.c2
-rw-r--r--arch/mips/mm/tlb-r4k.c2
-rw-r--r--arch/mips/mm/tlbex.c14
8 files changed, 26 insertions, 29 deletions
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
index 3af9aca65ab5..63002a240c73 100644
--- a/arch/mips/include/asm/cpu-features.h
+++ b/arch/mips/include/asm/cpu-features.h
@@ -98,9 +98,6 @@
98#ifndef cpu_has_rixi 98#ifndef cpu_has_rixi
99#define cpu_has_rixi (cpu_data[0].options & MIPS_CPU_RIXI) 99#define cpu_has_rixi (cpu_data[0].options & MIPS_CPU_RIXI)
100#endif 100#endif
101#ifndef kernel_uses_smartmips_rixi
102#define kernel_uses_smartmips_rixi 0
103#endif
104#ifndef cpu_has_vtag_icache 101#ifndef cpu_has_vtag_icache
105#define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG) 102#define cpu_has_vtag_icache (cpu_data[0].icache.flags & MIPS_CACHE_VTAG)
106#endif 103#endif
diff --git a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
index a58addb98cfd..375ad0c815fe 100644
--- a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
+++ b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
@@ -58,7 +58,7 @@
58#define cpu_has_veic 0 58#define cpu_has_veic 0
59#define cpu_hwrena_impl_bits 0xc0000000 59#define cpu_hwrena_impl_bits 0xc0000000
60 60
61#define kernel_uses_smartmips_rixi (cpu_data[0].cputype != CPU_CAVIUM_OCTEON) 61#define cpu_has_rixi (cpu_data[0].cputype != CPU_CAVIUM_OCTEON)
62 62
63#define ARCH_HAS_IRQ_PER_CPU 1 63#define ARCH_HAS_IRQ_PER_CPU 1
64#define ARCH_HAS_SPINLOCK_PREFETCH 1 64#define ARCH_HAS_SPINLOCK_PREFETCH 1
diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h
index e9fe7e97ce4c..da4ba49adcf6 100644
--- a/arch/mips/include/asm/pgtable-bits.h
+++ b/arch/mips/include/asm/pgtable-bits.h
@@ -79,9 +79,9 @@
79/* implemented in software */ 79/* implemented in software */
80#define _PAGE_PRESENT_SHIFT (0) 80#define _PAGE_PRESENT_SHIFT (0)
81#define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT) 81#define _PAGE_PRESENT (1 << _PAGE_PRESENT_SHIFT)
82/* implemented in software, should be unused if kernel_uses_smartmips_rixi. */ 82/* implemented in software, should be unused if cpu_has_rixi. */
83#define _PAGE_READ_SHIFT (kernel_uses_smartmips_rixi ? _PAGE_PRESENT_SHIFT : _PAGE_PRESENT_SHIFT + 1) 83#define _PAGE_READ_SHIFT (cpu_has_rixi ? _PAGE_PRESENT_SHIFT : _PAGE_PRESENT_SHIFT + 1)
84#define _PAGE_READ ({if (kernel_uses_smartmips_rixi) BUG(); 1 << _PAGE_READ_SHIFT; }) 84#define _PAGE_READ ({BUG_ON(cpu_has_rixi); 1 << _PAGE_READ_SHIFT; })
85/* implemented in software */ 85/* implemented in software */
86#define _PAGE_WRITE_SHIFT (_PAGE_READ_SHIFT + 1) 86#define _PAGE_WRITE_SHIFT (_PAGE_READ_SHIFT + 1)
87#define _PAGE_WRITE (1 << _PAGE_WRITE_SHIFT) 87#define _PAGE_WRITE (1 << _PAGE_WRITE_SHIFT)
@@ -104,12 +104,12 @@
104#endif 104#endif
105 105
106/* Page cannot be executed */ 106/* Page cannot be executed */
107#define _PAGE_NO_EXEC_SHIFT (kernel_uses_smartmips_rixi ? _PAGE_HUGE_SHIFT + 1 : _PAGE_HUGE_SHIFT) 107#define _PAGE_NO_EXEC_SHIFT (cpu_has_rixi ? _PAGE_HUGE_SHIFT + 1 : _PAGE_HUGE_SHIFT)
108#define _PAGE_NO_EXEC ({if (!kernel_uses_smartmips_rixi) BUG(); 1 << _PAGE_NO_EXEC_SHIFT; }) 108#define _PAGE_NO_EXEC ({BUG_ON(!cpu_has_rixi); 1 << _PAGE_NO_EXEC_SHIFT; })
109 109
110/* Page cannot be read */ 110/* Page cannot be read */
111#define _PAGE_NO_READ_SHIFT (kernel_uses_smartmips_rixi ? _PAGE_NO_EXEC_SHIFT + 1 : _PAGE_NO_EXEC_SHIFT) 111#define _PAGE_NO_READ_SHIFT (cpu_has_rixi ? _PAGE_NO_EXEC_SHIFT + 1 : _PAGE_NO_EXEC_SHIFT)
112#define _PAGE_NO_READ ({if (!kernel_uses_smartmips_rixi) BUG(); 1 << _PAGE_NO_READ_SHIFT; }) 112#define _PAGE_NO_READ ({BUG_ON(!cpu_has_rixi); 1 << _PAGE_NO_READ_SHIFT; })
113 113
114#define _PAGE_GLOBAL_SHIFT (_PAGE_NO_READ_SHIFT + 1) 114#define _PAGE_GLOBAL_SHIFT (_PAGE_NO_READ_SHIFT + 1)
115#define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT) 115#define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT)
@@ -155,7 +155,7 @@
155 */ 155 */
156static inline uint64_t pte_to_entrylo(unsigned long pte_val) 156static inline uint64_t pte_to_entrylo(unsigned long pte_val)
157{ 157{
158 if (kernel_uses_smartmips_rixi) { 158 if (cpu_has_rixi) {
159 int sa; 159 int sa;
160#ifdef CONFIG_32BIT 160#ifdef CONFIG_32BIT
161 sa = 31 - _PAGE_NO_READ_SHIFT; 161 sa = 31 - _PAGE_NO_READ_SHIFT;
@@ -220,7 +220,7 @@ static inline uint64_t pte_to_entrylo(unsigned long pte_val)
220 220
221#endif 221#endif
222 222
223#define __READABLE (_PAGE_SILENT_READ | _PAGE_ACCESSED | (kernel_uses_smartmips_rixi ? 0 : _PAGE_READ)) 223#define __READABLE (_PAGE_SILENT_READ | _PAGE_ACCESSED | (cpu_has_rixi ? 0 : _PAGE_READ))
224#define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED) 224#define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED)
225 225
226#define _PAGE_CHG_MASK (_PFN_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _CACHE_MASK) 226#define _PAGE_CHG_MASK (_PFN_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _CACHE_MASK)
diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h
index b2202a68cf0f..c02158be836c 100644
--- a/arch/mips/include/asm/pgtable.h
+++ b/arch/mips/include/asm/pgtable.h
@@ -22,15 +22,15 @@ struct mm_struct;
22struct vm_area_struct; 22struct vm_area_struct;
23 23
24#define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT) 24#define PAGE_NONE __pgprot(_PAGE_PRESENT | _CACHE_CACHABLE_NONCOHERENT)
25#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_WRITE | (kernel_uses_smartmips_rixi ? 0 : _PAGE_READ) | \ 25#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_WRITE | (cpu_has_rixi ? 0 : _PAGE_READ) | \
26 _page_cachable_default) 26 _page_cachable_default)
27#define PAGE_COPY __pgprot(_PAGE_PRESENT | (kernel_uses_smartmips_rixi ? 0 : _PAGE_READ) | \ 27#define PAGE_COPY __pgprot(_PAGE_PRESENT | (cpu_has_rixi ? 0 : _PAGE_READ) | \
28 (kernel_uses_smartmips_rixi ? _PAGE_NO_EXEC : 0) | _page_cachable_default) 28 (cpu_has_rixi ? _PAGE_NO_EXEC : 0) | _page_cachable_default)
29#define PAGE_READONLY __pgprot(_PAGE_PRESENT | (kernel_uses_smartmips_rixi ? 0 : _PAGE_READ) | \ 29#define PAGE_READONLY __pgprot(_PAGE_PRESENT | (cpu_has_rixi ? 0 : _PAGE_READ) | \
30 _page_cachable_default) 30 _page_cachable_default)
31#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \ 31#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \
32 _PAGE_GLOBAL | _page_cachable_default) 32 _PAGE_GLOBAL | _page_cachable_default)
33#define PAGE_USERIO __pgprot(_PAGE_PRESENT | (kernel_uses_smartmips_rixi ? 0 : _PAGE_READ) | _PAGE_WRITE | \ 33#define PAGE_USERIO __pgprot(_PAGE_PRESENT | (cpu_has_rixi ? 0 : _PAGE_READ) | _PAGE_WRITE | \
34 _page_cachable_default) 34 _page_cachable_default)
35#define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \ 35#define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \
36 __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED) 36 __WRITEABLE | _PAGE_GLOBAL | _CACHE_UNCACHED)
@@ -299,7 +299,7 @@ static inline pte_t pte_mkdirty(pte_t pte)
299static inline pte_t pte_mkyoung(pte_t pte) 299static inline pte_t pte_mkyoung(pte_t pte)
300{ 300{
301 pte_val(pte) |= _PAGE_ACCESSED; 301 pte_val(pte) |= _PAGE_ACCESSED;
302 if (kernel_uses_smartmips_rixi) { 302 if (cpu_has_rixi) {
303 if (!(pte_val(pte) & _PAGE_NO_READ)) 303 if (!(pte_val(pte) & _PAGE_NO_READ))
304 pte_val(pte) |= _PAGE_SILENT_READ; 304 pte_val(pte) |= _PAGE_SILENT_READ;
305 } else { 305 } else {
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index 829320c7b175..07cec4407b0c 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -142,7 +142,7 @@ EXPORT_SYMBOL(_page_cachable_default);
142 142
143static inline void setup_protection_map(void) 143static inline void setup_protection_map(void)
144{ 144{
145 if (kernel_uses_smartmips_rixi) { 145 if (cpu_has_rixi) {
146 protection_map[0] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ); 146 protection_map[0] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ);
147 protection_map[1] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC); 147 protection_map[1] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC);
148 protection_map[2] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ); 148 protection_map[2] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ);
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c
index c14f6dfed995..7a19957735e9 100644
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -114,7 +114,7 @@ good_area:
114 if (!(vma->vm_flags & VM_WRITE)) 114 if (!(vma->vm_flags & VM_WRITE))
115 goto bad_area; 115 goto bad_area;
116 } else { 116 } else {
117 if (kernel_uses_smartmips_rixi) { 117 if (cpu_has_rixi) {
118 if (address == regs->cp0_epc && !(vma->vm_flags & VM_EXEC)) { 118 if (address == regs->cp0_epc && !(vma->vm_flags & VM_EXEC)) {
119#if 0 119#if 0
120 pr_notice("Cpu%d[%s:%d:%0*lx:%ld:%0*lx] XI violation\n", 120 pr_notice("Cpu%d[%s:%d:%0*lx:%ld:%0*lx] XI violation\n",
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index d2572cb232db..87b9cfcc30ff 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -401,7 +401,7 @@ void __cpuinit tlb_init(void)
401 current_cpu_type() == CPU_R14000) 401 current_cpu_type() == CPU_R14000)
402 write_c0_framemask(0); 402 write_c0_framemask(0);
403 403
404 if (kernel_uses_smartmips_rixi) { 404 if (cpu_has_rixi) {
405 /* 405 /*
406 * Enable the no read, no exec bits, and enable large virtual 406 * Enable the no read, no exec bits, and enable large virtual
407 * address. 407 * address.
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 03eb0ef91580..1832f17e6be4 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -586,7 +586,7 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
586static __cpuinit __maybe_unused void build_convert_pte_to_entrylo(u32 **p, 586static __cpuinit __maybe_unused void build_convert_pte_to_entrylo(u32 **p,
587 unsigned int reg) 587 unsigned int reg)
588{ 588{
589 if (kernel_uses_smartmips_rixi) { 589 if (cpu_has_rixi) {
590 UASM_i_SRL(p, reg, reg, ilog2(_PAGE_NO_EXEC)); 590 UASM_i_SRL(p, reg, reg, ilog2(_PAGE_NO_EXEC));
591 UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC)); 591 UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
592 } else { 592 } else {
@@ -990,7 +990,7 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp,
990 if (cpu_has_64bits) { 990 if (cpu_has_64bits) {
991 uasm_i_ld(p, tmp, 0, ptep); /* get even pte */ 991 uasm_i_ld(p, tmp, 0, ptep); /* get even pte */
992 uasm_i_ld(p, ptep, sizeof(pte_t), ptep); /* get odd pte */ 992 uasm_i_ld(p, ptep, sizeof(pte_t), ptep); /* get odd pte */
993 if (kernel_uses_smartmips_rixi) { 993 if (cpu_has_rixi) {
994 UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC)); 994 UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC));
995 UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC)); 995 UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC));
996 UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC)); 996 UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
@@ -1017,7 +1017,7 @@ static void __cpuinit build_update_entries(u32 **p, unsigned int tmp,
1017 UASM_i_LW(p, ptep, sizeof(pte_t), ptep); /* get odd pte */ 1017 UASM_i_LW(p, ptep, sizeof(pte_t), ptep); /* get odd pte */
1018 if (r45k_bvahwbug()) 1018 if (r45k_bvahwbug())
1019 build_tlb_probe_entry(p); 1019 build_tlb_probe_entry(p);
1020 if (kernel_uses_smartmips_rixi) { 1020 if (cpu_has_rixi) {
1021 UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC)); 1021 UASM_i_SRL(p, tmp, tmp, ilog2(_PAGE_NO_EXEC));
1022 UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC)); 1022 UASM_i_SRL(p, ptep, ptep, ilog2(_PAGE_NO_EXEC));
1023 UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC)); 1023 UASM_i_ROTR(p, tmp, tmp, ilog2(_PAGE_GLOBAL) - ilog2(_PAGE_NO_EXEC));
@@ -1183,7 +1183,7 @@ build_fast_tlb_refill_handler (u32 **p, struct uasm_label **l,
1183 UASM_i_LW(p, even, 0, ptr); /* get even pte */ 1183 UASM_i_LW(p, even, 0, ptr); /* get even pte */
1184 UASM_i_LW(p, odd, sizeof(pte_t), ptr); /* get odd pte */ 1184 UASM_i_LW(p, odd, sizeof(pte_t), ptr); /* get odd pte */
1185 } 1185 }
1186 if (kernel_uses_smartmips_rixi) { 1186 if (cpu_has_rixi) {
1187 uasm_i_dsrl_safe(p, even, even, ilog2(_PAGE_NO_EXEC)); 1187 uasm_i_dsrl_safe(p, even, even, ilog2(_PAGE_NO_EXEC));
1188 uasm_i_dsrl_safe(p, odd, odd, ilog2(_PAGE_NO_EXEC)); 1188 uasm_i_dsrl_safe(p, odd, odd, ilog2(_PAGE_NO_EXEC));
1189 uasm_i_drotr(p, even, even, 1189 uasm_i_drotr(p, even, even,
@@ -1545,7 +1545,7 @@ build_pte_present(u32 **p, struct uasm_reloc **r,
1545{ 1545{
1546 int t = scratch >= 0 ? scratch : pte; 1546 int t = scratch >= 0 ? scratch : pte;
1547 1547
1548 if (kernel_uses_smartmips_rixi) { 1548 if (cpu_has_rixi) {
1549 if (use_bbit_insns()) { 1549 if (use_bbit_insns()) {
1550 uasm_il_bbit0(p, r, pte, ilog2(_PAGE_PRESENT), lid); 1550 uasm_il_bbit0(p, r, pte, ilog2(_PAGE_PRESENT), lid);
1551 uasm_i_nop(p); 1551 uasm_i_nop(p);
@@ -1875,7 +1875,7 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
1875 if (m4kc_tlbp_war()) 1875 if (m4kc_tlbp_war())
1876 build_tlb_probe_entry(&p); 1876 build_tlb_probe_entry(&p);
1877 1877
1878 if (kernel_uses_smartmips_rixi) { 1878 if (cpu_has_rixi) {
1879 /* 1879 /*
1880 * If the page is not _PAGE_VALID, RI or XI could not 1880 * If the page is not _PAGE_VALID, RI or XI could not
1881 * have triggered it. Skip the expensive test.. 1881 * have triggered it. Skip the expensive test..
@@ -1929,7 +1929,7 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
1929 build_pte_present(&p, &r, wr.r1, wr.r2, wr.r3, label_nopage_tlbl); 1929 build_pte_present(&p, &r, wr.r1, wr.r2, wr.r3, label_nopage_tlbl);
1930 build_tlb_probe_entry(&p); 1930 build_tlb_probe_entry(&p);
1931 1931
1932 if (kernel_uses_smartmips_rixi) { 1932 if (cpu_has_rixi) {
1933 /* 1933 /*
1934 * If the page is not _PAGE_VALID, RI or XI could not 1934 * If the page is not _PAGE_VALID, RI or XI could not
1935 * have triggered it. Skip the expensive test.. 1935 * have triggered it. Skip the expensive test..