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=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,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 E28FBC43331 for ; Fri, 6 Sep 2019 16:00:44 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id ABBC82070C for ; Fri, 6 Sep 2019 16:00:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cpywIK1K"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="DrtnmIYB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ABBC82070C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8aZhUhoKfwY8UmBS9NSC7+vdbjFRtqBlx5CccfcRI1Y=; b=cpywIK1KcTh/y2 FtniZXy6Ml6Ub9DKgPefWj9X8aKEfyP20ZeMGTqeNvpz/p5Y8C3SURrowjt5G+LWzEZz7XdeMlxcA Urqvfk+AFOsbOy4oEpUeH+IWbNBlBgQgSjhbqhljVsIp7R94qUHJzdjA+6LhW4fs1BveqDeGsd249 V7h2du8InGo9njE0h0CTsQXzwtgwwW7MtlNwXgef2eJER2+qE33q/t45modiID9TXAqHQ0z8tPibY lObOZFTKdht+Rt/Sd4KDq17896/dpadSRmEWEtK0XGjtlWtlYU5spO6DHswYNX6HCM6ifhUjV/O++ zG0Wh/lt33iG0KzEJJvA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i6Gf6-0006VC-NU; Fri, 06 Sep 2019 16:00:36 +0000 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i6Gf3-0006SR-1c for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2019 16:00:34 +0000 Received: by mail-ed1-x541.google.com with SMTP id y91so6724560ede.9 for ; Fri, 06 Sep 2019 09:00:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QiD1TwL/Id//xaqpbzs1lfvzt5WvDuUNyjDuGVpOVM8=; b=DrtnmIYB0GfZaFo92tmzBcMPxFlqSxYyiLcJ2k29wb15hQ6tGomjNtco6mkGB1/KM2 x/qlHJWajTbuieX2M+cfvfX55UTgvqs1Uqqdh/zAUvCkhd3+Fcz1NJg3UBYg5aeOo9Tm vVJfvpmco/i+W9Z/4qD1zlzKasNjrKFO5/Ho1uvF8kOY5UK6dhzqHE4cS7+V1M0dangv rVAfV2UegDXDzUcSB0oZhMswVkxyoHUZWqiANMarBjI4GS1rtAQUam4bqNJQTNMexDIb nU3dVhU/T2yurplUf7I30QZKtvs1WwsfVbJb7FR+dt4/8O55yYG2FkuRDk873NvXmwza NtuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QiD1TwL/Id//xaqpbzs1lfvzt5WvDuUNyjDuGVpOVM8=; b=L8aCukQ3CVMFE43t06TRabxcgzNAwI0DrPsc/OlY0Z7499KAneW5PZpPi4scJeBMA1 N+eQEYLEHkGh8i3pIi9QyTZYu7wnoecuS35sngSH3CNdYy957GKCfM93zDn2s82g57TO w7khse3zJ3RUmTUcp0UI+l0q2FQkbeM6zt2vG8vvAiFR8G6CLthOGGQ8KyHyOOGL6rUN iMlE1MVrC2wCi+DbvJ93r4cTagDt4SN3C0hL09IqbZoi7nmvKYWIXLB+qWMAnOqyN0fz uTVuFS8b62amwiOXq+PDcIIYxFc84jhO+uoDnv0LfcxWOx2SqPuFcuPd+2JGth+s+aZH qx7Q== X-Gm-Message-State: APjAAAXAzspvrFNK3P5bwtAn6qQdbpQGudX/vX58qVLyHMo2z3pBsdaj LRTENz9ri1USdsQ+YRvnX+PHh1goKr6jrKGe1CL4GA== X-Google-Smtp-Source: APXvYqy09fzh96BWcQzuCXWwESDoCG5MbuNp+4Sq/95dcElSvTDxaCmjYIch+D1tDPc4Btkhhy46Glw06rUTj79kprY= X-Received: by 2002:aa7:c40c:: with SMTP id j12mr10481211edq.80.1567785630260; Fri, 06 Sep 2019 09:00:30 -0700 (PDT) MIME-Version: 1.0 References: <20190821183204.23576-1-pasha.tatashin@soleen.com> <20190821183204.23576-7-pasha.tatashin@soleen.com> In-Reply-To: From: Pavel Tatashin Date: Fri, 6 Sep 2019 12:00:19 -0400 Message-ID: Subject: Re: [PATCH v3 06/17] arm64, hibernate: add trans_pgd public functions To: James Morse X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190906_090033_090966_DF122354 X-CRM114-Status: GOOD ( 21.34 ) 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: Sasha Levin , Mark Rutland , Vladimir Murzin , Jonathan Corbet , Marc Zyngier , Catalin Marinas , Bhupesh Sharma , kexec mailing list , LKML , James Morris , linux-mm , "Eric W. Biederman" , Matthias Brugger , will@kernel.org, Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Sep 6, 2019 at 11:18 AM James Morse wrote: > > Hi Pavel, > > On 21/08/2019 19:31, Pavel Tatashin wrote: > > trans_pgd_create_copy() and trans_pgd_map_page() are going to be > > the basis for public interface of new subsystem that handles page > > Please don't call this a subsystem. 'sound' and 'mm' are subsystems, this is just some > shared code. Sounds good: just could not find a better term to call trans_pgd_*. I won't fix log commits. > > > tables for cases which are between kernels: kexec, and hibernate. > > Even though you've baked the get_safe_page() calls into trans_pgd_map_page()? It is getting removed later. Just for a cleaner migration to new place, get_safe_page() is included for now. > > > > diff --git a/arch/arm64/kernel/hibernate.c b/arch/arm64/kernel/hibernate.c > > index 750ecc7f2cbe..2e29d620b56c 100644 > > --- a/arch/arm64/kernel/hibernate.c > > +++ b/arch/arm64/kernel/hibernate.c > > @@ -182,39 +182,15 @@ int arch_hibernation_header_restore(void *addr) > > > +int trans_pgd_map_page(pgd_t *trans_pgd, void *page, > > + unsigned long dst_addr, > > + pgprot_t pgprot) > > If this thing is going to be exposed, its name should reflect that its creating a set of > page tables, to map a single page. > > A function called 'map_page' with this prototype should 'obviously' map @page at @dst_addr > in @trans_pgd using the provided @pgprot... but it doesn't. Answered below... > > This is what 'create' was doing in the old name, if that wasn't obvious, its because > naming things is hard! > | trans_create_single_page_mapping()? > > (might be too verbose) > > I think this bites you in patch 8, where you 'generalise' this. The new naming makes more sense to me. The old code had function named: create_safe_exec_page() It was doing four things: 1. creating the actual page via provided allocator, 2. copying content from the provided page to new page, 3 creating a new page table. 4 mapping it to a new page table at specified destination address After, I generalize this the function the prototype looks like this: int trans_pgd_map_page(struct trans_pgd_info *info, pgd_t *trans_pgd, void *page, unsigned long dst_addr, pgprot_t pgprot) The function only does the "4" from the old code: map the specified page at dst_addr. The trans_pgd is already created. Of course, and mapping function will have to allocate missing tables in the page tables when necessary. > > + return 0; > > +} > > + > > +/* > > + * Copies length bytes, starting at src_start into an new page, > > + * perform cache maintentance, then maps it at the specified address low > > Could you fix the spelling of maintenance as git thinks you've moved it? I will. Thank you, Pasha _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel