From patchwork Wed Jan 24 23:26:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 125754 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp743790ljf; Wed, 24 Jan 2018 15:57:33 -0800 (PST) X-Google-Smtp-Source: AH8x224tT29LGY1CiJLVH3IMZx4GhiH8fOazh9IlHCYtFagLZpeM4qEocXbNnDDXmnG7SumzqUAU X-Received: by 10.13.247.2 with SMTP id h2mr6587701ywf.443.1516838253769; Wed, 24 Jan 2018 15:57:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516838253; cv=none; d=google.com; s=arc-20160816; b=WXhkJUC5wFRGATvp8NNllvec5XJgJX62Did7Tc+10oIcUmmO/pPTBHh5PzLQiAMn6P RE8AodXH5uPBA0iyhYCm56WHUjhKrdnsy8lD9pnXGBF4GxAeaAL9erSAYd1p6zS+w0dR ekjli5zVtTif/V9uhZDjWHTRWOzML6fAR9JyQXrDPXdvHxyZR30nUByoXdCGcMZwT2rH Y/DlfaMUIxIZ5aESK2LtaFQLBoVxaWva6eo8j+3c4VmPNKPoRwsGX/V7UwvL27v3hS3n 4VXyhDw3ikpHpMN8ikjhFAvoBCRU753UT9KRxdzRrlAC4O/4k0C+FoAlqhg5gAocKQYT OCVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=N3yFY3KLuN7s5EJ+56CkqrbPrG+d6aGgbHxBlCsk0dI=; b=OaLL+Ad51e36osY0Bs0oF35MgAkSWruaQNgywct3oY4zbvPiJkoOZk7wpqTwo6no++ WFUlWbjo33acA8vikf9ab3E6+ENXe9oEx8GlVR575cUQUsFY5/3KV6E5K62sJSW96WYa BJcMHgyVdQxbbvHtWR+vcz98Zp4dAwqOwFnlTkW2Nsa0Y1UcsU/732LgJlSCQsHqSjwB ohYbTgRTiSIZEKGDku2bC2d9bRqTwiSVDw9UsBwvYJdvZyTOdjJuRQKWx0VGRHDTfMi/ 78N6iGdXmiCeSkThSoC9DmT1VHk2nOUqKO0tvG+Y6jxf7jUa0klZw3MHVSXo+YrnoM9Y XmwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Kwoc938a; 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 q4si242907ywe.562.2018.01.24.15.57.33 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 24 Jan 2018 15:57:33 -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=Kwoc938a; 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]:55433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeUv7-00049L-6v for patch@linaro.org; Wed, 24 Jan 2018 18:57:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeURt-000513-L7 for qemu-devel@nongnu.org; Wed, 24 Jan 2018 18:27:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeURs-00024i-NB for qemu-devel@nongnu.org; Wed, 24 Jan 2018 18:27:21 -0500 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:45854) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eeURs-00023f-H1 for qemu-devel@nongnu.org; Wed, 24 Jan 2018 18:27:20 -0500 Received: by mail-pf0-x243.google.com with SMTP id a88so4351197pfe.12 for ; Wed, 24 Jan 2018 15:27:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=N3yFY3KLuN7s5EJ+56CkqrbPrG+d6aGgbHxBlCsk0dI=; b=Kwoc938aukh84nXcM0ZPKBJXC+l+NX8hQZq4L0Q/1XEvZf74IoLpYscSNjgoiD+pL0 o9j4CRnysFUU1hubbN7A3ys2D2OhdKDhRoL51ZbYSuVALz/S17itvgScKfCUvjadxitd IbCBcm6YbTJFZWwyTTEu+X/wVKfmms2a7q2Aw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=N3yFY3KLuN7s5EJ+56CkqrbPrG+d6aGgbHxBlCsk0dI=; b=K/hU/tv5oGEY+BBH/DzLip/ZVpacmJ4+OU4wTyflul35OWa2lGb0MUEggRJhXlUJLo aOTDzwZZPB04JLYfi4uLT+ouFZuA29JP+u1G3ZXRPrwHLQEyfRmUSM8NrcPjrCL616i3 DUYs2oOQds3qUp5HzyERjEfem8ZdboFoA/vT4qTLj4nWbrgLjddzSDRNawcap2+LnmDA C7Jo2gpZXiobzYaOzTXwLgLnwJsiXI9s9diGF27fy1hZ5HScZqBTgHiq7LQXQ2ck48xd U6rCY0cviVMv+rncKAY/wmndSDvYr9dPi8mezIA3g4bK8CYNNpsCmxX+JLGZHXKtcYjA kpHQ== X-Gm-Message-State: AKwxyteiia1UhBPMseHHMI/Ayp/JQrzhrZp6PBTziGvccEBBcc+mmouJ eqCt5L49mClHnBFUU2nChDs4eWZMxzA= X-Received: by 2002:a17:902:4c88:: with SMTP id b8-v6mr7853207ple.233.1516836439313; Wed, 24 Jan 2018 15:27:19 -0800 (PST) Received: from cloudburst.twiddle.net (174-21-6-47.tukw.qwest.net. [174.21.6.47]) by smtp.gmail.com with ESMTPSA id z19sm9760028pfh.185.2018.01.24.15.27.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2018 15:27:18 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 24 Jan 2018 15:26:14 -0800 Message-Id: <20180124232625.30105-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180124232625.30105-1-richard.henderson@linaro.org> References: <20180124232625.30105-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:c00::243 Subject: [Qemu-devel] [PATCH v3 34/45] 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: , 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 d54d830196..1a9bbe268a 100644 --- a/target/hppa/int_helper.c +++ b/target/hppa/int_helper.c @@ -156,7 +156,7 @@ void hppa_cpu_do_interrupt(CPUState *cs) vaddr = hppa_form_gva_psw(old_psw, iasq_f, vaddr); t = hppa_get_physical_address(env, vaddr, 0, - MMU_INST_FETCH, + 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 81bcbe45db..4decfca407 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))) {