• V
    ARM: 8830/1: NOMMU: Toggle only bits in EXC_RETURN we are really care of · d8945878
    Vladimir Murzin 提交于
    [ Upstream commit 72cd4064fccaae15ab84d40d4be23667402df4ed ]
    
    ARMv8M introduces support for Security extension to M class, among
    other things it affects exception handling, especially, encoding of
    EXC_RETURN.
    
    The new bits have been added:
    
    Bit [6]	Secure or Non-secure stack
    Bit [5]	Default callee register stacking
    Bit [0]	Exception Secure
    
    which conflicts with hard-coded value of EXC_RETURN:
    
    In fact, we only care of few bits:
    
    Bit [3]	 Mode (0 - Handler, 1 - Thread)
    Bit [2]	 Stack pointer selection (0 - Main, 1 - Process)
    
    We can toggle only those bits and left other bits as they were on
    exception entry.
    
    It is basically, what patch does - saves EXC_RETURN when we do
    transition form Thread to Handler mode (it is first svc), so later
    saved value is used instead of EXC_RET_THREADMODE_PROCESSSTACK.
    Signed-off-by: NVladimir Murzin <vladimir.murzin@arm.com>
    Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
    Signed-off-by: NSasha Levin <sashal@kernel.org>
    d8945878
v7m.h 3.2 KB