From patchwork Fri Dec 29 06:31:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 122923 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4345283qgn; Thu, 28 Dec 2017 23:03:09 -0800 (PST) X-Google-Smtp-Source: ACJfBovsgLgZuxu0ts4OromQSfuyo90zdjhuqrsi/8tyfqUP5bN4p8W/3KW66rVboLVaeTxzZHMA X-Received: by 10.129.163.144 with SMTP id a138mr22662613ywh.238.1514530988982; Thu, 28 Dec 2017 23:03:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514530988; cv=none; d=google.com; s=arc-20160816; b=j8KJ3hY9FRdRzSZXAQKTBfcy0P4xnvyK1WPF68P0vUPYpn7ijTawuxVqWmDa09gH/+ XsGGFHUSb50/gXmi0K4mH87GuAR2fTQ8exfTR8dnrnAgS0gyBLKKbGWN2k7mabCrz6H/ KKcoWSYMMz8ulRSOzwSS8b/NkDPC8ZMB2OI0KqOGon55Y+y6RXwbdckoUV437Ov+VIBi qJ3uIjJNsN4fkwhK0K/MPY0kW95Sn6lzFVBiPy5vMmOXxXrKDzdQ4YpCp/VV8bbdM5Q0 Tsbv+x36VlQCtOQfAWAIw5Se1cw8tTou7XI9x1AoWWuWqkUJ9yZaFV0NWII25bmNPUHj OtPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=OsW7WXWA3vPnPbVumLykTyx4Yq9vIWzD5fZT2ziin/U=; b=njB85ekSSVY1WXMiiX033x1OgY+FtYRBa2YktrB4fZgHKGKoaPqLT4lqcZ+qUR5RWr sk/UWTG2JdYoyLFP82a+0sWoz0atggsKruWmjOsbS3aTh3FM/4XWtBreri8Hk6dlJYv6 FiHqUwaI0mRTHjfYMoJORnYcWxz3cZYhMXPTLOSY8W+eQFRbyPfhvCSa1CVMPvPpIMk8 4f0bfspquriuqTssTTsx4PtwbYsZrCQTdR1pI4qU3BDVyXMs7B2EcJyPNGrxP+mHLKAP WIHctOE/UAuaL4XrATC1rpTZNeeuCZ9c1qYFp8/KYO5qSK6nPlGSwAaiAIVhk0iBzoDf //vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=No2BKDGX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id b72si6833019ywe.271.2017.12.28.23.03.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 28 Dec 2017 23:03:08 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=No2BKDGX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57781 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUohA-0004po-Jz for patch@linaro.org; Fri, 29 Dec 2017 02:03:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUoDe-0003RI-DB for qemu-devel@nongnu.org; Fri, 29 Dec 2017 01:32:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eUoDd-0004vr-Hb for qemu-devel@nongnu.org; Fri, 29 Dec 2017 01:32:38 -0500 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:35319) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eUoDd-0004vD-Cj for qemu-devel@nongnu.org; Fri, 29 Dec 2017 01:32:37 -0500 Received: by mail-pl0-x241.google.com with SMTP id b96so22521399pli.2 for ; Thu, 28 Dec 2017 22:32:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OsW7WXWA3vPnPbVumLykTyx4Yq9vIWzD5fZT2ziin/U=; b=No2BKDGXFCOnoNoj5tlPJf7C0/rLSbO3DcAn26k2ISP9vDFeAXyGUp0JFm0akam8f9 4Y55poXWOYQPRzufGXpLNSUn+iJMESuORDILZIYqXZEcvHshq4V/Ep3Ap3M5/Lk0Ph8k vlbbqrIGk5Y/cl36PbMycPGnfszJo3FosQBKo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OsW7WXWA3vPnPbVumLykTyx4Yq9vIWzD5fZT2ziin/U=; b=gqc0AvXHHkfQFaJfIW6rA3EbA0f6PXRj7UhBL77guTfPO/Ub50tBnM7txEGmY4KUHM Jkc0/TkjswaB6orhaWDkyckUTM/sFVgRcbzsdzYwuy6FlTmpkGzJBAhqfX7EF/YP2s6B JOuRWj7A7LMB0Yr+sUFAjLD6o5rMYqdBmXKrmz4QUFzzx1BzZngSqAEt59Gt7QksrqwO v22Vq2toaT0EGJ80NY10ivWjLoIxJD0x451n3aDDIhnIgiqPd+zKSp2wEPUGXsUiq2VR UBUbjsopfA2yiTvbp0IAnm/jTX6QyaRRDdYZrt0Lnn23KvkzI35Cz7R9CBATjUBW3cAj 5Kcw== X-Gm-Message-State: AKGB3mIJxa+g4XF7EPaPaczPqBz8lySX2nSuXTo745ZEmhtrJ+b82lPh Kmqq2l7WXq03GWk6wavEq4E+k3RUg4M= X-Received: by 10.84.231.194 with SMTP id g2mr33664849pln.182.1514529156088; Thu, 28 Dec 2017 22:32:36 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-183-164.tukw.qwest.net. [97.113.183.164]) by smtp.gmail.com with ESMTPSA id c28sm76539063pfe.69.2017.12.28.22.32.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Dec 2017 22:32:35 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 28 Dec 2017 22:31:43 -0800 Message-Id: <20171229063145.29167-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171229063145.29167-1-richard.henderson@linaro.org> References: <20171229063145.29167-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::241 Subject: [Qemu-devel] [PATCH 36/38] target/hppa: Use MMU_DEBUG_LOAD when reloading for CR[IIR] X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: deller@gmx.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.14.3 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))) {