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=-0.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 8DACFC433B4 for ; Thu, 15 Apr 2021 02:20:47 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 E35476121E for ; Thu, 15 Apr 2021 02:20:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E35476121E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc: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=zo6Ujn8HlgfiQsYz1ZjYQ+TUEYV0IJdee71GgXkYAFo=; b=P/7QRs7bbEFr3N1cBT+i+RCfa 6GY+xEdjwnCgLbSWhceNeNDsPNWQmSCNTSD783UlT6AV3M20KjXIzyT3ZlG/n32+Pon0ykQpK+QwL 0Tk8o8aNfVabxmzyBaDkqsGMt1DTNp1CMINxnpJ0ea5OJtRuMnz9vtXOTaxEAGOyPkQ8uebnsBc6C 4cS8iHVzNlIlH9k+O6ttMyYu2ZDKPrOzW+2cfpoyQYY9QLCPZn24xAO98oYrNJrqc5i0l3JdRiJ/L 5rVgA45hyy4fAOb3GoRUQq3OMbRcJ1gaFeLlaf81o1+XoMtPHzRlSp/MuScCEiO3UGXlFw9T3G2PA sKhleIVtg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lWrWb-00EVRy-Po; Thu, 15 Apr 2021 02:14:33 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWrWS-00EVRQ-CZ for linux-arm-kernel@desiato.infradead.org; Thu, 15 Apr 2021 02:14:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=7BEXaAn25NB7H4tHJ+CbOueNF9EWM/QOqL01DW1w3Go=; b=0XEJP1K0QO0KRS5dQxmpaPtBq4 KAQa2Ug2HQ7yKzQjNY82u2K5eUJwZZC1a0mkNrolUspOCuQ5zXQQIosgOT5IJitVgTjhuCI8xWSvZ vkMbOIYcKJeRPGnUtML034bgXF0HOSDbcKFii1C09jtpyNX6tcshJ4CFBXGE4VgLm+vzoQWFFQGGG a9tMx6ib5xEchmPuxviTk7dJXsXSeNDOs8ulfGzJIUPyPmgQuQpuM37ywRyq3ZeW0gvloNCVJjm8H v2XcRIGr3wPyjUFUn/b0+nD9leLL6HFLmzQ648bN81CBktHlEwvkzLe1EKwrs378B8Dp07QuPYgru YNchVsaQ==; Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lWrWP-008Dcj-Or for linux-arm-kernel@lists.infradead.org; Thu, 15 Apr 2021 02:14:23 +0000 Received: by mail-io1-xd32.google.com with SMTP id a9so11834768ioc.8 for ; Wed, 14 Apr 2021 19:14:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7BEXaAn25NB7H4tHJ+CbOueNF9EWM/QOqL01DW1w3Go=; b=DCOSi7wU3rPCZteVxL42x9VACizMt5KDBuOopnMoXg+DswlyxuI/mHE+jsfcqwljyt mqBbJPVoDjkj7E2j8AOgqDOsboAE8m41YXn67NADlTv3FeOpBgMP2MaTrC+5mxcw4jxp HMVxgw+AhMv7FvAxGUPqrqE8l7FMwVAdoTeZD0tQqeIdRKXlW3dWpQ9wcXi6cVfz0Nuy Ktghni+dGaZ1Lz5Xelr2AQgUB35/F8GXQ7gjpeh7ueS55JwnxlfJL4/l3Gl+eIdhIh7a ZESWfRAt+qU0CmNHq0ad3Lnp6SVzkcbYs80wi0FKpMBomUe5q3QOzbcFoJ3+lY8T3WrB VZyQ== 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=7BEXaAn25NB7H4tHJ+CbOueNF9EWM/QOqL01DW1w3Go=; b=ekf2qh0NHXu+IiMTYgLvITajN9GmZ9xYxxZRNUyyWNRJRz5VRNUlhdj/1RUx6dgWZB kYd6nvUNrzxEPLQ53jBVyNzl/vIKLfoEgowoyGzZY14quvfJT+Cn5w9brEE1mnBknwtC mjUBdJ2voqXbd7iGK9bXQIsxTInB524fhePa+f6HiGcNQEqJlfN5xdTK11YGWRPn1b02 QdvUJhTeHMqPS4Lx/FIl8UYJAsWGwSrj4jCMXE5d1Hm7YWz0c0W3TxRNmwoaLItISKkx xnnFcGZkmdVsiaqrRS6BGP1M4dU1MyzXSMJn8iGWqcq06FkBrgeWgdTchfNe5AfPHHOp 46Cg== X-Gm-Message-State: AOAM531vo6yMri/V+wKaYh1zRkTosBm7sS+NkM6OeQe3/b1pFzbWFZY4 1UQz5GSmqa6nCs3L3YrQVHq/XW5XAsXJTQr3bu6ThOeMIA== X-Google-Smtp-Source: ABdhPJwDYZl34anQ4++Eunhd95Co6k2XfA9Kf/uHoUI7drzTHOd/9T+mN9Vf4tj8EyO1Im91fz2X/ZwbM+tZn/Awi0A= X-Received: by 2002:a05:6638:181:: with SMTP id a1mr830003jaq.7.1618452860743; Wed, 14 Apr 2021 19:14:20 -0700 (PDT) MIME-Version: 1.0 References: <20210410095654.24102-1-kernelfans@gmail.com> In-Reply-To: From: Pingfan Liu Date: Thu, 15 Apr 2021 10:14:09 +0800 Message-ID: Subject: Re: [RFC 0/8] use __create_pgd_mapping() to implement idmap and unify codes To: Pavel Tatashin Cc: Linux ARM , Catalin Marinas , Will Deacon , Marc Zyngier , Kristina Martsenko , James Morse , Steven Price , Jonathan Cameron , Anshuman Khandual , Atish Patra , Mike Rapoport , Logan Gunthorpe , Mark Brown , "Eric W. Biederman" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210414_191421_845089_B82A14FD X-CRM114-Status: GOOD ( 25.81 ) 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: , 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 Hi Pavel, First of all, sorry to stir up this topic too late. On Wed, Apr 14, 2021 at 10:06 PM Pavel Tatashin wrote: > [...] > Hi Pingfan, > > The MMU enabled kexec code has been in development for a while, and > has gone through several iterations: > Yes, I have gone through the whole iterations after reviewing v12. > 1. simply reserve memory (similar to crash kernel) so no relocation is > needed. The approach was only ~50 LOC, but since this was an ARM64 > specific problem I was asked to fix it in ARM64, not in generic code. > 2. The second approach was to use idmap (as you are proposing now), > but James Morse explained to me that there are arm systems that have > very high starting physical addresses that they cannot cover all > physical memory via idamp. So, I cannot assume that I can idmap any > page in PA. I think here, the exact blocking factor is the routines in hand can not set up idmap. But the current routines have the capability if enhanced. And it turns out easy to achieve the goal by redefining CONFIG_PGTABLE_LEVEL. > 3. The third approach was to unify some of page table management code > with hibernations (trans_pgd), and use contiguous VA maps, so the > relocation function can be as simply as possible. However, both, Eric > Biederman and James Morse asked me to change it to a linear map > instead: to be inline with other arches, and also for easier > debugging. > 4. The fourth approach is the current one, I am using a linear map, > and a lot of patches for this project have already landed into the > mainline. The last set of changes does not add any new LOC: "18 files > changed, 315 insertions(+), 330 deletions(-)", as all the preliminary > work has landed upstream. > > What is the benefit of going back to approach 2, when the current > approach has already been agreed with James and Eric, and does not add > new complexity, as the net LOC change is negative? > It takes me some time to understand the stub handling. But James is expert on this field and sure about it. In contrast, idmap is similar to linear map, meanwhile free of kvm stub handling. As a result, the code scarcely needs change against MMU-disabled code. Anyway, the primary target of my series is to share the common code with [5/8] and [8/8]. Thanks, Pingfan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel