Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3136601pxb; Mon, 9 Nov 2020 03:41:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1kHUz7kvLL025RkNMi5jhQHlGtNUlGg8Rl0B4hCaEFlb/clh9f5PiCPx9gPameQn0f3H3 X-Received: by 2002:a17:906:2a09:: with SMTP id j9mr14202944eje.355.1604922113187; Mon, 09 Nov 2020 03:41:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604922113; cv=none; d=google.com; s=arc-20160816; b=dSpq3ryc05szsq94lHELxxkDSFhdQ4igO9IeR2Fjlfmd1VTUzqtvRFvxANFsnN7mpi AS1fjW0lfJRLJJ4Fv+elI1AnK8nY+h0RuSeAv7JwMTlgn/i9/6bWDvfJlF7GSzpc64+9 BgxZncRRFEUzzBQ64x80jpBTOe7jhemdwpYHVWSJRW1eXF+Em6TY9QDSY0RRou+nE3/M 3NScmqICMdO5incvTPEZU+RPWyo63eWuEqdBUTfwWHpX1vstQBazcYPB/WTDV2IK0bpk YWDNQ0agELFO27xrh2Q7I70BDZ+GbbD3Dq5MoslWdLodGDLWTkULyzuhqsvslAalrDkQ B3BA== 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=9OHqVwmdHbsEbVYkhzfrXC3pmS5HWpDM4H+UgWkOTQ0=; b=qAvRaFQbTp/m/pSZmuSzBIHdqeedQJQe+l2gLPrqm3VtJ2XfH8mJAwDL2OoFJ6pM8U 4INW7v5DIUqVmsJLMLyukku8N4+hrafuSY0aihh7KYcT3Zqau7gFzFuKlEVBdDZ6g5Hd oIs+JhgdvsLtNJOWpPC1iFP3btV4xAmIHwGYZ4vZMk55StP0GpUAXYyrOuIHOgGWg1UD 91kB3xkFq5BwGXDa5XHjfCCvVwtlMV7YXmgFuwwvaeXOzfaR/x23poChSHJwZr67n6I1 U0WCG7dpMixFKyWXKwywS+NaGR0x0QCe1F0rRzZeQAhMJqJqmG860vCoyjD0izsPH1K3 QwnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=KiIaN07L; 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 w17si6557063ejc.622.2020.11.09.03.41.30; Mon, 09 Nov 2020 03:41:53 -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=KiIaN07L; 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 S1729750AbgKILhH (ORCPT + 99 others); Mon, 9 Nov 2020 06:37:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729470AbgKILcr (ORCPT ); Mon, 9 Nov 2020 06:32:47 -0500 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67A1BC0613CF for ; Mon, 9 Nov 2020 03:32:47 -0800 (PST) Received: by mail-wr1-x442.google.com with SMTP id b8so8316036wrn.0 for ; Mon, 09 Nov 2020 03:32: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=9OHqVwmdHbsEbVYkhzfrXC3pmS5HWpDM4H+UgWkOTQ0=; b=KiIaN07Lql/jsar+Pt0YQtblLh2tpYdnoBcMlX29cx4cFAvQMzXKXI+pjxYH3unmqQ B+zG3cP1r+fCsNjx8DeGaHDo8SboteYbmIYfeUizmQMZYo3cUYcCibjZvKN/CLLT+zDq aKmyD15Ykq4sM0Shfe+MpPiQuhryzEAul/E++NLOoq2+NdMg1H5kTt1jdgL5Iw2CCCl5 3wAxMjWaTyo1od7ojAO3Q599m4BH9FRsMUHGtqQza1xEDXjT4Un/SuuyGuroklXuacGI gXj7WBqwBRoBphWrGfXGFX1zCd7zDb/0rhYJ+C2fuz932FB5h14Dh/1Vxl+/opRVXRqN +hKg== 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=9OHqVwmdHbsEbVYkhzfrXC3pmS5HWpDM4H+UgWkOTQ0=; b=lVfEPp9Su+owDX3KY7fTOHh8ox+GNMn1ThZk9Ie6uVhl07I1tkE7u+difwOTidAFN3 IG1xo9PjQexXR8oO8AhaKEpBlI44Lrmjt5Hxe0sHq7KDRbo25OKw+QK0N3bor7NZ/lT/ 5NDpHiBxqBXbJm4VfxwTOMTt7lIWbnX5MELobiFoH96nvle7UbYJcOKSjWwUwN7+f61l VuUcrfy+FWKczgvB8cHDnu4bnH/5j93dEQGX6mwBgv09XneotB/5dIphOkbTzVCKu/2m esLwGRw/tok0eDGq3TDoEDaHpJDL1Fk0mTV4bNuD/LPH6RBxYOnTLuM4a4stM2Nbe3Ue UtpA== X-Gm-Message-State: AOAM532KjDEkk4SUIruWISWExCf9mBlWTnoJQ4MqWZUbNUWVzb5R8ZEK yug4rZ0k/BjTpIxCiYoR7LdbkQ== X-Received: by 2002:adf:804b:: with SMTP id 69mr17407493wrk.274.1604921565923; Mon, 09 Nov 2020 03:32:45 -0800 (PST) Received: from localhost ([2a01:4b00:8523:2d03:209d:10b7:c480:3e1f]) by smtp.gmail.com with ESMTPSA id v6sm14976826wrb.53.2020.11.09.03.32.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Nov 2020 03:32: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 , Andrew Walbran , kernel-team@android.com, David Brazdil Subject: [PATCH v1 03/24] arm64: Move MAIR_EL1_SET to asm/memory.h Date: Mon, 9 Nov 2020 11:32:12 +0000 Message-Id: <20201109113233.9012-4-dbrazdil@google.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109113233.9012-1-dbrazdil@google.com> References: <20201109113233.9012-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.2.222.g5d2a92d10f8-goog