From nobody Thu Dec 18 17:53:21 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516110543087992.7999578053535; Tue, 16 Jan 2018 05:49:03 -0800 (PST) Received: from localhost ([::1]:36809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRbq-00039G-7p for importer@patchew.org; Tue, 16 Jan 2018 08:49:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebRNz-0008Gi-Qp for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:34:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebRNt-0002q4-Uf for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:34:43 -0500 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:45890) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebRNt-0002my-O8 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:34:37 -0500 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1ebRNj-0002pm-Do for qemu-devel@nongnu.org; Tue, 16 Jan 2018 13:34:27 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 13:33:57 +0000 Message-Id: <1516109659-1557-3-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516109659-1557-1-git-send-email-peter.maydell@linaro.org> References: <1516109659-1557-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 02/24] get_phys_addr_pmsav7: Support AP=0b111 for v7M 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 For PMSAv7, the v7A/R Arm ARM defines that setting AP to 0b111 is an UNPREDICTABLE reserved combination. However, for v7M this value is documented as having the same behaviour as 0b110: read-only for both privileged and unprivileged. Accept this value on an M profile core rather than treating it as a guest error and a no-access page. Reported-by: Andy Gross Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 1512742402-31669-1-git-send-email-peter.maydell@linaro.org --- target/arm/helper.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/target/arm/helper.c b/target/arm/helper.c index d1395f9..eb80f79 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -9272,6 +9272,13 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, u= int32_t address, case 6: *prot |=3D PAGE_READ | PAGE_EXEC; break; + case 7: + /* for v7M, same as 6; for R profile a reserved value = */ + if (arm_feature(env, ARM_FEATURE_M)) { + *prot |=3D PAGE_READ | PAGE_EXEC; + break; + } + /* fall through */ default: qemu_log_mask(LOG_GUEST_ERROR, "DRACR[%d]: Bad value for AP bits: 0x%" @@ -9290,6 +9297,13 @@ static bool get_phys_addr_pmsav7(CPUARMState *env, u= int32_t address, case 6: *prot |=3D PAGE_READ | PAGE_EXEC; break; + case 7: + /* for v7M, same as 6; for R profile a reserved value = */ + if (arm_feature(env, ARM_FEATURE_M)) { + *prot |=3D PAGE_READ | PAGE_EXEC; + break; + } + /* fall through */ default: qemu_log_mask(LOG_GUEST_ERROR, "DRACR[%d]: Bad value for AP bits: 0x%" --=20 2.7.4