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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F7E8C433EF for ; Thu, 28 Apr 2022 01:40:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 64AA76B0071; Wed, 27 Apr 2022 21:40:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5D2D66B0072; Wed, 27 Apr 2022 21:40:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44C4D6B0073; Wed, 27 Apr 2022 21:40:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 32AF86B0071 for ; Wed, 27 Apr 2022 21:40:43 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id E777B293D1 for ; Thu, 28 Apr 2022 01:40:42 +0000 (UTC) X-FDA: 79404583524.25.2D27543 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf31.hostedemail.com (Postfix) with ESMTP id AF2872005B for ; Thu, 28 Apr 2022 01:40:32 +0000 (UTC) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Kpdb32GSvz1JBbH; Thu, 28 Apr 2022 09:39:43 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 28 Apr 2022 09:40:38 +0800 Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 28 Apr 2022 09:40:37 +0800 Message-ID: <09b7afdf-fb5c-486d-cc95-e1c9c0994cbb@huawei.com> Date: Thu, 28 Apr 2022 09:40:37 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH 1/4] mm: ioremap: Setup phys_addr of struct vm_struct Content-Language: en-US To: Andrew Morton CC: Catalin Marinas , Will Deacon , , , References: <20220427121413.168468-1-wangkefeng.wang@huawei.com> <20220427121413.168468-2-wangkefeng.wang@huawei.com> <20220427101040.bd4532c8ef093b47b3dd9eb5@linux-foundation.org> From: Kefeng Wang In-Reply-To: <20220427101040.bd4532c8ef093b47b3dd9eb5@linux-foundation.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: AF2872005B X-Stat-Signature: ipcf7joyeo8bxashy18tf7d5qwdsp35c X-Rspam-User: Authentication-Results: imf31.hostedemail.com; dkim=none; spf=pass (imf31.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1651110032-216270 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 2022/4/28 1:10, Andrew Morton wrote: > On Wed, 27 Apr 2022 20:14:10 +0800 Kefeng Wang wrote: > >> Show physical address in /proc/vmallocinfo. >> >> Signed-off-by: Kefeng Wang >> --- >> mm/ioremap.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/mm/ioremap.c b/mm/ioremap.c >> index 5fe598ecd9b7..522ef899c35f 100644 >> --- a/mm/ioremap.c >> +++ b/mm/ioremap.c >> @@ -32,6 +32,7 @@ void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot) >> if (!area) >> return NULL; >> vaddr = (unsigned long)area->addr; >> + area->phys_addr = addr; >> >> if (ioremap_page_range(vaddr, vaddr + size, addr, __pgprot(prot))) { >> free_vm_area(area); > Acked-by: Andrew Morton > > I checked a bunch of arch-specific implementations of ioremap_prot() > and they're already doing this. As far as I can tell, only csky and > riscv actually use this file (CONFIG_GENERIC_IOREMAP=y). But you're > ARM(?) so I'm wondering how come you're patching it? Hi Andrew, I found this via reading code when debug some other issue, meanwhile,  there are some code duplication of ioremap between arm64 and generic ioremap, so 1) bugfix: fix the above issue and test on riscv 2) cleanup: convert arm64 to use GENERIC_IOREMAP, 3) feature: after that, enable HAVE_IOREMAP_PROT on arm64 > > Someone should do s/addr/phys_addr/ in this function, like the rest of > the world (sensibly) does. I will make it in next version. > > > .