Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp329949pxb; Fri, 3 Sep 2021 03:08:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweaVHSillZ7s/XaVSHNlEUi6ZB5xAbUj5wq2aolBcMBxxaWZEAX9Bl+xTeYd2KIUrqXMK/ X-Received: by 2002:a17:906:700f:: with SMTP id n15mr3363875ejj.319.1630663704861; Fri, 03 Sep 2021 03:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630663704; cv=none; d=google.com; s=arc-20160816; b=cZR95YC5LiSA9bbeH0Inu5/hTcIZIJE3ZyVji+587yNE5HxzWrMH1zNEQxcWyP86kh jEe3hJ4mc/oA51raVBur1urQFvkILMiiZiggqug7/oQ9FevjaNoy/hemPrWfavBqkl4k evGgPA4rAcutdq4MufvggtsnvL8GtCHSFNMUIQDRnMMJEBsGewgSFFpAu6T8fWEDuvtc Y5qomDVVw+NNCiKFzTcMrcyHnMAtBxdJ/6HkywLZj9HH5e5QwmaX19wGG9Jx6zMNcSax qZdTgLju4J+PbteczRz6wT6OO0G6OdbvbPH9lHnP9synDnhF1IF+94LAugjU9MkmngZu 5oYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=9ySUST8+wjfOzYMrNCGkNG2++ojLvg7RvZflDL4194U=; b=qO/HlqsdNdlHQvWdvgnK/8vqgEzi73GBttNyjEVMJSX5kYN+n0Ln2ghaDhDj4WKXWP cjxY80yqZqTIwgYlSdUETDqg9M88Wcbx0CbtUW8vYKIDRsAyY8wz7Fx76FvBs7Zu6FkT 083NqAPKiEj1mYiXkWN7EQZ4fDB8HaGiBYlEYVsW8So+rQy1ml17E/BMksrJUPCr3sE5 cfoBlkaQdSrE/Svazpfr0rDihrdBKwNqujli1HjzBhCVCXhk8G0YWXEA3n63jZq9vs0J eN0d8jNgV1Wkj7ogobpKoMveG6N73ejr+9O5CQbQ/DZUD/A4HV9zBv8Zwv3bJmX8VblY JKGA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r23si6119189edy.23.2021.09.03.03.07.54; Fri, 03 Sep 2021 03:08:24 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349045AbhICKGi (ORCPT + 99 others); Fri, 3 Sep 2021 06:06:38 -0400 Received: from ivanoab7.miniserver.com ([37.128.132.42]:56336 "EHLO www.kot-begemot.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349041AbhICKG2 (ORCPT ); Fri, 3 Sep 2021 06:06:28 -0400 Received: from tun252.jain.kot-begemot.co.uk ([192.168.18.6] helo=jain.kot-begemot.co.uk) by www.kot-begemot.co.uk with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mM64b-0000nR-00; Fri, 03 Sep 2021 10:05:25 +0000 Received: from jain.kot-begemot.co.uk ([192.168.3.3]) by jain.kot-begemot.co.uk with esmtp (Exim 4.92) (envelope-from ) id 1mM64Y-0007Ox-E7; Fri, 03 Sep 2021 11:05:24 +0100 Subject: Re: [PATCH] um: don't use CONFIG_X86_{32,64} symbols on x86 To: Johannes Berg , David Laight , "linux-um@lists.infradead.org" Cc: "x86@kernel.org" , "linux-kernel@vger.kernel.org" References: <20210902102750.1ddfef4c1915.Icb5c49998c55b87c8584d46894c01b114ae2e661@changeid> <30ab717a9ba1c2bb17e2a6948ff61d26c4430772.camel@sipsolutions.net> From: Anton Ivanov Message-ID: Date: Fri, 3 Sep 2021 11:05:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <30ab717a9ba1c2bb17e2a6948ff61d26c4430772.camel@sipsolutions.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Score: -1.0 X-Spam-Score: -1.0 X-Clacks-Overhead: GNU Terry Pratchett Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/09/2021 09:40, Johannes Berg wrote: > On Fri, 2021-09-03 at 08:27 +0000, David Laight wrote: >> From: Johannes Berg >>> Sent: 02 September 2021 09:28 >>> >>> The CONFIG_X86_32 and CONFIG_X86_64 symbols are used by >>> both "real" x86 architecture builds and ARCH=um today. >>> However, clearly most people and places in the code are >>> treating it as the architecture Kconfig (technically >>> that's just CONFIG_X86) and use it to indicate that the >>> architecture is X86 in 32- or 64-bit flavour. >>> >>> This has caused a fair amount of issues in the past, >>> for example drivers not building because use x86 macros >>> or similar under CONFIG_X86_{32,64} ifdef, and then we >>> find build reports and add "!UML" to their Kconfig etc. >>> >>> However, this is error-prone and a kind of whack-a-mole >>> game, even with the build bots reporting things. >> I suspect you've just changed the 'mole'. > Yeah, that thought occurred to me too. > > >> You've now got lots of lines like: >> >> #if defined(CONFIG_X86_64) || defined(CONFIG_X86_64_UML) >> >> Missing off the UML define is going to cause the 32bit code >> to get compiled by mistake - which is likely to be more >> confusing that the places where you need to do special 'stuff' >> for UML > I'm not sure I agree though. > > Yes, I agree that I have a number of lines. But looking through them, we > have new ones: > - AFS, and it fundamentally wants to know the arch. If it misses one, > well, that can also happen with any other arch. > - XFS/falloc has arch-specific stuff again, and considers other > architectures too > - fs/ioctl.c is actually unnecessary since CONFIG_COMPAT doesn't exist > on UML > - same for blktrace > - BPF jit - not really sure about that one BPF jit IIRC works. People are using UML as a verifier in testing environments for the "does it load and run on this kernel version" test. > - crypto Kconfig - but again already considers different architectures > there > - sound - ok that's a stupid one :) > - lzo - again stuff that already considers many architectures > > But on the other side removal we have > - sysctl > - netfilter > - security > - many fixes to driver Kconfig that you don't see here because they're > *missing* "depends on !UML" now > > > So my gut feeling is that while we've indeed traded one mole for another > in a sense, the somewhat surprising places (like sound and BPF) are much > fewer, and most of the places that we now need it are places that are > already considering different architectures. +1. I'd rather fix all places the mole pops up once and for all. > > johannes > > > _______________________________________________ > linux-um mailing list > linux-um@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-um > -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/