From patchwork Tue Apr 7 20:10:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 46860 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 24FCB214BA for ; Tue, 7 Apr 2015 20:10:40 +0000 (UTC) Received: by wiaa2 with SMTP id a2sf5780159wia.1 for ; Tue, 07 Apr 2015 13:10:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=dBBd3aIshRzWVb6daexQw3bCQTNH4A0khpaWgngNfM8=; b=JK9R+M7HOAh9LeT9UheV4UeJUDp8dY1tkOE+WB7uyLDckG5k0BIDG9YOT6mICvbX5g Zr+YL7Bro+HFzP5O/Jv42jQupVK3z/yqMdNcDZv16Fr/bht3A1T/7NMYV/PufL8DzLTt qQPYH1yxLI2tVrEWIXY+6bfdpCbDulRxjCqX1kUS9VoE03zc0ojee6ZHoRGk+vMY7vU7 2TBFSUABNFHyqzUSG00UQzWMPjzb6keM0khtSTDGC4NkjRqCU6ae8Bhy6h17TghoL5TR D5Em2HY1fhE7MYFyGi79TWx4PZOLX3ozYf5XpizZ+/5NeadGkGKHV2uOvRZEzlqRERBc 2VjA== X-Gm-Message-State: ALoCoQmpjKDThbYwPO9BIbk42PJo1u83aRRS6uFUWla3g2UYlh7u8WyHJpTWM0nqHdFNoN/g8NcM X-Received: by 10.152.37.101 with SMTP id x5mr2097445laj.5.1428437439358; Tue, 07 Apr 2015 13:10:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.68 with SMTP id la4ls90645lab.25.gmail; Tue, 07 Apr 2015 13:10:39 -0700 (PDT) X-Received: by 10.112.29.36 with SMTP id g4mr20425617lbh.56.1428437439220; Tue, 07 Apr 2015 13:10:39 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id v13si6937017lal.98.2015.04.07.13.10.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Apr 2015 13:10:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by layy10 with SMTP id y10so50864661lay.0 for ; Tue, 07 Apr 2015 13:10:39 -0700 (PDT) X-Received: by 10.112.162.167 with SMTP id yb7mr19448009lbb.76.1428437439142; Tue, 07 Apr 2015 13:10:39 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.67.65 with SMTP id l1csp637655lbt; Tue, 7 Apr 2015 13:10:38 -0700 (PDT) X-Received: by 10.194.62.198 with SMTP id a6mr43990997wjs.90.1428437438618; Tue, 07 Apr 2015 13:10:38 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id mm8si14702838wjc.36.2015.04.07.13.10.37 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 07 Apr 2015 13:10:38 -0700 (PDT) Received-SPF: none (google.com: pm215@archaic.org.uk does not designate permitted sender hosts) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1YfZov-0002E3-B0; Tue, 07 Apr 2015 21:10:01 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Greg Bellows , Paolo Bonzini , Richard Henderson , "Edgar E. Iglesias" , Peter Crosthwaite , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 14/14] target-arm: Check watchpoints against CPU security state Date: Tue, 7 Apr 2015 21:10:00 +0100 Message-Id: <1428437400-8474-15-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1428437400-8474-1-git-send-email-peter.maydell@linaro.org> References: <1428437400-8474-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Fix a TODO in bp_wp_matches() now that we have a function for testing whether the CPU is currently in Secure mode or not. Signed-off-by: Peter Maydell --- target-arm/op_helper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c index ce09ab3..d8a1054 100644 --- a/target-arm/op_helper.c +++ b/target-arm/op_helper.c @@ -600,8 +600,10 @@ static bool bp_wp_matches(ARMCPU *cpu, int n, bool is_wp) CPUARMState *env = &cpu->env; uint64_t cr; int pac, hmc, ssc, wt, lbn; - /* TODO: check against CPU security state when we implement TrustZone */ - bool is_secure = false; + /* Note that for watchpoints the check is against the CPU security + * state, not the S/NS attribute on the offending data access. + */ + bool is_secure = arm_is_secure(env); int access_el = arm_current_el(env); if (is_wp) {