From patchwork Mon Sep 11 13:52:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 112189 Delivered-To: patches@linaro.org Received: by 10.100.153.131 with SMTP id 3csp5825732pji; Mon, 11 Sep 2017 06:51:50 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBA1Xhx9w2IR+AgQ3L8TlctTXAA0KZv+dHk5y0dyW386m4HAq58PiWs0fnRHBquL+AvN0CK X-Received: by 10.25.199.207 with SMTP id x198mr4049601lff.182.1505137910073; Mon, 11 Sep 2017 06:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505137910; cv=none; d=google.com; s=arc-20160816; b=KXz8DMtcwmDRga/VF54TuOfEU4VuMUqHXnHavzBNNK/kh+8LAU4G/eC+JUW1PbOQDn sA2/Z7zQoAgoYW3fYh0HtCUYyOOgvwPZEcngS1m29Qa/FqvbupVIvWElpU24Y3E9cbfX nyCFc1wUTFW7v3FKU+iliqB+KmSyAGqzaXH3vHAauRvao0UufehnZW2HsCw0J/EU1K1h zk8muEci0SBA7jiFBThKUIoU+SEj3tjrheGHeFtVa7Szfv/lYiVPIQ76L/KOWvko+N3r P+D5VM+rxuVCs1IkMyInK6BYAtMCa/aaTMhk4x1dfvlQnDFXCI/eFBnK2LYOzQRAkSl3 O7Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=JWlZA0idTGOrOFxfvK6PWXZIQM8oXWoz2jdBs7Gmu4U=; b=n95Qh+ZAB5iaiznVIpke3FDSTEUuv1GnckyCV7SILj4zvV1ukVgYyB9VeFtUuFr3IZ Maz1uHk4xr7agn2FMnaneajHvIxf4mu4UVEsBxxJi9PzNBZ3SEp8usCvw0Xond6MynCe HVqKb53YHnDKcYrQr07OzHuisP0EGKgK5cFzOkgm/RPmCHoPcoLjTHz83K9H+hj9+WWB e1uZ3LsPUFgz/xxeYq8LL0T3VKXt0IF5Z5XavNivQv1IF3kIOq1dr0VWbBR4S954RRla kllPfqRDdXxZX/gKZYp61g2zeR4OkRZu3n6pE170M4eGinxh+f0ACOtxvWhucRkBaFoL QwnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id h13si1550870ljf.218.2017.09.11.06.51.49 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Sep 2017 06:51:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1drP7s-0007me-8q; Mon, 11 Sep 2017 14:51:48 +0100 From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH 5/7] target/arm: Remove unnecessary '| 0xf0000000' from do_v7m_exception_exit() Date: Mon, 11 Sep 2017 14:52:08 +0100 Message-Id: <1505137930-13255-6-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505137930-13255-1-git-send-email-peter.maydell@linaro.org> References: <1505137930-13255-1-git-send-email-peter.maydell@linaro.org> In do_v7m_exception_exit(), there's no need to force the high 4 bits of 'type' to 1 when calling v7m_exception_taken(), because we know that they're always 1 or we could not have got to this "handle return to magic exception return address" code. Remove the unnecessary ORs. Signed-off-by: Peter Maydell --- target/arm/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 Acked-by: Alistair Francis Reviewed-by: Richard Henderson diff --git a/target/arm/helper.c b/target/arm/helper.c index 1741e0d..fdd5cc6 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6306,7 +6306,7 @@ static void do_v7m_exception_exit(ARMCPU *cpu) */ env->v7m.cfsr[env->v7m.secure] |= R_V7M_CFSR_INVPC_MASK; armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE); - v7m_exception_taken(cpu, type | 0xf0000000); + v7m_exception_taken(cpu, type); qemu_log_mask(CPU_LOG_INT, "...taking UsageFault on existing " "stackframe: failed exception return integrity check\n"); return; @@ -6348,7 +6348,7 @@ static void do_v7m_exception_exit(ARMCPU *cpu) armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE); env->v7m.cfsr[env->v7m.secure] |= R_V7M_CFSR_INVPC_MASK; v7m_push_stack(cpu); - v7m_exception_taken(cpu, type | 0xf0000000); + v7m_exception_taken(cpu, type); qemu_log_mask(CPU_LOG_INT, "...taking UsageFault on new stackframe: " "failed exception return integrity check\n"); return;