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 90311C433EF for ; Sun, 30 Jan 2022 17:53:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC9F66B0072; Sun, 30 Jan 2022 12:53:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C7A396B0073; Sun, 30 Jan 2022 12:53:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B41A36B0074; Sun, 30 Jan 2022 12:53:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0131.hostedemail.com [216.40.44.131]) by kanga.kvack.org (Postfix) with ESMTP id A25F16B0072 for ; Sun, 30 Jan 2022 12:53:30 -0500 (EST) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 51FBD987A9 for ; Sun, 30 Jan 2022 17:53:30 +0000 (UTC) X-FDA: 79087700580.30.3D2ADD9 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf10.hostedemail.com (Postfix) with ESMTP id 3DF97C0002 for ; Sun, 30 Jan 2022 17:53:29 +0000 (UTC) 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 In-Reply-To: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 3DF97C0002 X-Stat-Signature: ox6cgga7wgync4dg1hhkcp66bupb7ax9 Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=S3r9Lfeu; dmarc=none; spf=none (imf10.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspam-User: nil X-HE-Tag: 1643565209-472391 Content-Transfer-Encoding: quoted-printable 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 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. > > >=20 > > > Rather begs the question of what memblock.c needs from linux/io.h. > > >=20 > > > Wouldn't it be better to: > > >=20 > > > +++ b/mm/memblock.c > > > @@ -18,7 +18,6 @@ > > > =A0#include > > >=20 > > > =A0#include > > > -#include > > >=20 > > > =A0#include "internal.h" > > >=20 > >=20 > > That was something I considered in the very beginning, but didn't hav= e > > a chance to verify it works for all architectures. I can take a look > > after I'm finished with other v2 changes. > >=20 > > > (allmodconfig on x86-64 builds fine with this; I have not done an > > > extended sweep of other arches / build options). >=20 > 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(vola= tile 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 ;-)