Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp296462pxj; Thu, 17 Jun 2021 03:00:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZhQE3e1ZUo8ZksBNnuIVDlYZHf+NI61MeBuNeh+WGhfwceyEkrLeRwmWzIrwkVk7l3kod X-Received: by 2002:a02:b897:: with SMTP id p23mr3793277jam.71.1623924003159; Thu, 17 Jun 2021 03:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623924003; cv=none; d=google.com; s=arc-20160816; b=gPhwXZIHeAyFj9EChZp2f9YkARj/Xx2a6pQ1cyPZVJBoJiUeXCMzVSp9xr/RjXIbye Am6rivYnInXdvCskzaMwGg8iHb/4xi5bhucyKhlDjybGYf7sKrBNDSth5kutMn7y2rKz M6sn8wilCdc6u1cvZ6l/urCBi38ARBzyBvPmKa7qB0RJD3J8Furb69LGnDOEDCrAZX0z BEGMERf4K1VHwVrK6eFidqvb7fFSZe4N/WM3j3kW+vBJwZQnASD7aHl9iJd8QAsiFU+f zMMW5ltTtJYTwhuUeUU52CrNHBfFKqniemc1VP7qAdOAQYEnjjyEEUT/IreRdbZoad6X uXVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=RYUKrwp6r0pW5DO5jhrXQAyFnpJWjaL57w9Pr1yb/+I=; b=pTUFPBa1NOcdSZqql0ruscJkuE58FiNcIWI6fNVdjCrncTc8ur1WR01L9W069MFLaj Zpqrtfx8g1n28Laie5x+2RTxFBBPGIEKLcKqbfp2mm8P6CMm7HztJe5qUZcda3kf8T6e O8urQXwq1cjc+cmAaoblciq3TnsXNqdMsXa+SvGG8XOQf3Y767aqmePutQOoDeOf6IAX fOGZOxhKPJXHpP/Sx9LRJBbXFn9miKWPTeTZJCO44NbQPdjwCTJMCqFrCJXg+VLrp75N /q6iwHMPsbZkyvudUTgFG/n8+PaEirOiLCL1YuFowuzoQJ4ElBf7TxSkiti5MAviIYx/ RkLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si4980132iot.47.2021.06.17.02.59.50; Thu, 17 Jun 2021 03:00:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231685AbhFQJkn (ORCPT + 99 others); Thu, 17 Jun 2021 05:40:43 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:7465 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230411AbhFQJkn (ORCPT ); Thu, 17 Jun 2021 05:40:43 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4G5H3S3CQ5zZhbh; Thu, 17 Jun 2021 17:35:32 +0800 (CST) Received: from dggpemm000001.china.huawei.com (7.185.36.245) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 17 Jun 2021 17:38:28 +0800 Received: from [10.174.177.125] (10.174.177.125) by dggpemm000001.china.huawei.com (7.185.36.245) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 17 Jun 2021 17:38:28 +0800 Subject: Re: [PATCH -next] riscv: mm: remove redundant trampoline PGD for 64bit To: , , , CC: , , , , References: <20210527144819.12101-1-sunnanyong@huawei.com> From: "Sunnanyong (Nanyong Sun, Intelligent Computing Solution Development Dep)" Message-ID: Date: Thu, 17 Jun 2021 17:38:27 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210527144819.12101-1-sunnanyong@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.125] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm000001.china.huawei.com (7.185.36.245) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/5/27 22:48, Nanyong Sun wrote: > Remove redundant trampoline PGD for 64bit and add more comment > for why 32bit systems need trampoline PGD. > > There was a patch and discussion similar to this,refer to > the link [1][2]. > > The trampoline PGD is redundant for 64bit systems because: > 1. The early PGD covers the entire kernel mapping. Directly > loading early PGD can achieve the result in boot stage. > A more trampoline PGD makes code hard to understand. > 2. Directly loading early PGD is safe in 64bit systems since > the kernel virtual address starts as 0xFFFFxxxxxxxxxxxx, > which has a very big gap with RAM address.It won't fall into > the corner case that 32bit system worrys. > 3. Remove redundant trampoline PGD can benefit to code maintaince, > because 64bit systems have more page table levels.For example: > If we want to support SV48 which has 4 page table levels, we have > to add a trampoline_pud and insert it before trampoline_pmd. > > Reference link: > [1]https://lore.kernel.org/linux-riscv/20190325092234.5451-4-anup.patel@wdc.com/ > [2]https://lkml.org/lkml/2019/3/28/147 Long time no response. Hi anup,     do you agree this?