Commit 7e3f1223 authored by Thomas Roth's avatar Thomas Roth Committed by Peter Maydell
Browse files

target/arm: v8m: Ensure IDAU is respected if SAU is disabled



The current behavior of v8m_security_lookup in helper.c only checks whether the
IDAU specifies a higher security if the SAU is enabled. If SAU.ALLNS is set to
1, this will lead to addresses being treated as non-secure, even though the
IDAU indicates that they must be secure.

This patch changes the behavior to also check the IDAU if the SAU is currently
disabled.

(This brings the behaviour here into line with the v8M Arm ARM
SecurityCheck() pseudocode.)

Signed-off-by: default avatarThomas Roth <code@stacksmashing.net>
Message-id: CAGGekkuc+-tvp5RJP7CM+Jy_hJF7eiRHZ96132sb=hPPCappKg@mail.gmail.com
Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
[PMM: added pseudocode ref to the commit message, fixed comment style]
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parent 36d820af
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -11078,8 +11078,11 @@ static void v8m_security_lookup(CPUARMState *env, uint32_t address,
                }
            }
        }
        break;
    }

        /* The IDAU will override the SAU lookup results if it specifies
    /*
     * The IDAU will override the SAU lookup results if it specifies
     * higher security than the SAU does.
     */
    if (!idau_ns) {
@@ -11088,8 +11091,6 @@ static void v8m_security_lookup(CPUARMState *env, uint32_t address,
            sattrs->nsc = idau_nsc;
        }
    }
        break;
    }
}

static bool pmsav8_mpu_lookup(CPUARMState *env, uint32_t address,