Received: from eggs.gnu.org ([2001:4830:134:3::10]:60451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edT0q-0005xD-IU for qemu-devel@nongnu.org; Sun, 21 Jan 2018 22:43:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edT0p-0006oB-My for qemu-devel@nongnu.org; Sun, 21 Jan 2018 22:43:12 -0500 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:37886) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1edT0p-0006nC-Gf for qemu-devel@nongnu.org; Sun, 21 Jan 2018 22:43:11 -0500 Received: by mail-pf0-x242.google.com with SMTP id p1so6085338pfh.4 for ; Sun, 21 Jan 2018 19:43:11 -0800 (PST) From: Richard Henderson Date: Sun, 21 Jan 2018 19:42:08 -0800 Message-Id: <20180122034217.19593-35-richard.henderson@linaro.org> In-Reply-To: <20180122034217.19593-1-richard.henderson@linaro.org> References: <20180122034217.19593-1-richard.henderson@linaro.org> Subject: [Qemu-devel] [PULL 34/43] target/hppa: Use MMU_DEBUG_LOAD when reloading for CR[IIR] List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Bypass any tlb protection checks, as this is not a "real" access to memory per the architecture. Signed-off-by: Richard Henderson --- target/hppa/int_helper.c | 2 +- target/hppa/mem_helper.c | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c index ee72769544..e831944b8d 100644 --- a/target/hppa/int_helper.c +++ b/target/hppa/int_helper.c @@ -154,7 +154,7 @@ void hppa_cpu_do_interrupt(CPUState *cs) int prot, t; vaddr = hppa_form_gva_psw(old_psw, iasq_f, iaoq_f & -4); - t = hppa_get_physical_address(env, vaddr, 0, MMU_INST_FETCH, + t = hppa_get_physical_address(env, vaddr, 0, MMU_DEBUG_LOAD, &paddr, &prot); if (t >= 0) { /* We can't re-load the instruction. */ diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index a0a385cb54..4bdc4d77e5 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -131,12 +131,21 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, /* ??? Check PSW_P and ent->access_prot. This can remove PROT_WRITE. */ /* Map MMUAccessType to QEMU protection. */ - if (ifetch) { - a_prot = PROT_EXEC; - } else if (type == MMU_DATA_STORE) { - a_prot = PROT_WRITE; - } else { + switch (type) { + case MMU_DATA_LOAD: a_prot = PROT_READ; + break; + case MMU_DATA_STORE: + a_prot = PROT_WRITE; + break; + case MMU_INST_FETCH: + a_prot = PROT_EXEC; + break; + case MMU_DEBUG_LOAD: + ret = -1; + goto egress; + default: + g_assert_not_reached(); } if (unlikely(!(prot & a_prot))) { -- 2.14.3