From patchwork Mon Apr 27 15:20:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 47619 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 8BA9820553 for ; Mon, 27 Apr 2015 15:23:50 +0000 (UTC) Received: by wizk4 with SMTP id k4sf19252075wiz.2 for ; Mon, 27 Apr 2015 08:23:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding :subject:precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=6unKB1kFu4KZYolLVzkglMjjvxxE6E72NcgQzBzby2g=; b=UX612KyycBE/V7x70klzDGuc4VnsXLf6B8b4/rwKfbzRx8U3rz58WJtmaiOSzJ0LZc OEnhRIFLcANPOo4WwJVSSwLQrSjIjc6ygFZ9PMZQpYdUDXC9OOn26TmXm9+3IyETMP6e oY8iwqatuiSQ3mCRwJslmolvxsldIJmCrwIcIyhNubGiygffMj9/hbHSdNqS3IfU/mZF NPy1I464EMUfLUupDlTTMNS+efL4uItwUj9wrwGeQnBg0cxZNtvi7g6K6QE/k46BpWET /mFmvsRycIlbZG5cIebh8/9fxgWlBUmaxUgJk4dPORpz00PXMts9YOpZl9Zos+xd85aE R+QQ== X-Gm-Message-State: ALoCoQlb1/xEX6lcOC76ixirDolTkXv4RFHqIUyvR+uEpADfjbzL4Cl1+T96uHUVVfL4bdrYdnL0 X-Received: by 10.180.74.197 with SMTP id w5mr7450419wiv.5.1430148229895; Mon, 27 Apr 2015 08:23:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.239.130 with SMTP id vs2ls659214lac.97.gmail; Mon, 27 Apr 2015 08:23:49 -0700 (PDT) X-Received: by 10.152.25.167 with SMTP id d7mr10634208lag.108.1430148229737; Mon, 27 Apr 2015 08:23:49 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id v5si14996763laa.2.2015.04.27.08.23.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Apr 2015 08:23:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by laat2 with SMTP id t2so82594145laa.1 for ; Mon, 27 Apr 2015 08:23:49 -0700 (PDT) X-Received: by 10.153.8.167 with SMTP id dl7mr10593323lad.86.1430148229619; Mon, 27 Apr 2015 08:23:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp1341326lbt; Mon, 27 Apr 2015 08:23:48 -0700 (PDT) X-Received: by 10.55.52.129 with SMTP id b123mr13035123qka.34.1430148227911; Mon, 27 Apr 2015 08:23:47 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r64si13782079qha.27.2015.04.27.08.23.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 27 Apr 2015 08:23:47 -0700 (PDT) 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; Received: from localhost ([::1]:55766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymkst-0000XJ-1e for patch@linaro.org; Mon, 27 Apr 2015 11:23:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymkq8-0004Aa-MV for qemu-devel@nongnu.org; Mon, 27 Apr 2015 11:20:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ymkq6-0003aI-Qn for qemu-devel@nongnu.org; Mon, 27 Apr 2015 11:20:56 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:34016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymkq6-0003Ym-Jt for qemu-devel@nongnu.org; Mon, 27 Apr 2015 11:20:54 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Ymkpy-0008SA-6B for qemu-devel@nongnu.org; Mon, 27 Apr 2015 16:20:46 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 27 Apr 2015 16:20:42 +0100 Message-Id: <1430148045-32400-15-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1430148045-32400-1-git-send-email-peter.maydell@linaro.org> References: <1430148045-32400-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 14/17] target-arm: Check watchpoints against CPU security state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 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-bounces+patch=linaro.org@nongnu.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.46 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 Reviewed-by: Edgar E. Iglesias Reviewed-by: Alex Bennée --- 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 4a8c4e0..3df9c57 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) {