Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47455911 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
  [MIPS] Kconfig: Move missplaced NR_CPUS default from SMTC to VSMP.
  [MIPS] Lockdep: Fix recursion bug.
  [MIPS] RTLX: Handle copy_*_user return values.
  [MIPS] RTLX: Protect rtlx_{read,write} with mutex.
  [MIPS] RTLX: Harden against compiler reordering and optimization.
  [MIPS] RTLX: Don't use volatile; it's fragile.
  [MIPS] Lasat: Downgrade 64-bit kernel from experimental to broken.
  [MIPS] Compat: Fix build if CONFIG_SYSVIPC is disabled.
  [CHAR] lcd: Fix two warnings.
  [MIPS] FPU ownership management & preemption fixes
  [MIPS] Check FCSR for pending interrupts, alternative version
  [MIPS] IP27, IP35: Fix warnings.
parents 5379058b f510aa3b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ config LASAT
	select R5000_CPU_SCACHE
	select SYS_HAS_CPU_R5000
	select SYS_SUPPORTS_32BIT_KERNEL
	select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
	select SYS_SUPPORTS_64BIT_KERNEL if BROKEN
	select SYS_SUPPORTS_LITTLE_ENDIAN
	select GENERIC_HARDIRQS_NO__DO_IRQ

@@ -1559,6 +1559,7 @@ config MIPS_MT_SMP
	select CPU_MIPSR2_IRQ_VI
	select CPU_MIPSR2_SRS
	select MIPS_MT
	select NR_CPUS_DEFAULT_2
	select SMP
	select SYS_SUPPORTS_SMP
	help
@@ -1573,7 +1574,6 @@ config MIPS_MT_SMTC
	select CPU_MIPSR2_IRQ_VI
	select CPU_MIPSR2_SRS
	select MIPS_MT
	select NR_CPUS_DEFAULT_2
	select NR_CPUS_DEFAULT_8
	select SMP
	select SYS_SUPPORTS_SMP
+14 −4
Original line number Diff line number Diff line
@@ -191,6 +191,8 @@ void sp_work_handle_request(void)
	struct mtsp_syscall_generic generic;
	struct mtsp_syscall_ret ret;
	struct kspd_notifications *n;
	unsigned long written;
	mm_segment_t old_fs;
	struct timeval tv;
	struct timezone tz;
	int cmd;
@@ -201,7 +203,11 @@ void sp_work_handle_request(void)

	ret.retval = -1;

	if (!rtlx_read(RTLX_CHANNEL_SYSIO, &sc, sizeof(struct mtsp_syscall), 0)) {
	old_fs = get_fs();
	set_fs(KERNEL_DS);

	if (!rtlx_read(RTLX_CHANNEL_SYSIO, &sc, sizeof(struct mtsp_syscall))) {
		set_fs(old_fs);
		printk(KERN_ERR "Expected request but nothing to read\n");
		return;
	}
@@ -209,7 +215,8 @@ void sp_work_handle_request(void)
	size = sc.size;

	if (size) {
		if (!rtlx_read(RTLX_CHANNEL_SYSIO, &generic, size, 0)) {
		if (!rtlx_read(RTLX_CHANNEL_SYSIO, &generic, size)) {
			set_fs(old_fs);
			printk(KERN_ERR "Expected request but nothing to read\n");
			return;
		}
@@ -282,8 +289,11 @@ void sp_work_handle_request(void)
	if (vpe_getuid(SP_VPE))
		sp_setfsuidgid( 0, 0);

	if ((rtlx_write(RTLX_CHANNEL_SYSIO, &ret, sizeof(struct mtsp_syscall_ret), 0))
	    < sizeof(struct mtsp_syscall_ret))
	old_fs = get_fs();
	set_fs(KERNEL_DS);
	written = rtlx_write(RTLX_CHANNEL_SYSIO, &ret, sizeof(ret));
	set_fs(old_fs);
	if (written < sizeof(ret))
		printk("KSPD: sp_work_handle_request failed to send to SP\n");
}

+12 −0
Original line number Diff line number Diff line
@@ -311,6 +311,8 @@ asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid,
	return ret;
}

#ifdef CONFIG_SYSVIPC

asmlinkage long
sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
{
@@ -368,6 +370,16 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
	return err;
}

#else

asmlinkage long
sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
{
	return -ENOSYS;
}

#endif /* CONFIG_SYSVIPC */

#ifdef CONFIG_MIPS32_N32
asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg)
{
+6 −4
Original line number Diff line number Diff line
@@ -49,8 +49,7 @@ LEAF(resume)
#ifndef CONFIG_CPU_HAS_LLSC
	sw      zero, ll_bit
#endif
	mfc0	t1, CP0_STATUS
	sw	t1, THREAD_STATUS(a0)
	mfc0	t2, CP0_STATUS
	cpu_save_nonscratch a0
	sw	ra, THREAD_REG31(a0)

@@ -60,8 +59,8 @@ LEAF(resume)
	lw	t3, TASK_THREAD_INFO(a0)
	lw	t0, TI_FLAGS(t3)
	li	t1, _TIF_USEDFPU
	and	t2, t0, t1
	beqz	t2, 1f
	and	t1, t0
	beqz	t1, 1f
	nor	t1, zero, t1

	and	t0, t0, t1
@@ -74,10 +73,13 @@ LEAF(resume)
	li	t1, ~ST0_CU1
	and	t0, t0, t1
	sw	t0, ST_OFF(t3)
	/* clear thread_struct CU1 bit */
	and	t2, t1

	fpu_save_single a0, t0			# clobbers t0

1:
	sw	t2, THREAD_STATUS(a0)
	/*
	 * The order of restoring the registers takes care of the race
	 * updating $28, $29 and kernelsp without disabling ints.
+0 −16
Original line number Diff line number Diff line
@@ -114,14 +114,6 @@ LEAF(_save_fp_context32)
 */
LEAF(_restore_fp_context)
	EX	lw t0, SC_FPC_CSR(a0)

	/* Fail if the CSR has exceptions pending */
	srl	t1, t0, 5
	and	t1, t0
	andi	t1, 0x1f << 7
	bnez	t1, fault
	 nop

#ifdef CONFIG_64BIT
	EX	ldc1 $f1, SC_FPREGS+8(a0)
	EX	ldc1 $f3, SC_FPREGS+24(a0)
@@ -165,14 +157,6 @@ LEAF(_restore_fp_context)
LEAF(_restore_fp_context32)
	/* Restore an o32 sigcontext.  */
	EX	lw t0, SC32_FPC_CSR(a0)

	/* Fail if the CSR has exceptions pending */
	srl	t1, t0, 5
	and	t1, t0
	andi	t1, 0x1f << 7
	bnez	t1, fault
	 nop

	EX	ldc1 $f0, SC32_FPREGS+0(a0)
	EX	ldc1 $f2, SC32_FPREGS+16(a0)
	EX	ldc1 $f4, SC32_FPREGS+32(a0)
Loading