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

Commit 682cb0cd authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull sparc fixes from David Miller:

 1) Finally make perf stack backtraces stable on sparc, several problems
    (mostly due to the context in which the user copies from the stack
    are done) contributed to this.

    From Rob Gardner.

 2) Export ADI capability if the cpu supports it.

 3) Hook up userfaultfd system call.

 4) When faults happen during user copies we really have to clean up and
    restore the FPU state fully.  Also from Rob Gardner

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  tty/serial: Skip 'NULL' char after console break when sysrq enabled
  sparc64: fix FP corruption in user copy functions
  sparc64: Perf should save/restore fault info
  sparc64: Ensure perf can access user stacks
  sparc64: Don't set %pil in rtrap_nmi too early
  sparc64: Add ADI capability to cpu capabilities
  tty: serial: constify sunhv_ops structs
  sparc: Hook up userfaultfd system call
parents a8816434 079317a6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@
 * really available.  So we simply advertise only "crypto" support.
 */
#define HWCAP_SPARC_CRYPTO	0x04000000 /* CRYPTO insns available */
#define HWCAP_SPARC_ADI		0x08000000 /* ADI available */

#define CORE_DUMP_USE_REGSET

+2 −1
Original line number Diff line number Diff line
@@ -417,8 +417,9 @@
#define __NR_bpf		349
#define __NR_execveat		350
#define __NR_membarrier		351
#define __NR_userfaultfd	352

#define NR_syscalls		352
#define NR_syscalls		353

/* Bitmask values returned from kern_features system call.  */
#define KERN_FEATURE_MIXED_MODE_STACK	0x00000001
+13 −0
Original line number Diff line number Diff line
@@ -946,6 +946,12 @@ ENTRY(__retl_one)
	 mov	1, %o0
ENDPROC(__retl_one)

ENTRY(__retl_one_fp)
	VISExitHalf
	retl
	 mov	1, %o0
ENDPROC(__retl_one_fp)

ENTRY(__ret_one_asi)
	wr	%g0, ASI_AIUS, %asi
	ret
@@ -958,6 +964,13 @@ ENTRY(__retl_one_asi)
	 mov	1, %o0
ENDPROC(__retl_one_asi)

ENTRY(__retl_one_asi_fp)
	wr	%g0, ASI_AIUS, %asi
	VISExitHalf
	retl
	 mov	1, %o0
ENDPROC(__retl_one_asi_fp)

ENTRY(__retl_o1)
	retl
	 mov	%o1, %o0
+11 −0
Original line number Diff line number Diff line
@@ -1828,11 +1828,18 @@ static void perf_callchain_user_32(struct perf_callchain_entry *entry,
void
perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
{
	u64 saved_fault_address = current_thread_info()->fault_address;
	u8 saved_fault_code = get_thread_fault_code();
	mm_segment_t old_fs;

	perf_callchain_store(entry, regs->tpc);

	if (!current->mm)
		return;

	old_fs = get_fs();
	set_fs(USER_DS);

	flushw_user();

	pagefault_disable();
@@ -1843,4 +1850,8 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
		perf_callchain_user_64(entry, regs);

	pagefault_enable();

	set_fs(old_fs);
	set_thread_fault_code(saved_fault_code);
	current_thread_info()->fault_address = saved_fault_address;
}
+7 −1
Original line number Diff line number Diff line
@@ -73,7 +73,13 @@ rtrap_nmi: ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %l1
		andn			%l1, %l4, %l1
		srl			%l4, 20, %l4
		ba,pt			%xcc, rtrap_no_irq_enable
		 wrpr			%l4, %pil
		nop
		/* Do not actually set the %pil here.  We will do that
		 * below after we clear PSTATE_IE in the %pstate register.
		 * If we re-enable interrupts here, we can recurse down
		 * the hardirq stack potentially endlessly, causing a
		 * stack overflow.
		 */

		.align			64
		.globl			rtrap_irq, rtrap, irqsz_patchme, rtrap_xcall
Loading