Commit d042f313 authored by Al Viro's avatar Al Viro
Browse files

Merge branch 'arch-sparc' into no-rebases

parents 48944cc8 85910c20
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -232,9 +232,10 @@ static inline void __user *arch_compat_alloc_user_space(long len)
	struct pt_regs *regs = current_thread_info()->kregs;
	unsigned long usp = regs->u_regs[UREG_I6];

	if (!(test_thread_flag(TIF_32BIT)))
	if (test_thread_64bit_stack(usp))
		usp += STACK_BIAS;
	else

	if (test_thread_flag(TIF_32BIT))
		usp &= 0xffffffffUL;

	usp -= len;
+5 −0
Original line number Diff line number Diff line
@@ -258,6 +258,11 @@ static inline bool test_and_clear_restore_sigmask(void)

#define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG)

#define thread32_stack_is_64bit(__SP) (((__SP) & 0x1) != 0)
#define test_thread_64bit_stack(__SP) \
	((test_thread_flag(TIF_32BIT) && !thread32_stack_is_64bit(__SP)) ? \
	 false : true)

#endif	/* !__ASSEMBLY__ */

#endif /* __KERNEL__ */
+16 −8
Original line number Diff line number Diff line
@@ -372,6 +372,8 @@ etrap_spill_fixup_64bit: \

/* Normal 32bit spill */
#define SPILL_2_GENERIC(ASI)				\
	and	%sp, 1, %g3;				\
	brnz,pn	%g3, (. - (128 + 4));			\
	 srl	%sp, 0, %sp;				\
	stwa	%l0, [%sp + %g0] ASI;			\
	mov	0x04, %g3;				\
@@ -398,13 +400,15 @@ etrap_spill_fixup_64bit: \
	stwa	%i6, [%g1 + %g0] ASI;			\
	stwa	%i7, [%g1 + %g3] ASI;			\
	saved;						\
        retry; nop; nop;				\
        retry;						\
	b,a,pt	%xcc, spill_fixup_dax;			\
	b,a,pt	%xcc, spill_fixup_mna;			\
	b,a,pt	%xcc, spill_fixup;

#define SPILL_2_GENERIC_ETRAP		\
etrap_user_spill_32bit:			\
	and	%sp, 1, %g3;		\
	brnz,pn	%g3, etrap_user_spill_64bit;	\
	 srl	%sp, 0, %sp;		\
	stwa	%l0, [%sp + 0x00] %asi;	\
	stwa	%l1, [%sp + 0x04] %asi;	\
@@ -427,7 +431,7 @@ etrap_user_spill_32bit: \
	ba,pt	%xcc, etrap_save;	\
	 wrpr	%g1, %cwp;		\
	nop; nop; nop; nop;		\
	nop; nop; nop; nop;		\
	nop; nop;			\
	ba,a,pt	%xcc, etrap_spill_fixup_32bit; \
	ba,a,pt	%xcc, etrap_spill_fixup_32bit; \
	ba,a,pt	%xcc, etrap_spill_fixup_32bit;
@@ -592,6 +596,8 @@ user_rtt_fill_64bit: \

/* Normal 32bit fill */
#define FILL_2_GENERIC(ASI)				\
	and	%sp, 1, %g3;				\
	brnz,pn	%g3, (. - (128 + 4));			\
	 srl	%sp, 0, %sp;				\
	lduwa	[%sp + %g0] ASI, %l0;			\
	mov	0x04, %g2;				\
@@ -616,13 +622,15 @@ user_rtt_fill_64bit: \
	lduwa	[%g1 + %g3] ASI, %i6;			\
	lduwa	[%g1 + %g5] ASI, %i7;			\
	restored;					\
	retry; nop; nop; nop; nop;			\
	retry; nop; nop;				\
	b,a,pt	%xcc, fill_fixup_dax;			\
	b,a,pt	%xcc, fill_fixup_mna;			\
	b,a,pt	%xcc, fill_fixup;

#define FILL_2_GENERIC_RTRAP				\
user_rtt_fill_32bit:					\
	and	%sp, 1, %g3;				\
	brnz,pn	%g3, user_rtt_fill_64bit;		\
	 srl	%sp, 0, %sp;				\
	lduwa	[%sp + 0x00] %asi, %l0;			\
	lduwa	[%sp + 0x04] %asi, %l1;			\
@@ -643,7 +651,7 @@ user_rtt_fill_32bit: \
	ba,pt	%xcc, user_rtt_pre_restore;		\
	 restored;					\
	nop; nop; nop; nop; nop;			\
	nop; nop; nop; nop; nop;			\
	nop; nop; nop;					\
	ba,a,pt	%xcc, user_rtt_fill_fixup;		\
	ba,a,pt	%xcc, user_rtt_fill_fixup;		\
	ba,a,pt	%xcc, user_rtt_fill_fixup;
+5 −1
Original line number Diff line number Diff line
@@ -405,8 +405,12 @@
#define __NR_setns		337
#define __NR_process_vm_readv	338
#define __NR_process_vm_writev	339
#define __NR_kern_features	340

#define NR_syscalls		340
#define NR_syscalls		341

/* Bitmask values returned from kern_features system call.  */
#define KERN_FEATURE_MIXED_MODE_STACK	0x00000001

#ifdef __32bit_syscall_numbers__
/* Sparc 32-bit only has the "setresuid32", "getresuid32" variants,
+16 −6
Original line number Diff line number Diff line
@@ -1762,15 +1762,25 @@ static void perf_callchain_user_32(struct perf_callchain_entry *entry,

	ufp = regs->u_regs[UREG_I6] & 0xffffffffUL;
	do {
		struct sparc_stackf32 *usf, sf;
		unsigned long pc;

		if (thread32_stack_is_64bit(ufp)) {
			struct sparc_stackf *usf, sf;

			ufp += STACK_BIAS;
			usf = (struct sparc_stackf *) ufp;
			if (__copy_from_user_inatomic(&sf, usf, sizeof(sf)))
				break;
			pc = sf.callers_pc & 0xffffffff;
			ufp = ((unsigned long) sf.fp) & 0xffffffff;
		} else {
			struct sparc_stackf32 *usf, sf;
			usf = (struct sparc_stackf32 *) ufp;
			if (__copy_from_user_inatomic(&sf, usf, sizeof(sf)))
				break;

			pc = sf.callers_pc;
			ufp = (unsigned long)sf.fp;
		}
		perf_callchain_store(entry, pc);
	} while (entry->nr < PERF_MAX_STACK_DEPTH);
}
Loading