From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B282EC433DF for ; Wed, 24 Jun 2020 18:45:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5EC032081A for ; Wed, 24 Jun 2020 18:45:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="aJJ1kYS2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5EC032081A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E36BB6B002A; Wed, 24 Jun 2020 14:45:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DC36D6B002B; Wed, 24 Jun 2020 14:45:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C610A6B002D; Wed, 24 Jun 2020 14:45:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0101.hostedemail.com [216.40.44.101]) by kanga.kvack.org (Postfix) with ESMTP id A759D6B002A for ; Wed, 24 Jun 2020 14:45:39 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3DBE2180AD82F for ; Wed, 24 Jun 2020 18:45:39 +0000 (UTC) X-FDA: 76964983998.12.bag60_0210f5626e46 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id E750C18012023 for ; Wed, 24 Jun 2020 18:45:38 +0000 (UTC) X-HE-Tag: bag60_0210f5626e46 X-Filterd-Recvd-Size: 3377 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Wed, 24 Jun 2020 18:45:38 +0000 (UTC) Received: from X1 (nat-ab2241.sltdut.senawave.net [162.218.216.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DD3422081A; Wed, 24 Jun 2020 18:45:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593024337; bh=E6OIJZbTsXd21Iy1/vA8hcrT6xT8e3j93Tf+tQvTOd0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=aJJ1kYS2JPdRjBiUDYlM1E78ZAi58Fy8LC3g2QYZh12Sn2tApP6Kwm7cI4tu/pu61 Sl/mqCEM0Tu/Q/bGjgux7NDEVs/kzhMSJy7EVQJr1PBu/ghV1L777kBPawqt+VfAf4 CGOgekjAlBc2SccextFmczx29bANPvB4Figc71Zc= Date: Wed, 24 Jun 2020 11:45:34 -0700 From: Andrew Morton To: Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, Will Deacon , Dave P Martin , Vincenzo Frascino , Szabolcs Nagy , Kevin Brodsky , Andrey Konovalov , Peter Collingbourne , Steven Price Subject: Re: [PATCH v5 21/25] mm: Add arch hooks for saving/restoring tags Message-Id: <20200624114534.9520ba5ed235bc32bf1af3a2@linux-foundation.org> In-Reply-To: <20200624175244.25837-22-catalin.marinas@arm.com> References: <20200624175244.25837-1-catalin.marinas@arm.com> <20200624175244.25837-22-catalin.marinas@arm.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E750C18012023 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, 24 Jun 2020 18:52:40 +0100 Catalin Marinas wrote: > From: Steven Price > > Arm's Memory Tagging Extension (MTE) adds some metadata (tags) to > every physical page, when swapping pages out to disk it is necessary to > save these tags, and later restore them when reading the pages back. > > Add some hooks along with dummy implementations to enable the > arch code to handle this. > > Three new hooks are added to the swap code: > * arch_prepare_to_swap() and > * arch_swap_invalidate_page() / arch_swap_invalidate_area(). > One new hook is added to shmem: > * arch_swap_restore_tags() > > ... > > --- a/include/linux/pgtable.h > +++ b/include/linux/pgtable.h > @@ -631,6 +631,29 @@ static inline int arch_unmap_one(struct mm_struct *mm, > } > #endif > > +#ifndef __HAVE_ARCH_PREPARE_TO_SWAP > +static inline int arch_prepare_to_swap(struct page *page) > +{ > + return 0; > +} > +#endif > + > +#ifndef __HAVE_ARCH_SWAP_INVALIDATE > +static inline void arch_swap_invalidate_page(int type, pgoff_t offset) > +{ > +} > + > +static inline void arch_swap_invalidate_area(int type) > +{ > +} > +#endif > + > +#ifndef __HAVE_ARCH_SWAP_RESTORE_TAGS > +static inline void arch_swap_restore_tags(swp_entry_t entry, struct page *page) > +{ > +} > +#endif Presumably these three __HAVE_ARCH_ macros are to be defined in asm/pgtable.h? Acked-by: Andrew Morton