• P
    nvic: Implement "user accesses BusFault" SCS region behaviour · eb578a23
    Peter Maydell 提交于
    The ARMv7M architecture specifies that most of the addresses in the
    PPB region (which includes the NVIC, systick and system registers)
    are not accessible to unprivileged accesses, which should
    BusFault with a few exceptions:
     * the STIR is configurably user-accessible
     * the ITM (which we don't implement at all) is always
       user-accessible
    
    Implement this by switching the register access functions
    to the _with_attrs scheme that lets us distinguish user
    mode accesses.
    
    This allows us to pull the handling of the CCR.USERSETMPEND
    flag up to the level where we can make it generate a BusFault
    as it should for non-permitted accesses.
    
    Note that until the core ARM CPU code implements turning
    MEMTX_ERROR into a BusFault the registers will continue to
    act as RAZ/WI to user accesses.
    Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: NEdgar E. Iglesias <edgar.iglesias@xilinx.com>
    Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
    Message-id: 1501692241-23310-16-git-send-email-peter.maydell@linaro.org
    eb578a23
armv7m_nvic.c 34.7 KB