From patchwork Mon Jan 14 01:11:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 155403 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3121672jaa; Sun, 13 Jan 2019 17:25:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN4zhjx/QzuxSwHAV0+xXiIrjuIHjJs8kdo8w4UcMZkzTv8Ts9vOXwYbTS8WYpDa7PcxJjij X-Received: by 2002:adf:9c01:: with SMTP id f1mr22891277wrc.286.1547429149026; Sun, 13 Jan 2019 17:25:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547429149; cv=none; d=google.com; s=arc-20160816; b=BHb+ADIT9Dx0EGvVJTF976wEQOBrA6XmMEoNbYZmebM+aiSBAgLEJznDbFW1k1T1+l Mp0FLJas4/s5knzztUDAm122Bu4AOdd5nBmvw/TEL6qaa8Q06051fdlOWoO2XE4bILw0 rh8T+zRxSch3R0TF1mQX+Zocy4SJt6Ah5JOBMu2zPpDBSyHvaURGA8/HHCfj0cGkWtHU ellq0BuUXggNnGH8RgirwZBV1d1w0g+hDxZmvoTpGmleycFu8DCi8RBorxvOxuu4uCwc +H8d7bjb83CtEEYgyZd7RxXUm8ErG5hCEOSxawC80yB8BdA1sNz+bwK6vn/uZwUUk226 iq/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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; bh=6RIgZQ3EkiygyRv4b+cnL5vicFb0iiKuZZbxL+UVxSM=; b=jVZQiAajpGIvGBRp1IaC/6c8oEw4KLR6tcTqr3WnpHLygDIWwJqAfvN4f/5bkdRUWD ReHGiJZkjVEl1QdEt0HfAImzpamQw/u36AQChHMBkBOIweEN7HxCYiB+kDtx2CWxKjH3 lI7QD0BHJ2FQsONWjNnOjixPw27Rkp+H+bFY3TCExfcS90De8micmBeAegWWWvvMHES/ eMQnuQmPpqRBnEvfUSVdZNNLWSxQc+Cf3SQmcAaWqzdpCv6lOYABkAMgdHwA4N6+sDLR tYRBbWNv+/PR8/ZIZsSYt6OCPQ8f7aB3dCWriruyuPPMwYlGN8pBGXAgqPt3g6b/6EOH Bzlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=U0blRyQh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id y13si19644014wrr.124.2019.01.13.17.25.48 for (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 13 Jan 2019 17:25:49 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=U0blRyQh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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 ([127.0.0.1]:57541 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gir0d-00072c-Qi for patch@linaro.org; Sun, 13 Jan 2019 20:25:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giqnt-0006GG-Q2 for qemu-devel@nongnu.org; Sun, 13 Jan 2019 20:12:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giqnr-0001Et-II for qemu-devel@nongnu.org; Sun, 13 Jan 2019 20:12:37 -0500 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:35608) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1giqnr-00019N-8K for qemu-devel@nongnu.org; Sun, 13 Jan 2019 20:12:35 -0500 Received: by mail-pg1-x543.google.com with SMTP id s198so8751217pgs.2 for ; Sun, 13 Jan 2019 17:12:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6RIgZQ3EkiygyRv4b+cnL5vicFb0iiKuZZbxL+UVxSM=; b=U0blRyQhnYNnW7z0eO6Vt6oNYTPRtwgvrl4LL/gUWrKmqYhwjO4ky9GkXLBvPqjZIo KHV6g1JwHL3JCN03K5+Fx+8CXJ4KaITXJHAgqfrL3HPH1aLvcyijLgepvIk5QcE1eD3X fu5lJHedH4il3Q9BQMd9jGQ5GBd//mrhKEmrM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6RIgZQ3EkiygyRv4b+cnL5vicFb0iiKuZZbxL+UVxSM=; b=L4k7fcBdhA7mPoenZM8n2QxCuOccGpK1v0eGVMrKfX6VT0B8Wff9A4j0x+n55GWZa0 w5dvm3pFqt1JXaDUoqo5eJcDi3Wt8lf0s+bOvzBfVmbb57XuVCJJoSXmNEc7qNWMnOas 5hvsHzpuPTtJcgJ8ue5BMVaEMbTBS+qRTkizpfFB54yQD0rC0S5aRa9To2AtBPESem5b HMOl82XeOMKefDECk7vM9TVKFnpHZFbJpTQ6g+mMKxvqz8X4FCy+XpQFBz+ang/zJfYw 51AHreCrTeinFU3cVYT7unFfk4KfZ2Tj9QSKzPl9wSOXPjko/WqvXoCf6cXmre43Oqys Owmg== X-Gm-Message-State: AJcUukfQErd5yMiX7my74pCsy2ZTElcuRpP478GO+K49sPQUp7maC7ZD txplxUx93wXlJ59jX0QI27g5fmnRbGmySg== X-Received: by 2002:a63:9256:: with SMTP id s22mr20519846pgn.224.1547428342219; Sun, 13 Jan 2019 17:12:22 -0800 (PST) Received: from cloudburst.twiddle.net ([2001:8000:1064:7600:4085:6ae6:1bde:1c45]) by smtp.gmail.com with ESMTPSA id 5sm159602229pfz.149.2019.01.13.17.12.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 13 Jan 2019 17:12:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 14 Jan 2019 12:11:21 +1100 Message-Id: <20190114011122.5995-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190114011122.5995-1-richard.henderson@linaro.org> References: <20190114011122.5995-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 Subject: [Qemu-devel] [PATCH 16/17] target/arm: Enable MTE 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: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" ??? It does not yet work for system mode. Signed-off-by: Richard Henderson --- target/arm/cpu.c | 10 ++++++++++ target/arm/cpu64.c | 1 + 2 files changed, 11 insertions(+) -- 2.17.2 diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 5eff6995ee..aae30207b9 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -180,6 +180,16 @@ static void arm_cpu_reset(CPUState *s) * make no difference to the user-level emulation. */ env->cp15.tcr_el[1].raw_tcr = (3ULL << 37); + /* Enable MTE allocation tags. */ + env->cp15.hcr_el2 |= HCR_ATA; + env->cp15.scr_el3 |= SCR_ATA; + env->cp15.sctlr_el[1] |= SCTLR_ATA0; + /* Enable synchronous tag check failures. */ + env->cp15.sctlr_el[1] |= 1ull << 38; +#ifdef TARGET_AARCH64 + /* Set MTE seed to non-zero value, otherwise RandomTag fails. */ + env->cp15.rgsr_el1 = 0x123400; +#endif #else /* Reset into the highest available EL */ if (arm_feature(env, ARM_FEATURE_EL3)) { diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 64fbe75eca..49fdad69ce 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -374,6 +374,7 @@ static void aarch64_max_initfn(Object *obj) t = cpu->isar.id_aa64pfr1; t = FIELD_DP64(t, ID_AA64PFR1, BT, 1); + t = FIELD_DP64(t, ID_AA64PFR1, MTE, 2); cpu->isar.id_aa64pfr1 = t; t = cpu->isar.id_aa64mmfr1;