From patchwork Fri Jul 22 01:50:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Collingbourne X-Patchwork-Id: 12925872 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 C7CC1C43334 for ; Fri, 22 Jul 2022 01:52:31 +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=RoAsTmmy2FPEy6yW2n02jth7n2suludXa011mD6PFJQ=; b=QIru8o2Xa3Q4+8KHFeeWxHZvO+ rTWCtK3r8cjyy+2x7Hk+AQ9myYXJ6cBesT6V7Oc2HighpsvjUUFFsiKt5KxMTF3y5DWaBRBOGxBjG traqvtbDH4LPQPcvVCh2IYlV8DvV79QpA0d9O2PbvHk+8RzuKhGQWk1D1Toz6XBNPkvKpbKmCOvgF F09v1h/a4TGMi6YIRosWXrcAfbbVKUYDI4dHGveP/knB0uJZAa5F91PUJITgPZx45rqX7O322mjt5 lsfnyaSc68+i/EkkZigo817u2QyAZOd9k79JnUQuBo3k74CseYoWGN7768qS4023k535VscMFaRlv FO4U8Z1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEhpC-00FmgS-4P; Fri, 22 Jul 2022 01:51:30 +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 1oEhom-00Flgm-Ko for linux-arm-kernel@lists.infradead.org; Fri, 22 Jul 2022 01:51:06 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-31e62bc916aso28519477b3.19 for ; Thu, 21 Jul 2022 18:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=TwIGZxOgt6rBe9wTaWtA8OadqnubKpslEOefQ0KlBYc=; b=NkaUVQiJc5jp+Kd2jx7nqyeLgTuFuMR+XL7JQsjYclkpdvHDVQSs++oKJUciE3moo+ ++QPlhiRnCM5hnKWWKwiBeCGYNzfZRM70Zb8d/mMX9XxKQqkFWrFDMZRSYO/twzB9DN0 tUhyOaKS+2VpTg2zP8AIXPINcgEvdnjIZfzofEXHRALLETPHGbIv2z7g7sbF89BagsaZ b/KrKcET0FOT7cYFKscqtzCKR+RGicAklN0CDyJtWmUdIv3BlWspqKD84OugLk/Qv9tT Dz4fo2RX85w/ryKRTsUDeumOGudpVjHMJzJIinDSj8vhiCxEZz5hgyjnyNLfK01rFbYu Z+iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=TwIGZxOgt6rBe9wTaWtA8OadqnubKpslEOefQ0KlBYc=; b=VivPBVdXayc/AKMwkHC4v93CZKNerDh55pa/MWbftHGJ3VPJn83czOcP9rBSQ0MRvs 9n0p1Jw1aaVMWAPcyvWu13LaUOw1TFF664vgPrwICySUhZhlLtCT8xrSePpfy7dluWxr LBMoGJJti5yuELRBuzq2rWKFxY+EyiEvSOtsbdHinrPf3P4mJWAxKzqkpQDquESnVFfD ZYIe/8iKeZyXunKWQNQG7eRWPN41ESfAL/pxsNmN7h64OqyAaGGacR1CNfxqrKCBJpp9 eNdH/rL1XMiqZJqB1mDxGpItUSJNQw5lKi1xwP7NGW/Lbd56oHT/JQI5QI0KHIGaWIN1 wTtg== X-Gm-Message-State: AJIora9nPtDyquX0ECNY3gMYqnXpG7SYkHj1JioC7hgdN70MK0ZbI/j1 Ttf+S1x/3vRGu3E477/eeOO2wOO7cTKK+Qilgc0BDQmGm39m4yvsci1MwXSu446xqswJex3k5ZC 2ixcgHhLVIx1xvnBstZOGGFauklBcakS7jLLY24omqdrl028l46CqVeIkfulZ0ApLbAV4z3qj X-Google-Smtp-Source: AGRyM1v5HWTX6JYtiwrUXhpyDwH9QneRyI4FxOnAArRXJ2u1OihyxjWyM/5NJuRzTZObSJn7lnprhPc= X-Received: from pcc-desktop.svl.corp.google.com ([2620:15c:2ce:200:7ed4:5864:d5e1:ffe1]) (user=pcc job=sendgmr) by 2002:a25:d512:0:b0:670:9301:a997 with SMTP id r18-20020a25d512000000b006709301a997mr1176046ybe.351.1658454662450; Thu, 21 Jul 2022 18:51:02 -0700 (PDT) Date: Thu, 21 Jul 2022 18:50:29 -0700 In-Reply-To: <20220722015034.809663-1-pcc@google.com> Message-Id: <20220722015034.809663-4-pcc@google.com> Mime-Version: 1.0 References: <20220722015034.809663-1-pcc@google.com> X-Mailer: git-send-email 2.37.1.359.gd136c6c3e2-goog Subject: [PATCH v2 3/7] 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-20220721_185104_703510_235EB565 X-CRM114-Status: GOOD ( 12.40 ) 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 --- fs/proc/page.c | 1 + include/linux/page-flags.h | 1 + include/trace/events/mmflags.h | 7 ++++--- mm/huge_memory.c | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/proc/page.c b/fs/proc/page.c index a2873a617ae8..438b8aa7249d 100644 --- a/fs/proc/page.c +++ b/fs/proc/page.c @@ -220,6 +220,7 @@ u64 stable_page_flags(struct page *page) u |= kpf_copy_bit(k, KPF_ARCH, PG_arch_1); #ifdef CONFIG_64BIT u |= kpf_copy_bit(k, KPF_ARCH_2, PG_arch_2); + u |= kpf_copy_bit(k, KPF_ARCH_2, PG_arch_3); #endif return u; diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 465ff35a8c00..ad01a3abf6c8 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -134,6 +134,7 @@ enum pageflags { #endif #ifdef CONFIG_64BIT 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 11524cda4a95..704380179986 100644 --- a/include/trace/events/mmflags.h +++ b/include/trace/events/mmflags.h @@ -91,9 +91,9 @@ #endif #ifdef CONFIG_64BIT -#define IF_HAVE_PG_ARCH_2(flag,string) ,{1UL << flag, string} +#define IF_HAVE_PG_ARCH_2_3(flag,string) ,{1UL << flag, string} #else -#define IF_HAVE_PG_ARCH_2(flag,string) +#define IF_HAVE_PG_ARCH_2_3(flag,string) #endif #ifdef CONFIG_KASAN_HW_TAGS @@ -129,7 +129,8 @@ IF_HAVE_PG_UNCACHED(PG_uncached, "uncached" ) \ 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_2(PG_arch_2, "arch_2" ) \ +IF_HAVE_PG_ARCH_2_3(PG_arch_2, "arch_2" ) \ +IF_HAVE_PG_ARCH_2_3(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 8320874901f1..d6e8789e9ebb 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2399,6 +2399,7 @@ static void __split_huge_page_tail(struct page *head, int tail, (1L << PG_unevictable) | #ifdef CONFIG_64BIT (1L << PG_arch_2) | + (1L << PG_arch_3) | #endif (1L << PG_dirty)));