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

Commit 10d43397 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'xtensa-20190408' of git://github.com/jcmvbkbc/linux-xtensa

Pull xtensa fixes from Max Filippov:

 - fix syscall number passed to trace_sys_exit

 - fix syscall number initialization in start_thread

 - fix level interpretation in the return_address

 - fix format string warning in init_pmd

* tag 'xtensa-20190408' of git://github.com/jcmvbkbc/linux-xtensa:
  xtensa: fix format string warning in init_pmd
  xtensa: fix return_address
  xtensa: fix initialization of pt_regs::syscall in start_thread
  xtensa: use actual syscall number in do_syscall_trace_leave
parents fd008d1a ecae26fa
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -187,15 +187,18 @@ struct thread_struct {

/* Clearing a0 terminates the backtrace. */
#define start_thread(regs, new_pc, new_sp) \
	memset(regs, 0, sizeof(*regs)); \
	regs->pc = new_pc; \
	regs->ps = USER_PS_VALUE; \
	regs->areg[1] = new_sp; \
	regs->areg[0] = 0; \
	regs->wmask = 1; \
	regs->depc = 0; \
	regs->windowbase = 0; \
	regs->windowstart = 1;
	do { \
		memset((regs), 0, sizeof(*(regs))); \
		(regs)->pc = (new_pc); \
		(regs)->ps = USER_PS_VALUE; \
		(regs)->areg[1] = (new_sp); \
		(regs)->areg[0] = 0; \
		(regs)->wmask = 1; \
		(regs)->depc = 0; \
		(regs)->windowbase = 0; \
		(regs)->windowstart = 1; \
		(regs)->syscall = NO_SYSCALL; \
	} while (0)

/* Forward declaration */
struct task_struct;
+6 −0
Original line number Diff line number Diff line
@@ -1860,6 +1860,8 @@ ENTRY(system_call)
	l32i	a7, a2, PT_SYSCALL

1:
	s32i	a7, a1, 4

	/* syscall = sys_call_table[syscall_nr] */

	movi	a4, sys_call_table
@@ -1893,8 +1895,12 @@ ENTRY(system_call)
	retw

1:
	l32i	a4, a1, 4
	l32i	a3, a2, PT_SYSCALL
	s32i	a4, a2, PT_SYSCALL
	mov	a6, a2
	call4	do_syscall_trace_leave
	s32i	a3, a2, PT_SYSCALL
	retw

ENDPROC(system_call)
+5 −1
Original line number Diff line number Diff line
@@ -253,10 +253,14 @@ static int return_address_cb(struct stackframe *frame, void *data)
	return 1;
}

/*
 * level == 0 is for the return address from the caller of this function,
 * not from this function itself.
 */
unsigned long return_address(unsigned level)
{
	struct return_addr_data r = {
		.skip = level + 1,
		.skip = level,
	};
	walk_stackframe(stack_pointer(NULL), return_address_cb, &r);
	return r.addr;
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ static void * __init init_pmd(unsigned long vaddr, unsigned long n_pages)

	pte = memblock_alloc_low(n_pages * sizeof(pte_t), PAGE_SIZE);
	if (!pte)
		panic("%s: Failed to allocate %zu bytes align=%lx\n",
		panic("%s: Failed to allocate %lu bytes align=%lx\n",
		      __func__, n_pages * sizeof(pte_t), PAGE_SIZE);

	for (i = 0; i < n_pages; ++i)