Skip to content

Commit 2db9704

Browse files
committed
Merge branch '4.2-fixes' into mips-for-linux-next
2 parents fb2646a + e0d8b2e commit 2db9704

3 files changed

Lines changed: 20 additions & 19 deletions

File tree

‎arch/mips/include/asm/pgtable-bits.h‎

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,13 @@
133133
#define _PAGE_HUGE (1 << _PAGE_HUGE_SHIFT)
134134
#define _PAGE_SPLITTING_SHIFT (_PAGE_HUGE_SHIFT + 1)
135135
#define _PAGE_SPLITTING (1 << _PAGE_SPLITTING_SHIFT)
136-
137-
/* Only R2 or newer cores have the XI bit */
138-
#if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6)
139-
#define _PAGE_NO_EXEC_SHIFT (_PAGE_SPLITTING_SHIFT + 1)
140-
#else
141-
#define _PAGE_GLOBAL_SHIFT (_PAGE_SPLITTING_SHIFT + 1)
142-
#define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT)
143-
#endif /* CONFIG_CPU_MIPSR2 || CONFIG_CPU_MIPSR6 */
144-
145136
#endif /* CONFIG_64BIT && CONFIG_MIPS_HUGE_TLB_SUPPORT */
146137

147138
#if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6)
148139
/* XI - page cannot be executed */
149-
#ifndef _PAGE_NO_EXEC_SHIFT
140+
#ifdef _PAGE_SPLITTING_SHIFT
141+
#define _PAGE_NO_EXEC_SHIFT (_PAGE_SPLITTING_SHIFT + 1)
142+
#else
150143
#define _PAGE_NO_EXEC_SHIFT (_PAGE_MODIFIED_SHIFT + 1)
151144
#endif
152145
#define _PAGE_NO_EXEC (cpu_has_rixi ? (1 << _PAGE_NO_EXEC_SHIFT) : 0)
@@ -156,14 +149,16 @@
156149
#define _PAGE_READ (cpu_has_rixi ? 0 : (1 << _PAGE_READ_SHIFT))
157150
#define _PAGE_NO_READ_SHIFT _PAGE_READ_SHIFT
158151
#define _PAGE_NO_READ (cpu_has_rixi ? (1 << _PAGE_READ_SHIFT) : 0)
152+
#endif /* defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6) */
159153

154+
#if defined(_PAGE_NO_READ_SHIFT)
160155
#define _PAGE_GLOBAL_SHIFT (_PAGE_NO_READ_SHIFT + 1)
161-
#define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT)
162-
163-
#else /* !CONFIG_CPU_MIPSR2 && !CONFIG_CPU_MIPSR6 */
156+
#elif defined(_PAGE_SPLITTING_SHIFT)
157+
#define _PAGE_GLOBAL_SHIFT (_PAGE_SPLITTING_SHIFT + 1)
158+
#else
164159
#define _PAGE_GLOBAL_SHIFT (_PAGE_MODIFIED_SHIFT + 1)
160+
#endif
165161
#define _PAGE_GLOBAL (1 << _PAGE_GLOBAL_SHIFT)
166-
#endif /* CONFIG_CPU_MIPSR2 || CONFIG_CPU_MIPSR6 */
167162

168163
#define _PAGE_VALID_SHIFT (_PAGE_GLOBAL_SHIFT + 1)
169164
#define _PAGE_VALID (1 << _PAGE_VALID_SHIFT)

‎arch/mips/include/uapi/asm/swab.h‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
#if (defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) || \
1717
defined(_MIPS_ARCH_LOONGSON3A)
1818

19-
static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
19+
static inline __attribute__((nomips16)) __attribute_const__
20+
__u16 __arch_swab16(__u16 x)
2021
{
2122
__asm__(
2223
" .set push \n"
2324
" .set arch=mips32r2 \n"
25+
" .set nomips16 \n"
2426
" wsbh %0, %1 \n"
2527
" .set pop \n"
2628
: "=r" (x)
@@ -30,11 +32,13 @@ static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
3032
}
3133
#define __arch_swab16 __arch_swab16
3234

33-
static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
35+
static inline __attribute__((nomips16)) __attribute_const__
36+
__u32 __arch_swab32(__u32 x)
3437
{
3538
__asm__(
3639
" .set push \n"
3740
" .set arch=mips32r2 \n"
41+
" .set nomips16 \n"
3842
" wsbh %0, %1 \n"
3943
" rotr %0, %0, 16 \n"
4044
" .set pop \n"
@@ -50,11 +54,13 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
5054
* 64-bit kernel on r2 CPUs.
5155
*/
5256
#ifdef __mips64
53-
static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
57+
static inline __attribute__((nomips16)) __attribute_const__
58+
__u64 __arch_swab64(__u64 x)
5459
{
5560
__asm__(
5661
" .set push \n"
5762
" .set arch=mips64r2 \n"
63+
" .set nomips16 \n"
5864
" dsbh %0, %1 \n"
5965
" dshd %0, %0 \n"
6066
" .set pop \n"

‎arch/mips/kernel/cps-vec.S‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ dcache_done:
152152

153153
/* Enter the coherent domain */
154154
li t0, 0xff
155-
PTR_S t0, GCR_CL_COHERENCE_OFS(v1)
155+
sw t0, GCR_CL_COHERENCE_OFS(v1)
156156
ehb
157157

158158
/* Jump to kseg0 */
@@ -302,7 +302,7 @@ LEAF(mips_cps_boot_vpes)
302302
PTR_L t0, 0(t0)
303303

304304
/* Calculate a pointer to this cores struct core_boot_config */
305-
PTR_L t0, GCR_CL_ID_OFS(t0)
305+
lw t0, GCR_CL_ID_OFS(t0)
306306
li t1, COREBOOTCFG_SIZE
307307
mul t0, t0, t1
308308
PTR_LA t1, mips_cps_core_bootcfg

0 commit comments

Comments
 (0)