Skip to content

Commit

Permalink
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upst…
Browse files Browse the repository at this point in the history
…ream-linus

Pull MIPS fixes from Ralf Baechle:
 "The pending MIPS fixes for 3.19.  All across the field and nothing
  particularly severe or dramatic"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (23 commits)
  IRQCHIP: mips-gic: Avoid rerouting timer IRQs for smp-cmp
  MIPS: Fix syscall_get_nr for the syscall exit tracing.
  MIPS: elf2ecoff: Ignore PT_MIPS_ABIFLAGS program headers.
  MIPS: elf2ecoff: Rewrite main processing loop to switch.
  MIPS: fork: Fix MSA/FPU/DSP context duplication race
  MIPS: Fix C0_Pagegrain[IEC] support.
  MIPS: traps: Fix inline asm ctc1 missing .set hardfloat
  MIPS: mipsregs.h: Add write_32bit_cp1_register()
  MIPS: Fix kernel lockup or crash after CPU offline/online
  MIPS: OCTEON: fix kernel crash when offlining a CPU
  MIPS: ARC: Fix build error.
  MIPS: IRQ: Fix disable_irq on CPU IRQs
  MIPS: smp-mt,smp-cmp: Enable all HW IRQs on secondary CPUs
  MIPS: Fix restart of indirect syscalls
  MIPS: ELF: fix loading o32 binaries on 64-bit kernels
  MIPS: mips-cm: Fix sparse warnings
  MIPS: Kconfig: Fix recursive dependency.
  MIPS: Compat: Fix build error if CONFIG_MIPS32_COMPAT but no compat ABI.
  MIPS: JZ4740: Fixup #include's (sparse)
  MIPS: Wire up execveat(2).
  ...
  • Loading branch information
Linus Torvalds committed Feb 6, 2015
2 parents 9d82f5e + 1b6af71 commit dbf3b7d
Show file tree
Hide file tree
Showing 26 changed files with 186 additions and 111 deletions.
23 changes: 10 additions & 13 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2656,27 +2656,21 @@ config TRAD_SIGNALS
bool

config MIPS32_COMPAT
bool "Kernel support for Linux/MIPS 32-bit binary compatibility"
depends on 64BIT
help
Select this option if you want Linux/MIPS 32-bit binary
compatibility. Since all software available for Linux/MIPS is
currently 32-bit you should say Y here.
bool

config COMPAT
bool
depends on MIPS32_COMPAT
select ARCH_WANT_OLD_COMPAT_IPC
default y

config SYSVIPC_COMPAT
bool
depends on COMPAT && SYSVIPC
default y

config MIPS32_O32
bool "Kernel support for o32 binaries"
depends on MIPS32_COMPAT
depends on 64BIT
select ARCH_WANT_OLD_COMPAT_IPC
select COMPAT
select MIPS32_COMPAT
select SYSVIPC_COMPAT if SYSVIPC
help
Select this option if you want to run o32 binaries. These are pure
32-bit binaries as used by the 32-bit Linux/MIPS port. Most of
Expand All @@ -2686,7 +2680,10 @@ config MIPS32_O32

config MIPS32_N32
bool "Kernel support for n32 binaries"
depends on MIPS32_COMPAT
depends on 64BIT
select COMPAT
select MIPS32_COMPAT
select SYSVIPC_COMPAT if SYSVIPC
help
Select this option if you want to run n32 binaries. These are
64-bit binaries using 32-bit quantities for addressing and certain
Expand Down
64 changes: 36 additions & 28 deletions arch/mips/boot/elf2ecoff.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
/*
* Some extra ELF definitions
*/
#define PT_MIPS_REGINFO 0x70000000 /* Register usage information */
#define PT_MIPS_REGINFO 0x70000000 /* Register usage information */
#define PT_MIPS_ABIFLAGS 0x70000003 /* Records ABI related flags */

/* -------------------------------------------------------------------- */

Expand Down Expand Up @@ -349,39 +350,46 @@ int main(int argc, char *argv[])

for (i = 0; i < ex.e_phnum; i++) {
/* Section types we can ignore... */
if (ph[i].p_type == PT_NULL || ph[i].p_type == PT_NOTE ||
ph[i].p_type == PT_PHDR
|| ph[i].p_type == PT_MIPS_REGINFO)
switch (ph[i].p_type) {
case PT_NULL:
case PT_NOTE:
case PT_PHDR:
case PT_MIPS_REGINFO:
case PT_MIPS_ABIFLAGS:
continue;
/* Section types we can't handle... */
else if (ph[i].p_type != PT_LOAD) {
fprintf(stderr,
"Program header %d type %d can't be converted.\n",
ex.e_phnum, ph[i].p_type);
exit(1);
}
/* Writable (data) segment? */
if (ph[i].p_flags & PF_W) {
struct sect ndata, nbss;

ndata.vaddr = ph[i].p_vaddr;
ndata.len = ph[i].p_filesz;
nbss.vaddr = ph[i].p_vaddr + ph[i].p_filesz;
nbss.len = ph[i].p_memsz - ph[i].p_filesz;
case PT_LOAD:
/* Writable (data) segment? */
if (ph[i].p_flags & PF_W) {
struct sect ndata, nbss;

ndata.vaddr = ph[i].p_vaddr;
ndata.len = ph[i].p_filesz;
nbss.vaddr = ph[i].p_vaddr + ph[i].p_filesz;
nbss.len = ph[i].p_memsz - ph[i].p_filesz;

combine(&data, &ndata, 0);
combine(&bss, &nbss, 1);
} else {
struct sect ntxt;
combine(&data, &ndata, 0);
combine(&bss, &nbss, 1);
} else {
struct sect ntxt;

ntxt.vaddr = ph[i].p_vaddr;
ntxt.len = ph[i].p_filesz;
ntxt.vaddr = ph[i].p_vaddr;
ntxt.len = ph[i].p_filesz;

combine(&text, &ntxt, 0);
combine(&text, &ntxt, 0);
}
/* Remember the lowest segment start address. */
if (ph[i].p_vaddr < cur_vma)
cur_vma = ph[i].p_vaddr;
break;

default:
/* Section types we can't handle... */
fprintf(stderr,
"Program header %d type %d can't be converted.\n",
ex.e_phnum, ph[i].p_type);
exit(1);
}
/* Remember the lowest segment start address. */
if (ph[i].p_vaddr < cur_vma)
cur_vma = ph[i].p_vaddr;
}

/* Sections must be in order to be converted... */
Expand Down
2 changes: 0 additions & 2 deletions arch/mips/cavium-octeon/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,7 @@ static int octeon_cpu_disable(void)

set_cpu_online(cpu, false);
cpu_clear(cpu, cpu_callin_map);
local_irq_disable();
octeon_fixup_irqs();
local_irq_enable();

flush_cache_all();
local_flush_tlb_all();
Expand Down
16 changes: 4 additions & 12 deletions arch/mips/configs/malta_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ CONFIG_IP_NF_MATCH_ECN=m
CONFIG_IP_NF_MATCH_TTL=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_TARGET_ULOG=m
CONFIG_IP_NF_MANGLE=m
CONFIG_IP_NF_TARGET_CLUSTERIP=m
CONFIG_IP_NF_TARGET_ECN=m
Expand Down Expand Up @@ -175,7 +174,6 @@ CONFIG_BRIDGE_EBT_MARK_T=m
CONFIG_BRIDGE_EBT_REDIRECT=m
CONFIG_BRIDGE_EBT_SNAT=m
CONFIG_BRIDGE_EBT_LOG=m
CONFIG_BRIDGE_EBT_ULOG=m
CONFIG_BRIDGE_EBT_NFLOG=m
CONFIG_IP_SCTP=m
CONFIG_BRIDGE=m
Expand Down Expand Up @@ -220,8 +218,6 @@ CONFIG_NET_ACT_SKBEDIT=m
CONFIG_NET_CLS_IND=y
CONFIG_CFG80211=m
CONFIG_MAC80211=m
CONFIG_MAC80211_RC_PID=y
CONFIG_MAC80211_RC_DEFAULT_PID=y
CONFIG_MAC80211_MESH=y
CONFIG_RFKILL=m
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
Expand All @@ -248,19 +244,13 @@ CONFIG_ATA_OVER_ETH=m
CONFIG_IDE=y
CONFIG_BLK_DEV_IDECD=y
CONFIG_IDE_GENERIC=y
CONFIG_BLK_DEV_GENERIC=y
CONFIG_BLK_DEV_PIIX=y
CONFIG_BLK_DEV_IT8213=m
CONFIG_BLK_DEV_TC86C001=m
CONFIG_RAID_ATTRS=m
CONFIG_SCSI=m
CONFIG_BLK_DEV_SD=m
CONFIG_BLK_DEV_SD=y
CONFIG_CHR_DEV_ST=m
CONFIG_CHR_DEV_OSST=m
CONFIG_BLK_DEV_SR=m
CONFIG_BLK_DEV_SR_VENDOR=y
CONFIG_CHR_DEV_SG=m
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y
CONFIG_SCSI_LOGGING=y
CONFIG_SCSI_SCAN_ASYNC=y
Expand All @@ -273,6 +263,8 @@ CONFIG_SCSI_AACRAID=m
CONFIG_SCSI_AIC7XXX=m
CONFIG_AIC7XXX_RESET_DELAY_MS=15000
# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
CONFIG_ATA=y
CONFIG_ATA_PIIX=y
CONFIG_MD=y
CONFIG_BLK_DEV_MD=m
CONFIG_MD_LINEAR=m
Expand Down Expand Up @@ -340,6 +332,7 @@ CONFIG_UIO=m
CONFIG_UIO_CIF=m
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_EXT4_FS=y
CONFIG_REISERFS_FS=m
CONFIG_REISERFS_PROC_INFO=y
CONFIG_REISERFS_FS_XATTR=y
Expand Down Expand Up @@ -441,4 +434,3 @@ CONFIG_CRYPTO_SERPENT=m
CONFIG_CRYPTO_TEA=m
CONFIG_CRYPTO_TWOFISH=m
# CONFIG_CRYPTO_ANSI_CPRNG is not set
CONFIG_CRC16=m
43 changes: 26 additions & 17 deletions arch/mips/include/asm/fpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static inline int __enable_fpu(enum fpu_mode mode)
return SIGFPE;

/* set FRE */
write_c0_config5(read_c0_config5() | MIPS_CONF5_FRE);
set_c0_config5(MIPS_CONF5_FRE);
goto fr_common;

case FPU_64BIT:
Expand All @@ -74,8 +74,10 @@ static inline int __enable_fpu(enum fpu_mode mode)
#endif
/* fall through */
case FPU_32BIT:
/* clear FRE */
write_c0_config5(read_c0_config5() & ~MIPS_CONF5_FRE);
if (cpu_has_fre) {
/* clear FRE */
clear_c0_config5(MIPS_CONF5_FRE);
}
fr_common:
/* set CU1 & change FR appropriately */
fr = (int)mode & FPU_FR_MASK;
Expand Down Expand Up @@ -182,25 +184,32 @@ static inline int init_fpu(void)
int ret = 0;

if (cpu_has_fpu) {
unsigned int config5;

ret = __own_fpu();
if (!ret) {
unsigned int config5 = read_c0_config5();

/*
* Ensure FRE is clear whilst running _init_fpu, since
* single precision FP instructions are used. If FRE
* was set then we'll just end up initialising all 32
* 64b registers.
*/
write_c0_config5(config5 & ~MIPS_CONF5_FRE);
enable_fpu_hazard();
if (ret)
return ret;

if (!cpu_has_fre) {
_init_fpu();

/* Restore FRE */
write_c0_config5(config5);
enable_fpu_hazard();
return 0;
}

/*
* Ensure FRE is clear whilst running _init_fpu, since
* single precision FP instructions are used. If FRE
* was set then we'll just end up initialising all 32
* 64b registers.
*/
config5 = clear_c0_config5(MIPS_CONF5_FRE);
enable_fpu_hazard();

_init_fpu();

/* Restore FRE */
write_c0_config5(config5);
enable_fpu_hazard();
} else
fpu_emulator_init_fpu();

Expand Down
6 changes: 3 additions & 3 deletions arch/mips/include/asm/fw/arc/hinv.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ union key_u {
#define SGI_ARCS_REV 10 /* rev .10, 3/04/92 */
#endif

typedef struct component {
typedef struct {
CONFIGCLASS Class;
CONFIGTYPE Type;
IDENTIFIERFLAG Flags;
Expand All @@ -140,7 +140,7 @@ struct cfgdata {
};

/* System ID */
typedef struct systemid {
typedef struct {
CHAR VendorId[8];
CHAR ProductId[8];
} SYSTEMID;
Expand All @@ -166,7 +166,7 @@ typedef enum memorytype {
#endif /* _NT_PROM */
} MEMORYTYPE;

typedef struct memorydescriptor {
typedef struct {
MEMORYTYPE Type;
LONG BasePage;
LONG PageCount;
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/include/asm/mips-cm.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ static inline bool mips_cm_has_l2sync(void)

/* Macros to ease the creation of register access functions */
#define BUILD_CM_R_(name, off) \
static inline u32 *addr_gcr_##name(void) \
static inline u32 __iomem *addr_gcr_##name(void) \
{ \
return (u32 *)(mips_cm_base + (off)); \
return (u32 __iomem *)(mips_cm_base + (off)); \
} \
\
static inline u32 read_gcr_##name(void) \
Expand Down
15 changes: 15 additions & 0 deletions arch/mips/include/asm/mipsregs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1386,12 +1386,27 @@ do { \
__res; \
})

#define _write_32bit_cp1_register(dest, val, gas_hardfloat) \
do { \
__asm__ __volatile__( \
" .set push \n" \
" .set reorder \n" \
" "STR(gas_hardfloat)" \n" \
" ctc1 %0,"STR(dest)" \n" \
" .set pop \n" \
: : "r" (val)); \
} while (0)

#ifdef GAS_HAS_SET_HARDFLOAT
#define read_32bit_cp1_register(source) \
_read_32bit_cp1_register(source, .set hardfloat)
#define write_32bit_cp1_register(dest, val) \
_write_32bit_cp1_register(dest, val, .set hardfloat)
#else
#define read_32bit_cp1_register(source) \
_read_32bit_cp1_register(source, )
#define write_32bit_cp1_register(dest, val) \
_write_32bit_cp1_register(dest, val, )
#endif

#ifdef HAVE_AS_DSP
Expand Down
8 changes: 1 addition & 7 deletions arch/mips/include/asm/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@
static inline long syscall_get_nr(struct task_struct *task,
struct pt_regs *regs)
{
/* O32 ABI syscall() - Either 64-bit with O32 or 32-bit */
if ((config_enabled(CONFIG_32BIT) ||
test_tsk_thread_flag(task, TIF_32BIT_REGS)) &&
(regs->regs[2] == __NR_syscall))
return regs->regs[4];
else
return regs->regs[2];
return current_thread_info()->syscall;
}

static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
Expand Down
1 change: 1 addition & 0 deletions arch/mips/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct thread_info {
*/
struct restart_block restart_block;
struct pt_regs *regs;
long syscall; /* syscall number */
};

/*
Expand Down
Loading

0 comments on commit dbf3b7d

Please sign in to comment.