From patchwork Fri Nov 4 01:10:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Collingbourne X-Patchwork-Id: 13031159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C16AC4332F for ; Fri, 4 Nov 2022 01:12:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:References: Mime-Version:Message-Id:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=slMJ0Ex4yarFsn9zoUQ1MDQnLvER840uNJeKUII9ngI=; b=Tqzr2hfSdw0lwt8+w99nq03mI7 TUfxixkLLrWhPfZOUCDoIAvuzDVgZZP+fzTaYyzOnubZcvLva2PxHrCQnKMi51SUtbWypZLmJMlDJ 6oTfxov7HvPyx+48O/3+S8Yz/ZwAHjvhGaIu/K+0qKUSgFUN4cLK6nG7DygFiiZz0TkSOg7xshItt FTw0qHORQk9EixWAWJ/KiLSGa5hvU3bDnEAbiGfzRvZ/s/wZVX70nZdTpSlpbSfeX/dazm00S4w/5 BZ041UJksKFDUEw0f39s1UQ3IYZCQ5aAO0DqgGd8DG7mSS15S3Od+OqX9rmnrtOhMS4Xu2Jm7c+kg hJE4eS6g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqlFD-0024gK-PY; Fri, 04 Nov 2022 01:11:39 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oqlEk-0024Y1-OH for linux-arm-kernel@lists.infradead.org; Fri, 04 Nov 2022 01:11:12 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-368036d93abso33477107b3.18 for ; Thu, 03 Nov 2022 18:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=rPYxlKSPJfSZtg3Q9jRN1rfy7iNW7lamdhzlzuPASYU=; b=EK2CfW/zJnZP96rUOilP2BktF4iuKcovvHFosZ0YeJeb3KtLyxVdRs+D+ycgLZnrDs /U1zBGKJpog9nLofxSIuFaqr2jVa7nL1vUHMZeBDya1ZBBx/l0v/fomj9VLAOL9zzhwn /Vpcsgo66C+hsDcSK7koi10JNVEgt5RMOa9zq41iBuvOQ9uSU0tZOW2vSe0r/Iq4/ojB sK2FOPfqs+DBQU+SdmnHptlRBihaxWXN/QOq4hb+Lj8xIpzIrJhxT+t9qkI/1UnsPe8M aaLWMX2hJsQBFMgxL5zDMHc5kkYNBCaDT1sNb4CTMZrELH7Yhw/M7cLA8ZI7KXAf6w3M 7SlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rPYxlKSPJfSZtg3Q9jRN1rfy7iNW7lamdhzlzuPASYU=; b=RwQ+LGuNI76LBdewJwkLX1XcHqonL7NzUWhRCZLXI4SRv6emG/8kZ2J/dInO6QXdyE a8SmAcOiy4MqZi4PzeV/jBfX7W6j/SVQ7m+EYA2XFt6g3f0LeUzBJH2tb8rzFyOOIZQ6 otqNyITaiyZneqIuohuaDoy/Wkbs8cbmIe5/NyTvI+0v2i70geH87kVqwmJ2VlGbi1Xb P/I7wAyCSVDdNx+rWMZa/1trwd0cnsVoS2c5tkPPbLV5EnCxbfrwdAfWyxy0o6Kxhj3s Ji+mvg+jw9fEbRboGrlzl1M4kyX8R+z5Orjgjio5/wyJR3z30/Aw0y3MI1iBp1DqXUaI Xo1A== X-Gm-Message-State: ACrzQf3sRa8FxHr0bdDXZ/4feJx7bPXwoXgj80cdBUUHNg0rtYXesEuv tjAdy6pnuFm4yl8xzGfz+x8hYCkFGxb+MkvGxW96S1gahitgTfrZOIeTi1T3Ji5/AA44vRIgKYQ z/+2vi+B7G2pvd2WQL7F0zx69zgx0GLQUcNHtwQCJeqHZnNcZ8C2/bTekWwwKzh/ywoGAMoOH X-Google-Smtp-Source: AMsMyM4lZ0RBt0V0qrjSEpyMHEmom8fBptSXrmNmTvgvtT7vTA4SH5SZJVwz3XGowF95qq3jHThGkOU= X-Received: from pcc-desktop.svl.corp.google.com ([2620:15c:2ce:200:2844:b0ec:e556:30d8]) (user=pcc job=sendgmr) by 2002:a81:5385:0:b0:370:b29:abb3 with SMTP id h127-20020a815385000000b003700b29abb3mr30405462ywb.2.1667524269214; Thu, 03 Nov 2022 18:11:09 -0700 (PDT) Date: Thu, 3 Nov 2022 18:10:37 -0700 In-Reply-To: <20221104011041.290951-1-pcc@google.com> Message-Id: <20221104011041.290951-5-pcc@google.com> Mime-Version: 1.0 References: <20221104011041.290951-1-pcc@google.com> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Subject: [PATCH v5 4/8] mm: Add PG_arch_3 page flag From: Peter Collingbourne To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Cc: Peter Collingbourne , Cornelia Huck , Catalin Marinas , Will Deacon , Marc Zyngier , Evgenii Stepanov , kvm@vger.kernel.org, Steven Price , Vincenzo Frascino X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221103_181110_814349_D2FC6E72 X-CRM114-Status: GOOD ( 12.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As with PG_arch_2, this flag is only allowed on 64-bit architectures due to the shortage of bits available. It will be used by the arm64 MTE code in subsequent patches. Signed-off-by: Peter Collingbourne Cc: Will Deacon Cc: Marc Zyngier Cc: Steven Price [catalin.marinas@arm.com: added flag preserving in __split_huge_page_tail()] Signed-off-by: Catalin Marinas Reviewed-by: Steven Price --- fs/proc/page.c | 1 + include/linux/kernel-page-flags.h | 1 + include/linux/page-flags.h | 1 + include/trace/events/mmflags.h | 1 + mm/huge_memory.c | 1 + 5 files changed, 5 insertions(+) diff --git a/fs/proc/page.c b/fs/proc/page.c index 882525c8e94c..6249c347809a 100644 --- a/fs/proc/page.c +++ b/fs/proc/page.c @@ -221,6 +221,7 @@ u64 stable_page_flags(struct page *page) u |= kpf_copy_bit(k, KPF_ARCH, PG_arch_1); #ifdef CONFIG_ARCH_USES_PG_ARCH_X u |= kpf_copy_bit(k, KPF_ARCH_2, PG_arch_2); + u |= kpf_copy_bit(k, KPF_ARCH_3, PG_arch_3); #endif return u; diff --git a/include/linux/kernel-page-flags.h b/include/linux/kernel-page-flags.h index eee1877a354e..859f4b0c1b2b 100644 --- a/include/linux/kernel-page-flags.h +++ b/include/linux/kernel-page-flags.h @@ -18,5 +18,6 @@ #define KPF_UNCACHED 39 #define KPF_SOFTDIRTY 40 #define KPF_ARCH_2 41 +#define KPF_ARCH_3 42 #endif /* LINUX_KERNEL_PAGE_FLAGS_H */ diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 5dc7977edf9d..c50ce2812f17 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -134,6 +134,7 @@ enum pageflags { #endif #ifdef CONFIG_ARCH_USES_PG_ARCH_X PG_arch_2, + PG_arch_3, #endif #ifdef CONFIG_KASAN_HW_TAGS PG_skip_kasan_poison, diff --git a/include/trace/events/mmflags.h b/include/trace/events/mmflags.h index 4673e58a7626..9db52bc4ce19 100644 --- a/include/trace/events/mmflags.h +++ b/include/trace/events/mmflags.h @@ -130,6 +130,7 @@ IF_HAVE_PG_HWPOISON(PG_hwpoison, "hwpoison" ) \ IF_HAVE_PG_IDLE(PG_young, "young" ) \ IF_HAVE_PG_IDLE(PG_idle, "idle" ) \ IF_HAVE_PG_ARCH_X(PG_arch_2, "arch_2" ) \ +IF_HAVE_PG_ARCH_X(PG_arch_3, "arch_3" ) \ IF_HAVE_PG_SKIP_KASAN_POISON(PG_skip_kasan_poison, "skip_kasan_poison") #define show_page_flags(flags) \ diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 5d87dc4611b9..c509011bd4a2 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2403,6 +2403,7 @@ static void __split_huge_page_tail(struct page *head, int tail, (1L << PG_unevictable) | #ifdef CONFIG_ARCH_USES_PG_ARCH_X (1L << PG_arch_2) | + (1L << PG_arch_3) | #endif (1L << PG_dirty) | LRU_GEN_MASK | LRU_REFS_MASK));