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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1580FC433FE for ; Sun, 30 Jan 2022 17:53:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355767AbiA3Rxf (ORCPT ); Sun, 30 Jan 2022 12:53:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355752AbiA3Rxd (ORCPT ); Sun, 30 Jan 2022 12:53:33 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F845C061714 for ; Sun, 30 Jan 2022 09:53:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=q9+EHyu3P4aG//IMUenHLzdEoIKfstwmum3ucRb3ZQA=; b=S3r9LfeuVn6akyjWXqk1xuvdjY o5U2C1SIFQv8tj3jbbkVZnPUpir/uXZ1JyNHt2gGpKaBl+zrpM0HiIuMFSfqXus+kR/D4CczvTWtX YMjaHJzN30XCg7WDywJ1hoAtqm76/4rne/bTutVxJxk4ZQaeSqJLGSJDy7lPaJTASjkme+eTXK6bL AKDNo2/33nfflm4p0kZNfK6hpeI5LmM06zMHbEJmzN9blNAymt4p0KexfvBh0MiwSc55EdVbH29N3 i6Zjf+RfrDybuZYHvqNKl0l3ZJtCWvwTTZ0qve/Br/FkToBo37ASO1O4DrvzjHe3QOH42VDSFOfgy fLBEKRPw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nEEOC-008f7O-DC; Sun, 30 Jan 2022 17:53:24 +0000 Date: Sun, 30 Jan 2022 17:53:24 +0000 From: Matthew Wilcox To: Mike Rapoport Cc: Karolina Drobnik , linux-mm@kvack.org, akpm@linux-foundation.org, mike.rapoport@gmail.com, linux-kernel@vger.kernel.org, Arnd Bergmann Subject: Re: [PATCH 07/16] tools/include: Add io.h stub Message-ID: References: <2d9aa000afe81b45157617664134b871207c2067.1643206612.git.karolinadrobnik@gmail.com> <48499a57afb3d27df26b39aa4255b4ba583c1148.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 30, 2022 at 06:10:00PM +0200, Mike Rapoport wrote: > On Fri, Jan 28, 2022 at 12:21:59PM +0100, Karolina Drobnik wrote: > > On Thu, 2022-01-27 at 14:09 +0000, Matthew Wilcox wrote: > > > On Thu, Jan 27, 2022 at 02:21:25PM +0100, Karolina Drobnik wrote: > > > > Add a dummy io.h header. > > > > > > Rather begs the question of what memblock.c needs from linux/io.h. > > > > > > Wouldn't it be better to: > > > > > > +++ b/mm/memblock.c > > > @@ -18,7 +18,6 @@ > > >  #include > > > > > >  #include > > > -#include > > > > > >  #include "internal.h" > > > > > > > That was something I considered in the very beginning, but didn't have > > a chance to verify it works for all architectures. I can take a look > > after I'm finished with other v2 changes. > > > > > (allmodconfig on x86-64 builds fine with this; I have not done an > > > extended sweep of other arches / build options). > > I did a sweep for defconfigs for all arches and all were fine. Thanks for doing the sweep, Mike. I think I found a deeper problem which is masked due to our maze of header files: include/asm-generic/io.h:#ifndef virt_to_phys include/asm-generic/io.h:#define virt_to_phys virt_to_phys so there's an assumption that defines virt_to_phys(). You can see that in a number of architectures, eg: arch/alpha/include/asm/io.h:static inline unsigned long virt_to_phys(volatile void *address) arch/ia64/include/asm/io.h:#define virt_to_phys virt_to_phys arch/mips/include/asm/io.h:#define virt_to_phys virt_to_phys arch/nios2/include/asm/io.h:#define virt_to_phys(vaddr) \ arch/parisc/include/asm/io.h:#define virt_to_phys(a) ((unsigned long)__pa(a)) arch/powerpc/include/asm/io.h:#define virt_to_phys virt_to_phys arch/sh/include/asm/io.h:#define virt_to_phys(address) ((unsigned long)(address)) arch/x86/include/asm/io.h:#define virt_to_phys virt_to_phys That's clearly not the right place to define it. Two architectures put it in asm/memory.h: arch/arm/include/asm/memory.h:#define virt_to_phys virt_to_phys arch/arm64/include/asm/memory.h:#define virt_to_phys virt_to_phys then: arch/m68k/include/asm/virtconvert.h:#define virt_to_phys virt_to_phys arch/sparc/include/asm/page_32.h:#define virt_to_phys __pa arch/sparc/include/asm/page_64.h:#define virt_to_phys __pa This needs to be properly sorted out, but I don't want to tell Karolina that's now her job as a prerequisite for merging this patchset; that would be unfair. Cc'ing Arnd. This is the kind of awful mess that he loves fixing ;-)