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=-2.5 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,USER_AGENT_SANE_1 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 642C9C433E1 for ; Thu, 25 Jun 2020 12:11:43 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1CB9820707 for ; Thu, 25 Jun 2020 12:11:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ur4lNMMp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1CB9820707 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OgdcVelb1kDYu2VSv9UNKU5svSm5Cp699OQk6t1Bb9k=; b=Ur4lNMMpkM3ucARv/UGzz9Y11 dL/GrR7MtCcz5tyOjQaRG5wAaEWRi3tMCDheubBsvuVI4u5EWB2JWeabowXYSUwvduYjKR7aW1gqA KUH+//PPTBnm1QFXlCQK7TgguE5KkL9SM1/zJEwDOgZGbAtiHLNztRdxhmO4YhYyb6tGO+HWZDSMu EIbetO5GDXA48LAq/gjqAYoCNfajNH8AJPMzU7YlgKC4n7uGa7HeqV8sFmIPt8sS6caRc+I19Pj3c aVWQ2M4CCeMdeOi9XG9hCE+/uj1Cr4vCb2LSK8/z4vZDx5H5EBz1E5iapNFCN1HY2WqCVYXooWBFd rco+QcEuA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1joQhZ-0007uT-1c; Thu, 25 Jun 2020 12:09:57 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1joQhW-0007tp-DM for linux-arm-kernel@lists.infradead.org; Thu, 25 Jun 2020 12:09:55 +0000 Received: from gaia (unknown [2.26.170.173]) (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 6109A20720; Thu, 25 Jun 2020 12:09:51 +0000 (UTC) Date: Thu, 25 Jun 2020 13:09:48 +0100 From: Catalin Marinas To: Steven Price Subject: Re: [PATCH v5 21/25] mm: Add arch hooks for saving/restoring tags Message-ID: <20200625120931.GB14812@gaia> References: <20200624175244.25837-1-catalin.marinas@arm.com> <20200624175244.25837-22-catalin.marinas@arm.com> <20200624114534.9520ba5ed235bc32bf1af3a2@linux-foundation.org> <40250ed8-50fe-3945-d7d3-331e03b2abe8@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <40250ed8-50fe-3945-d7d3-331e03b2abe8@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Szabolcs Nagy , Andrey Konovalov , Kevin Brodsky , Peter Collingbourne , linux-mm@kvack.org, Andrew Morton , Vincenzo Frascino , Will Deacon , Dave P Martin , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jun 25, 2020 at 10:04:59AM +0100, Steven Price wrote: > On 24/06/2020 19:45, Andrew Morton wrote: > > 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? > > That would be the idea (see patch 22). However: > > Catalin - you've renamed __HAVE_ARCH_SWAP_RESTORE_TAGS in patch 22, but not > here! This was meant to be arch_swap_restore() and __HAVE_ARCH_SWAP_RESTORE (no tags suffix) and it was originally in include/asm-generic/pgtable.h. With Mike's recent reworking getting rid of this file, I messed up the conflict resolution during rebase and re-introduced this file in patch 22. I'll fix it up, it needs to be only in include/linux/pgtable.h. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel