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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 868B9C433E0 for ; Sat, 23 Jan 2021 00:35:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 059E323B6E for ; Sat, 23 Jan 2021 00:35:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 059E323B6E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4BFA06B0008; Fri, 22 Jan 2021 19:35:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 46D1C6B000A; Fri, 22 Jan 2021 19:35:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 335FA6B000C; Fri, 22 Jan 2021 19:35:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0203.hostedemail.com [216.40.44.203]) by kanga.kvack.org (Postfix) with ESMTP id 1EDEF6B0008 for ; Fri, 22 Jan 2021 19:35:46 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id DB3D8181AF5FE for ; Sat, 23 Jan 2021 00:35:45 +0000 (UTC) X-FDA: 77735171850.21.frog19_47183a127570 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id B9BF3180445F9 for ; Sat, 23 Jan 2021 00:35:45 +0000 (UTC) X-HE-Tag: frog19_47183a127570 X-Filterd-Recvd-Size: 5302 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Sat, 23 Jan 2021 00:35:45 +0000 (UTC) Received: by mail-ed1-f53.google.com with SMTP id g24so8524708edw.9 for ; Fri, 22 Jan 2021 16:35:45 -0800 (PST) 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=jKriZlsSDwDLtrvuS7JPodDHbZ5HjWBpExZmVExyvSs=; b=JHInQcPKISPhjzL2Lb26o0L1L0IJr7VawH+94lMdfU+FNHDsQjFTAkXOukMR2gUOVZ DF0iQshXuJ6QzUTNBmuAXDqqryeiXEhbw+IvUcUtqJmnYqVB2V2VdbdCbFfogiXhEnes IwvCzEfw9eY1b8NoG7yxvHJaFITAD+Hu1hh1drDNGPc5+Ui0HPRTxsGs6xEIIoOzEnzV uW3YljoP2C+iRw1vqOPqzOacNtOyQoxWI+9Z6ZivCGUvPUSbgi34FMm2awEN20DULGPx ItoBpdr5UXpBq0B9MURbPDXR/3p6472apAzoC2FYIYifpn2iLuHO4RayNpIoI+iZO9tX YH4Q== 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=jKriZlsSDwDLtrvuS7JPodDHbZ5HjWBpExZmVExyvSs=; b=agjnMY3EuEaGp6PdfcAm7d0W7qmeIfXBKq8EBsgwOrKtbgjJAdQ7f6Vez8kXavcVTD HGIjYAL0ExIshcmZusULr9lxEWplKjt6v+i2h0h16Dp129oEtT3Fyg8C0JYK1A2drKk8 wrX1FNMw23bwp3aPvKnDdSkOnC2R+fKuKywet31SdRum8XlubZWwzILSAIalleFqmiEM R4sHpzhIoeJGtVVM5QIbmkuHUqIPV0x3YXYWv9H9zCD4jp/TM42RhDNXWewXpHb5RVcz 4rjFNBlSVVGoCDAjSisi0CcL+kX/mXFRXm95vWr38l0WAWPFiTHsosdYZhXARG9zmlXW x5iQ== X-Gm-Message-State: AOAM5326LaaLNDmGDUekUBaW7ZFD4V/54IZCFx5R7Cf3U1hV/VhYPFFe jUQzbA11NfovB8ZGGHuq816LJR/YIBdsDpr2PXcuuQ== X-Google-Smtp-Source: ABdhPJzgAnFPMJXD87lWu7NwW9XxgA0xtR1GGer/YVjam0yyb3ILvC28MrWvLVVkeiZcxW0cwVal5DvGg4MclvOTYxU= X-Received: by 2002:a05:6402:3508:: with SMTP id b8mr669502edd.341.1611362144184; Fri, 22 Jan 2021 16:35:44 -0800 (PST) MIME-Version: 1.0 References: <20200326032420.27220-1-pasha.tatashin@soleen.com> <20200326032420.27220-8-pasha.tatashin@soleen.com> In-Reply-To: From: Pavel Tatashin Date: Fri, 22 Jan 2021 19:35:08 -0500 Message-ID: Subject: Re: [PATCH v9 07/18] arm64: trans_pgd: hibernate: idmap the single page that holds the copy page routines To: James Morse Cc: James Morris , Sasha Levin , "Eric W. Biederman" , kexec mailing list , LKML , Jonathan Corbet , Catalin Marinas , Will Deacon , Linux ARM , Marc Zyngier , Vladimir Murzin , Matthias Brugger , Bhupesh Sharma , linux-mm , Mark Rutland , steve.capper@arm.com, rfontana@redhat.com, Thomas Gleixner , Selin Dag Content-Type: text/plain; charset="UTF-8" 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, Apr 29, 2020 at 1:01 PM James Morse wrote: > > Hi Pavel, > > On 26/03/2020 03:24, Pavel Tatashin wrote: > > From: James Morse > > > > To resume from hibernate, the contents of memory are restored from > > the swap image. This may overwrite any page, including the running > > kernel and its page tables. > > > > Hibernate copies the code it uses to do the restore into a single > > page that it knows won't be overwritten, and maps it with page tables > > built from pages that won't be overwritten. > > > > Today the address it uses for this mapping is arbitrary, but to allow > > kexec to reuse this code, it needs to be idmapped. To idmap the page > > we must avoid the kernel helpers that have VA_BITS baked in. > > > > Convert create_single_mapping() to take a single PA, and idmap it. > > The page tables are built in the reverse order to normal using > > pfn_pte() to stir in any bits between 52:48. T0SZ is always increased > > to cover 48bits, or 52 if the copy code has bits 52:48 in its PA. > > > > Pasha: The original patch from James > > inux-arm-kernel/20200115143322.214247-4-james.morse@arm.com > > -EBROKENLINK > > The convention is to use a 'Link:' tag in the signed-off area. > e.g. 5a3577039cbe OK Fixed. > > > Adopted it to trans_pgd, so it can be commonly used by both Kexec > > and Hibernate. Some minor clean-ups. > > Please describe your changes just before your SoB. This means each author sign's off on > the stuff above their SoB, and its obvious who made which changes. > > Search for 'Lucky K Maintainer' in process/submitting-patches.rst for an example. OK, Fixed. eed the maximum T0SZ. > > + * > > + * Returns 0 on success, and -ENOMEM on failure. > > + * On success trans_ttbr0 contains page table with idmapped page, t0sz is set to > > > + * maxumum T0SZ for this page. > > maxumum > Ok.