Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1757739rdb; Sun, 19 Nov 2023 09:01:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGrdRSzlSVUWZK86R9G5VEP5Rb2grt+vrDfgLnbBJ2vTMA4txSbdvTmDBEDKBVRwF7TK2GQ X-Received: by 2002:a05:6808:1403:b0:3ae:4cb2:fb43 with SMTP id w3-20020a056808140300b003ae4cb2fb43mr8097023oiv.21.1700413291529; Sun, 19 Nov 2023 09:01:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700413291; cv=none; d=google.com; s=arc-20160816; b=lui07/lq5H+pM6/jufpsTl1gEiXxUlvGKW5vrfnp4CnO06+pdjZw13P+INuaALsXG+ o8QSDKalT/Pasgo359pS6kVCPbyex/9HBXzLRZHKAdIKQQqv5zjNzhWfAjjrK3NQ/HKi SLLoDsmAvQqtEFUvYFV80j8ybloV2Z2hrSeHm5qJBnSu9ZnkgXRTII1th2za1YolqK1P uDAnxwiwOiNkLtX7G0N8cLvTtISVHaue27kMk2H3gfVSPvOnaMQivKKJQzfjadQT3+8X LWV2hoe9iAC0cq7NXwvtM0aQP/Vmrd/Cyt9819duLsVcOQdxWi6R9R6Ro075ChhbBkgv nukQ== 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; bh=5+hbVDFyCbmv3F1okSoFuOCDbz1RtFTz6PtiTTfR83Y=; fh=ON0oQ90Z4xnjbNCGsyMgiRbLR29nyOKvbeaw6TmRihk=; b=hrhhLqLrWrCiqsj/Mb3NrKk8EBkFMnyUJ7BTG0dro+LQwJ0gYjO/1OF/lAhkDhl93K qeu307I2tJX4qXmBV/rz88jB+5bseM15nUIsMf2GIrMm8ePMJMZUdtbgkfyMBY1NtUmp j6+RXvFlMzkFTFdYNzCPght/yjjMXA/I5ey2vQEQZmrPwQIxxjcrufInXXTKRIqSO0Dk gxDJvJg+ItuUBlbnfEeAJKc2EGyrELsOGJIJ39RVv8rRzW0c41IeoLmm7SYICVXODYmv G7hTNoOR2ysQmu7vKhMMkqCpAyrIRDogJV27Bh1JCi9WqDypIm/gn7nWmhRowrBt7COa f7xw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id c8-20020aca1c08000000b003b3b1649a9asi2099771oic.160.2023.11.19.09.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 09:01:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 57ADA8065002; Sun, 19 Nov 2023 09:00:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231805AbjKSRAB (ORCPT + 99 others); Sun, 19 Nov 2023 12:00:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231640AbjKSQ7f (ORCPT ); Sun, 19 Nov 2023 11:59:35 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A0E9710E5; Sun, 19 Nov 2023 08:59:14 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 90D471007; Sun, 19 Nov 2023 09:00:00 -0800 (PST) Received: from e121798.cable.virginm.net (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 64C553F6C4; Sun, 19 Nov 2023 08:59:09 -0800 (PST) From: Alexandru Elisei To: catalin.marinas@arm.com, will@kernel.org, oliver.upton@linux.dev, maz@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, arnd@arndb.de, akpm@linux-foundation.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, mhiramat@kernel.org, rppt@kernel.org, hughd@google.com Cc: pcc@google.com, steven.price@arm.com, anshuman.khandual@arm.com, vincenzo.frascino@arm.com, david@redhat.com, eugenis@google.com, kcc@google.com, hyesoo.yu@samsung.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH RFC v2 18/27] arm64: mte: Reserve tag block for the zero page Date: Sun, 19 Nov 2023 16:57:12 +0000 Message-Id: <20231119165721.9849-19-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231119165721.9849-1-alexandru.elisei@arm.com> References: <20231119165721.9849-1-alexandru.elisei@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 19 Nov 2023 09:00:46 -0800 (PST) On arm64, the zero page receives special treatment by having the tagged flag set on MTE initialization, not when the page is mapped in a process address space. Reserve the corresponding tag block when tag storage management is being activated. Signed-off-by: Alexandru Elisei --- arch/arm64/kernel/mte_tag_storage.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/kernel/mte_tag_storage.c b/arch/arm64/kernel/mte_tag_storage.c index 833480048170..a1cc239f7211 100644 --- a/arch/arm64/kernel/mte_tag_storage.c +++ b/arch/arm64/kernel/mte_tag_storage.c @@ -393,6 +393,8 @@ static int __init mte_tag_storage_activate_regions(void) totalcma_pages += range_len(tag_range); } + reserve_tag_storage(ZERO_PAGE(0), 0, GFP_HIGHUSER_MOVABLE); + return 0; out_disabled: -- 2.42.1