From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4HcA-0004R6-6n for qemu-devel@nongnu.org; Wed, 02 Dec 2015 19:19:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4Hc8-00022x-SX for qemu-devel@nongnu.org; Wed, 02 Dec 2015 19:19:14 -0500 From: Michael Davidsaver Date: Wed, 2 Dec 2015 19:18:46 -0500 Message-Id: <1449101933-24928-20-git-send-email-mdavidsaver@gmail.com> In-Reply-To: <1449101933-24928-1-git-send-email-mdavidsaver@gmail.com> References: <1449101933-24928-1-git-send-email-mdavidsaver@gmail.com> Subject: [Qemu-devel] [PATCH v2 19/26] armv7m: mpu not allowed to map exception return codes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Peter Crosthwaite , qemu-arm@nongnu.org, Michael Davidsaver Always pass these through to be caught be by the unassigned handler. --- target-arm/helper.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target-arm/helper.c b/target-arm/helper.c index e42f6d0..a5adf2d 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -7106,6 +7106,15 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, uint32_t address, *phys_ptr = address; *prot = 0; + /* Magic exception codes returns always pass through the MPU + * to be trapped later in arm_v7m_unassigned_access() + */ + if (IS_M(env) && env->v7m.exception != 0 && address >= 0xfffffff0) { + *prot = PAGE_EXEC; + *fsr = 0; + return false; + } + if (regime_translation_disabled(env, mmu_idx)) { /* MPU disabled */ get_phys_addr_pmsav7_default(env, mmu_idx, address, prot); } else { /* MPU enabled */ -- 2.1.4