Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1523623pxb; Wed, 4 Nov 2020 11:13:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJywd0wWXgAyKaZK835jBedaxjrtSEjHLhdF8ov+bo5XzZRELSPlkzo8lI81JAalCqW6jBxO X-Received: by 2002:a17:906:13d6:: with SMTP id g22mr18369105ejc.240.1604517204496; Wed, 04 Nov 2020 11:13:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604517204; cv=none; d=google.com; s=arc-20160816; b=w5m5KtQi22wdFU5gFi7HwxpHUPNFTeyK3sBU+ay/S6zCzQO04c/9qs0I0m+8LkH1n3 rjOtrpKOw09uEyf7UEQOEde5IAQ1wtZQ/BYAXMfH2OdWNWj2hBAIT2sYAtujKwg5S4yv wn21NKD4+Y6c5KKtAUTcGbMDjB0A9psTjezvs3nM+SYJuI7XJ35Lb6tP5N0rTizOI0+O MQN0aP45Ise5sb9ubvmkVSNO4LodGGNTHGg+/ciouRmjDJN1L0AOa5Pj31sAkWF6psff vk/FAwNHtMylQqq7QwQ9iiHjz0bLY8MfVTvV1CJoPrk+mu0L8ONcZjArOuonRwd+Vj2r yOQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=selpDVExPrV+IgPEKGIlRfie/i9lgMV2qEZhs31ItAo=; b=N43TKC4DEw81sI+ZVcW7JaLpxdcKd5uf7j72Ixff0ajNHtCKiP6kOikAUo2E1Bs16N crIjw0kAT9no7AVkQXDcSw/XXlUa1EK0dZqrGTHbWlcZkJxxbQcANk8fCauzpHxsrGO9 AgY35gqpw4r9UYS8W5Au3Fs3M+mMT3H+iEQ7MJIxQuy/Ub51XmvnrdXQE9/gai1qjfS+ 40nINNXQRgYjdwDMJxjeXUbXOyUuImDnjo/tuX/GdkRCh+LjmWGH41WwYZu0m6H1lL20 trJVbMVC0Zvu6/OK4+t56qWLzekTVXbryec1AibzH59sC+7nkG7bywO7ztiJ9c17ZDoh H4ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="h5c/xuFD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o15si1913322ejm.459.2020.11.04.11.13.01; Wed, 04 Nov 2020 11:13:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="h5c/xuFD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732431AbgKDSgu (ORCPT + 99 others); Wed, 4 Nov 2020 13:36:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732412AbgKDSgs (ORCPT ); Wed, 4 Nov 2020 13:36:48 -0500 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA66EC0613D4 for ; Wed, 4 Nov 2020 10:36:47 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id g12so23120811wrp.10 for ; Wed, 04 Nov 2020 10:36:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=selpDVExPrV+IgPEKGIlRfie/i9lgMV2qEZhs31ItAo=; b=h5c/xuFDGxhQNOOJxFYmZXPnLJyC4mt4eevQqa2BS/KDBE+R4+ZWYl3fiVp6+6GKml rdXluqt6BqUFOHQomC+HPz2nWSen/qcJZ0oTOtl2BKcUfsVXlAZy5wrHtufxBkAIWslB HCw8iLlb8kPY1W0YDvNIq7lH1izzFXSlNt9V7Ci06lt/x6qUvsjzXw6RN2ieTU+6G5qV /cCFrPXpeltx/hzuo9u7iu6TM54yUhX2W4sCEQjs+fR0UKJfMcmM+WiVu0qBnhnPuGND 9WjCSGx4PewL3YT53jbPkiQxHS63x1gGFZWbB7kh0Qe68aFM4yJTGc8g1TYn/PldTPi0 9YWw== 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:mime-version:content-transfer-encoding; bh=selpDVExPrV+IgPEKGIlRfie/i9lgMV2qEZhs31ItAo=; b=DZVU3iJjDV0K4zwFTH8c8zDFCQLGv6kgLB36tfVSeoFEw0M5zy/Tb+KKlBYapdtb2b I+9QXJVU5URybUW1HomtetnNsnVl8dmJN9982CSm/+F4+DQ9xszvYYImuQ0HL87Fro3E 7qwjDsHtDZt4k1Z60Y1Yx32V98OshGaNNsGFv+ciUfsRuLYO21zjdyLbIHLZ5wOs8zwq TuZHQYhKtSj6qBWLExpbh9nGZ9dK4V/Xok4B7HxrXbUalRODFhhZTduW0lRw1DKICGqM +bfo6t3Sg4FmSu04PhPsx7T/r5GkRzq5bEo5t2YdIDJYhxoYTelHqTRtW74I6VUlXcDQ kMWw== X-Gm-Message-State: AOAM533v2gHifyZp8iyre7gfHz3NzmhVp/OzHqBPZBjnbmIHKodFr2J4 azCtQAAe2Hh/c35CKMGtjF29kp9bOvjRzySu X-Received: by 2002:adf:edcf:: with SMTP id v15mr31926989wro.291.1604515006429; Wed, 04 Nov 2020 10:36:46 -0800 (PST) Received: from localhost ([2a01:4b00:8523:2d03:c8d2:30f2:53c6:bc2]) by smtp.gmail.com with ESMTPSA id u15sm3719292wrm.77.2020.11.04.10.36.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Nov 2020 10:36:45 -0800 (PST) From: David Brazdil To: kvmarm@lists.cs.columbia.edu Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Catalin Marinas , Will Deacon , Dennis Zhou , Tejun Heo , Christoph Lameter , Mark Rutland , Lorenzo Pieralisi , Quentin Perret , Andrew Scull , kernel-team@android.com, David Brazdil Subject: [RFC PATCH 04/26] arm64: Move MAIR_EL1_SET to asm/memory.h Date: Wed, 4 Nov 2020 18:36:08 +0000 Message-Id: <20201104183630.27513-5-dbrazdil@google.com> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201104183630.27513-1-dbrazdil@google.com> References: <20201104183630.27513-1-dbrazdil@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org KVM currently initializes MAIR_EL2 to the value of MAIR_EL1. In preparation for initializing MAIR_EL2 before MAIR_EL1, move the constant into a shared header file. Signed-off-by: David Brazdil --- arch/arm64/include/asm/memory.h | 13 +++++++++++++ arch/arm64/mm/proc.S | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index cd61239bae8c..aca00737e771 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -152,6 +152,19 @@ #define MT_S2_FWB_NORMAL 6 #define MT_S2_FWB_DEVICE_nGnRE 1 +/* + * Default MAIR_EL1. MT_NORMAL_TAGGED is initially mapped as Normal memory and + * changed during __cpu_setup to Normal Tagged if the system supports MTE. + */ +#define MAIR_EL1_SET \ + (MAIR_ATTRIDX(MAIR_ATTR_DEVICE_nGnRnE, MT_DEVICE_nGnRnE) | \ + MAIR_ATTRIDX(MAIR_ATTR_DEVICE_nGnRE, MT_DEVICE_nGnRE) | \ + MAIR_ATTRIDX(MAIR_ATTR_DEVICE_GRE, MT_DEVICE_GRE) | \ + MAIR_ATTRIDX(MAIR_ATTR_NORMAL_NC, MT_NORMAL_NC) | \ + MAIR_ATTRIDX(MAIR_ATTR_NORMAL, MT_NORMAL) | \ + MAIR_ATTRIDX(MAIR_ATTR_NORMAL_WT, MT_NORMAL_WT) | \ + MAIR_ATTRIDX(MAIR_ATTR_NORMAL, MT_NORMAL_TAGGED)) + #ifdef CONFIG_ARM64_4K_PAGES #define IOREMAP_MAX_ORDER (PUD_SHIFT) #else diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index 23c326a06b2d..25ff21b3a1c6 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S @@ -45,19 +45,6 @@ #define TCR_KASAN_FLAGS 0 #endif -/* - * Default MAIR_EL1. MT_NORMAL_TAGGED is initially mapped as Normal memory and - * changed during __cpu_setup to Normal Tagged if the system supports MTE. - */ -#define MAIR_EL1_SET \ - (MAIR_ATTRIDX(MAIR_ATTR_DEVICE_nGnRnE, MT_DEVICE_nGnRnE) | \ - MAIR_ATTRIDX(MAIR_ATTR_DEVICE_nGnRE, MT_DEVICE_nGnRE) | \ - MAIR_ATTRIDX(MAIR_ATTR_DEVICE_GRE, MT_DEVICE_GRE) | \ - MAIR_ATTRIDX(MAIR_ATTR_NORMAL_NC, MT_NORMAL_NC) | \ - MAIR_ATTRIDX(MAIR_ATTR_NORMAL, MT_NORMAL) | \ - MAIR_ATTRIDX(MAIR_ATTR_NORMAL_WT, MT_NORMAL_WT) | \ - MAIR_ATTRIDX(MAIR_ATTR_NORMAL, MT_NORMAL_TAGGED)) - #ifdef CONFIG_CPU_PM /** * cpu_do_suspend - save CPU registers context -- 2.29.1.341.ge80a0c044ae-goog