lkml.org 
[lkml]   [2019]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 3.16 143/305] xtensa: make sure bFLT stack is 16 byte aligned
    3.16.63-rc1 review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Max Filippov <jcmvbkbc@gmail.com>

    commit 0773495b1f5f1c5e23551843f87b5ff37e7af8f7 upstream.

    Xtensa ABI requires stack alignment to be at least 16. In noMMU
    configuration ARCH_SLAB_MINALIGN is used to align stack. Make it at
    least 16.

    This fixes the following runtime error in noMMU configuration, caused by
    interaction between insufficiently aligned stack and alloca function,
    that results in corruption of on-stack variable in the libc function
    glob:

    Caught unhandled exception in 'sh' (pid = 47, pc = 0x02d05d65)
    - should not happen
    EXCCAUSE is 15

    Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    ---
    arch/xtensa/include/asm/processor.h | 6 +++++-
    1 file changed, 5 insertions(+), 1 deletion(-)

    --- a/arch/xtensa/include/asm/processor.h
    +++ b/arch/xtensa/include/asm/processor.h
    @@ -25,7 +25,11 @@
    # error Linux requires the Xtensa Windowed Registers Option.
    #endif

    -#define ARCH_SLAB_MINALIGN XCHAL_DATA_WIDTH
    +/* Xtensa ABI requires stack alignment to be at least 16 */
    +
    +#define STACK_ALIGN (XCHAL_DATA_WIDTH > 16 ? XCHAL_DATA_WIDTH : 16)
    +
    +#define ARCH_SLAB_MINALIGN STACK_ALIGN

    /*
    * User space process size: 1 GB.
    \
     
     \ /
      Last update: 2019-02-03 14:53    [W:4.092 / U:0.152 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site