Commit 01bc9325 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm

Pull ARM fixes from Russell King:

 - fix unwinder for uleb128 case

 - fix kernel-doc warnings for HP Jornada 7xx

 - fix unbalanced stack on vfp success path

* tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
  ARM: 9297/1: vfp: avoid unbalanced stack on 'success' return path
  ARM: 9296/1: HP Jornada 7XX: fix kernel-doc warnings
  ARM: 9295/1: unwind:fix unwind abort for uleb128 case
parents 31f4104e 2b951b0e
...@@ -308,6 +308,29 @@ static int unwind_exec_pop_subset_r0_to_r3(struct unwind_ctrl_block *ctrl, ...@@ -308,6 +308,29 @@ static int unwind_exec_pop_subset_r0_to_r3(struct unwind_ctrl_block *ctrl,
return URC_OK; return URC_OK;
} }
static unsigned long unwind_decode_uleb128(struct unwind_ctrl_block *ctrl)
{
unsigned long bytes = 0;
unsigned long insn;
unsigned long result = 0;
/*
* unwind_get_byte() will advance `ctrl` one instruction at a time, so
* loop until we get an instruction byte where bit 7 is not set.
*
* Note: This decodes a maximum of 4 bytes to output 28 bits data where
* max is 0xfffffff: that will cover a vsp increment of 1073742336, hence
* it is sufficient for unwinding the stack.
*/
do {
insn = unwind_get_byte(ctrl);
result |= (insn & 0x7f) << (bytes * 7);
bytes++;
} while (!!(insn & 0x80) && (bytes != sizeof(result)));
return result;
}
/* /*
* Execute the current unwind instruction. * Execute the current unwind instruction.
*/ */
...@@ -361,7 +384,7 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl) ...@@ -361,7 +384,7 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
if (ret) if (ret)
goto error; goto error;
} else if (insn == 0xb2) { } else if (insn == 0xb2) {
unsigned long uleb128 = unwind_get_byte(ctrl); unsigned long uleb128 = unwind_decode_uleb128(ctrl);
ctrl->vrs[SP] += 0x204 + (uleb128 << 2); ctrl->vrs[SP] += 0x204 + (uleb128 << 2);
} else { } else {
......
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
/** /*
* arch/arm/mac-sa1100/jornada720_ssp.c * arch/arm/mac-sa1100/jornada720_ssp.c
* *
* Copyright (C) 2006/2007 Kristoffer Ericson <Kristoffer.Ericson@gmail.com> * Copyright (C) 2006/2007 Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
...@@ -26,6 +26,7 @@ static unsigned long jornada_ssp_flags; ...@@ -26,6 +26,7 @@ static unsigned long jornada_ssp_flags;
/** /**
* jornada_ssp_reverse - reverses input byte * jornada_ssp_reverse - reverses input byte
* @byte: input byte to reverse
* *
* we need to reverse all data we receive from the mcu due to its physical location * we need to reverse all data we receive from the mcu due to its physical location
* returns : 01110111 -> 11101110 * returns : 01110111 -> 11101110
...@@ -46,6 +47,7 @@ EXPORT_SYMBOL(jornada_ssp_reverse); ...@@ -46,6 +47,7 @@ EXPORT_SYMBOL(jornada_ssp_reverse);
/** /**
* jornada_ssp_byte - waits for ready ssp bus and sends byte * jornada_ssp_byte - waits for ready ssp bus and sends byte
* @byte: input byte to transmit
* *
* waits for fifo buffer to clear and then transmits, if it doesn't then we will * waits for fifo buffer to clear and then transmits, if it doesn't then we will
* timeout after <timeout> rounds. Needs mcu running before its called. * timeout after <timeout> rounds. Needs mcu running before its called.
...@@ -77,6 +79,7 @@ EXPORT_SYMBOL(jornada_ssp_byte); ...@@ -77,6 +79,7 @@ EXPORT_SYMBOL(jornada_ssp_byte);
/** /**
* jornada_ssp_inout - decide if input is command or trading byte * jornada_ssp_inout - decide if input is command or trading byte
* @byte: input byte to send (may be %TXDUMMY)
* *
* returns : (jornada_ssp_byte(byte)) on success * returns : (jornada_ssp_byte(byte)) on success
* : %-ETIMEDOUT on timeout failure * : %-ETIMEDOUT on timeout failure
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
@ @
ENTRY(do_vfp) ENTRY(do_vfp)
mov r1, r10 mov r1, r10
mov r3, r9 str lr, [sp, #-8]!
b vfp_entry add r3, sp, #4
str r9, [r3]
bl vfp_entry
ldr pc, [sp], #8
ENDPROC(do_vfp) ENDPROC(do_vfp)
...@@ -172,13 +172,14 @@ vfp_hw_state_valid: ...@@ -172,13 +172,14 @@ vfp_hw_state_valid:
@ out before setting an FPEXC that @ out before setting an FPEXC that
@ stops us reading stuff @ stops us reading stuff
VFPFMXR FPEXC, r1 @ Restore FPEXC last VFPFMXR FPEXC, r1 @ Restore FPEXC last
mov sp, r3 @ we think we have handled things
pop {lr}
sub r2, r2, #4 @ Retry current instruction - if Thumb sub r2, r2, #4 @ Retry current instruction - if Thumb
str r2, [sp, #S_PC] @ mode it's two 16-bit instructions, str r2, [sp, #S_PC] @ mode it's two 16-bit instructions,
@ else it's one 32-bit instruction, so @ else it's one 32-bit instruction, so
@ always subtract 4 from the following @ always subtract 4 from the following
@ instruction address. @ instruction address.
mov lr, r3 @ we think we have handled things
local_bh_enable_and_ret: local_bh_enable_and_ret:
adr r0, . adr r0, .
mov r1, #SOFTIRQ_DISABLE_OFFSET mov r1, #SOFTIRQ_DISABLE_OFFSET
...@@ -209,8 +210,9 @@ skip: ...@@ -209,8 +210,9 @@ skip:
process_exception: process_exception:
DBGSTR "bounce" DBGSTR "bounce"
mov sp, r3 @ setup for a return to the user code.
pop {lr}
mov r2, sp @ nothing stacked - regdump is at TOS mov r2, sp @ nothing stacked - regdump is at TOS
mov lr, r3 @ setup for a return to the user code.
@ Now call the C code to package up the bounce to the support code @ Now call the C code to package up the bounce to the support code
@ r0 holds the trigger instruction @ r0 holds the trigger instruction
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment