Skip to content

Commit c7d6891

Browse files
committed
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS fixes from Ralf Baechle: "MIPS fixes for various loose ends: - Fix workarounds for R4000 erratum. - Patch up DEC, Siemens-Nixdorf and Loongson hardware support. - Wire up renameat2 syscall. - Delete unused file - it was causing false warnings from maintenance scripts. - Revert a patch because it's functionality is now implemented twice which causes superfluous /proc/cpuinfo output. - Fix a microMIPS regression" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: MIPS: mm: Fix broken microMIPS kernel regression. MIPS: Add new AUDIT_ARCH token for the N32 ABI on MIPS64 MIPS: Wire up renameat2 syscall. MIPS: inst.h: Rename BITFIELD_FIELD to __BITFIELD_FIELD. MIPS: Remove file missed when removing rm9k support a while ago. MIPS/loongson2_cpufreq: Fix CPU clock rate setting MIPS: Loongson: No need to select GENERIC_HARDIRQS_NO__DO_IRQ MIPS: csum_partial.S CPU_DADDI_WORKAROUNDS bug fix MIPS: __strncpy_from_user_asm CPU_DADDI_WORKAROUNDS bug fix MIPS: __delay CPU_DADDI_WORKAROUNDS bug fix MIPS: DEC/SNI: O32 wrapper stack switching fixes MIPS: DEC: Bus error handler <asm/cpu-type.h> fixes MAINTAINERS: TURBOchannel: Update entry Revert "MIPS: MT: proc: Add support for printing VPE and TC ids"
2 parents 6ed8bf8 + 7bb3940 commit c7d6891

26 files changed

Lines changed: 327 additions & 423 deletions

File tree

‎MAINTAINERS‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9116,6 +9116,9 @@ F: arch/um/os-Linux/drivers/
91169116

91179117
TURBOCHANNEL SUBSYSTEM
91189118
M: "Maciej W. Rozycki" <macro@linux-mips.org>
9119+
M: Ralf Baechle <ralf@linux-mips.org>
9120+
L: linux-mips@linux-mips.org
9121+
Q: http://patchwork.linux-mips.org/project/linux-mips/list/
91199122
S: Maintained
91209123
F: drivers/tc/
91219124
F: include/linux/tc.h

‎arch/mips/dec/ecc-berr.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <asm/addrspace.h>
2222
#include <asm/bootinfo.h>
2323
#include <asm/cpu.h>
24+
#include <asm/cpu-type.h>
2425
#include <asm/irq_regs.h>
2526
#include <asm/processor.h>
2627
#include <asm/ptrace.h>

‎arch/mips/dec/kn02xa-berr.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/types.h>
2020

2121
#include <asm/addrspace.h>
22+
#include <asm/cpu-type.h>
2223
#include <asm/irq_regs.h>
2324
#include <asm/ptrace.h>
2425
#include <asm/traps.h>

‎arch/mips/dec/prom/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@
66
lib-y += init.o memory.o cmdline.o identify.o console.o
77

88
lib-$(CONFIG_32BIT) += locore.o
9-
lib-$(CONFIG_64BIT) += call_o32.o

‎arch/mips/dec/prom/call_o32.S‎

Lines changed: 0 additions & 89 deletions
This file was deleted.

‎arch/mips/fw/lib/call_o32.S‎

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* O32 interface for the 64 (or N32) ABI.
33
*
4-
* Copyright (C) 2002 Maciej W. Rozycki
4+
* Copyright (C) 2002, 2014 Maciej W. Rozycki
55
*
66
* This program is free software; you can redistribute it and/or
77
* modify it under the terms of the GNU General Public License
@@ -12,28 +12,37 @@
1212
#include <asm/asm.h>
1313
#include <asm/regdef.h>
1414

15+
/* O32 register size. */
16+
#define O32_SZREG 4
1517
/* Maximum number of arguments supported. Must be even! */
1618
#define O32_ARGC 32
17-
/* Number of static registers we save. */
19+
/* Number of static registers we save. */
1820
#define O32_STATC 11
19-
/* Frame size for static register */
20-
#define O32_FRAMESZ (SZREG * O32_STATC)
21-
/* Frame size on new stack */
22-
#define O32_FRAMESZ_NEW (SZREG + 4 * O32_ARGC)
21+
/* Argument area frame size. */
22+
#define O32_ARGSZ (O32_SZREG * O32_ARGC)
23+
/* Static register save area frame size. */
24+
#define O32_STATSZ (SZREG * O32_STATC)
25+
/* Stack pointer register save area frame size. */
26+
#define O32_SPSZ SZREG
27+
/* Combined area frame size. */
28+
#define O32_FRAMESZ (O32_ARGSZ + O32_SPSZ + O32_STATSZ)
29+
/* Switched stack frame size. */
30+
#define O32_NFRAMESZ (O32_ARGSZ + O32_SPSZ)
2331

2432
.text
2533

2634
/*
2735
* O32 function call dispatcher, for interfacing 32-bit ROM routines.
2836
*
29-
* The standard 64 (N32) calling sequence is supported, with a0
30-
* holding a function pointer, a1 a new stack pointer, a2-a7 -- its
31-
* first six arguments and the stack -- remaining ones (up to O32_ARGC,
32-
* including a2-a7). Static registers, gp and fp are preserved, v0 holds
33-
* a result. This code relies on the called o32 function for sp and ra
34-
* restoration and this dispatcher has to be placed in a KSEGx (or KUSEG)
35-
* address space. Any pointers passed have to point to addresses within
36-
* one of these spaces as well.
37+
* The standard 64 (N32) calling sequence is supported, with a0 holding
38+
* a function pointer, a1 a pointer to the new stack to call the
39+
* function with or 0 if no stack switching is requested, a2-a7 -- the
40+
* function call's first six arguments, and the stack -- the remaining
41+
* arguments (up to O32_ARGC, including a2-a7). Static registers, gp
42+
* and fp are preserved, v0 holds the result. This code relies on the
43+
* called o32 function for sp and ra restoration and this dispatcher has
44+
* to be placed in a KSEGx (or KUSEG) address space. Any pointers
45+
* passed have to point to addresses within one of these spaces as well.
3746
*/
3847
NESTED(call_o32, O32_FRAMESZ, ra)
3948
REG_SUBU sp,O32_FRAMESZ
@@ -51,32 +60,36 @@ NESTED(call_o32, O32_FRAMESZ, ra)
5160
REG_S s0,O32_FRAMESZ-11*SZREG(sp)
5261

5362
move jp,a0
54-
REG_SUBU s0,a1,O32_FRAMESZ_NEW
55-
REG_S sp,O32_FRAMESZ_NEW-1*SZREG(s0)
63+
64+
move fp,sp
65+
beqz a1,0f
66+
REG_SUBU fp,a1,O32_NFRAMESZ
67+
0:
68+
REG_S sp,O32_NFRAMESZ-1*SZREG(fp)
5669

5770
sll a0,a2,zero
5871
sll a1,a3,zero
5972
sll a2,a4,zero
6073
sll a3,a5,zero
61-
sw a6,0x10(s0)
62-
sw a7,0x14(s0)
74+
sw a6,4*O32_SZREG(fp)
75+
sw a7,5*O32_SZREG(fp)
6376

6477
PTR_LA t0,O32_FRAMESZ(sp)
65-
PTR_LA t1,0x18(s0)
78+
PTR_LA t1,6*O32_SZREG(fp)
6679
li t2,O32_ARGC-6
6780
1:
6881
lw t3,(t0)
6982
REG_ADDU t0,SZREG
7083
sw t3,(t1)
7184
REG_SUBU t2,1
72-
REG_ADDU t1,4
85+
REG_ADDU t1,O32_SZREG
7386
bnez t2,1b
7487

75-
move sp,s0
88+
move sp,fp
7689

7790
jalr jp
7891

79-
REG_L sp,O32_FRAMESZ_NEW-1*SZREG(sp)
92+
REG_L sp,O32_NFRAMESZ-1*SZREG(sp)
8093

8194
REG_L s0,O32_FRAMESZ-11*SZREG(sp)
8295
REG_L s1,O32_FRAMESZ-10*SZREG(sp)

‎arch/mips/fw/sni/sniprom.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040

4141
#ifdef CONFIG_64BIT
4242

43-
static u8 o32_stk[16384];
43+
/* O32 stack has to be 8-byte aligned. */
44+
static u64 o32_stk[4096];
4445
#define O32_STK &o32_stk[sizeof(o32_stk)]
4546

4647
#define __PROM_O32(fun, arg) fun arg __asm__(#fun); \

‎arch/mips/include/asm/dec/prom.h‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -113,31 +113,31 @@ extern int (*__pmax_close)(int);
113113
#define __DEC_PROM_O32(fun, arg) fun arg __asm__(#fun); \
114114
__asm__(#fun " = call_o32")
115115

116-
int __DEC_PROM_O32(_rex_bootinit, (int (*)(void)));
117-
int __DEC_PROM_O32(_rex_bootread, (int (*)(void)));
118-
int __DEC_PROM_O32(_rex_getbitmap, (int (*)(memmap *), memmap *));
116+
int __DEC_PROM_O32(_rex_bootinit, (int (*)(void), void *));
117+
int __DEC_PROM_O32(_rex_bootread, (int (*)(void), void *));
118+
int __DEC_PROM_O32(_rex_getbitmap, (int (*)(memmap *), void *, memmap *));
119119
unsigned long *__DEC_PROM_O32(_rex_slot_address,
120-
(unsigned long *(*)(int), int));
121-
void *__DEC_PROM_O32(_rex_gettcinfo, (void *(*)(void)));
122-
int __DEC_PROM_O32(_rex_getsysid, (int (*)(void)));
123-
void __DEC_PROM_O32(_rex_clear_cache, (void (*)(void)));
124-
125-
int __DEC_PROM_O32(_prom_getchar, (int (*)(void)));
126-
char *__DEC_PROM_O32(_prom_getenv, (char *(*)(char *), char *));
127-
int __DEC_PROM_O32(_prom_printf, (int (*)(char *, ...), char *, ...));
128-
129-
130-
#define rex_bootinit() _rex_bootinit(__rex_bootinit)
131-
#define rex_bootread() _rex_bootread(__rex_bootread)
132-
#define rex_getbitmap(x) _rex_getbitmap(__rex_getbitmap, x)
133-
#define rex_slot_address(x) _rex_slot_address(__rex_slot_address, x)
134-
#define rex_gettcinfo() _rex_gettcinfo(__rex_gettcinfo)
135-
#define rex_getsysid() _rex_getsysid(__rex_getsysid)
136-
#define rex_clear_cache() _rex_clear_cache(__rex_clear_cache)
137-
138-
#define prom_getchar() _prom_getchar(__prom_getchar)
139-
#define prom_getenv(x) _prom_getenv(__prom_getenv, x)
140-
#define prom_printf(x...) _prom_printf(__prom_printf, x)
120+
(unsigned long *(*)(int), void *, int));
121+
void *__DEC_PROM_O32(_rex_gettcinfo, (void *(*)(void), void *));
122+
int __DEC_PROM_O32(_rex_getsysid, (int (*)(void), void *));
123+
void __DEC_PROM_O32(_rex_clear_cache, (void (*)(void), void *));
124+
125+
int __DEC_PROM_O32(_prom_getchar, (int (*)(void), void *));
126+
char *__DEC_PROM_O32(_prom_getenv, (char *(*)(char *), void *, char *));
127+
int __DEC_PROM_O32(_prom_printf, (int (*)(char *, ...), void *, char *, ...));
128+
129+
130+
#define rex_bootinit() _rex_bootinit(__rex_bootinit, NULL)
131+
#define rex_bootread() _rex_bootread(__rex_bootread, NULL)
132+
#define rex_getbitmap(x) _rex_getbitmap(__rex_getbitmap, NULL, x)
133+
#define rex_slot_address(x) _rex_slot_address(__rex_slot_address, NULL, x)
134+
#define rex_gettcinfo() _rex_gettcinfo(__rex_gettcinfo, NULL)
135+
#define rex_getsysid() _rex_getsysid(__rex_getsysid, NULL)
136+
#define rex_clear_cache() _rex_clear_cache(__rex_clear_cache, NULL)
137+
138+
#define prom_getchar() _prom_getchar(__prom_getchar, NULL)
139+
#define prom_getenv(x) _prom_getenv(__prom_getenv, NULL, x)
140+
#define prom_printf(x...) _prom_printf(__prom_printf, NULL, x)
141141

142142
#else /* !CONFIG_64BIT */
143143

‎arch/mips/include/asm/rm9k-ocd.h‎

Lines changed: 0 additions & 56 deletions
This file was deleted.

‎arch/mips/include/asm/syscall.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ static inline int syscall_get_arch(void)
133133
#ifdef CONFIG_64BIT
134134
if (!test_thread_flag(TIF_32BIT_REGS))
135135
arch |= __AUDIT_ARCH_64BIT;
136+
if (test_thread_flag(TIF_32BIT_ADDR))
137+
arch |= __AUDIT_ARCH_CONVENTION_MIPS64_N32;
136138
#endif
137139
#if defined(__LITTLE_ENDIAN)
138140
arch |= __AUDIT_ARCH_LE;

0 commit comments

Comments
 (0)