Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1436353pxm; Thu, 24 Feb 2022 03:11:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdzup6WPzIPOoAiafRSN6k+npo2cL0hgsJzTQ/GtOjOYxkmMx1/rS0/AtEW/nZhmpNMKQj X-Received: by 2002:a17:902:c713:b0:150:506:dc0b with SMTP id p19-20020a170902c71300b001500506dc0bmr2219780plp.116.1645701068088; Thu, 24 Feb 2022 03:11:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645701068; cv=none; d=google.com; s=arc-20160816; b=N0Bz8VKh4TSH+tyh1Pk5lBnv0WxbiNUeMV6sdL7f7Os5GZ42cNYjk3oW3x95TJbz5b Mg8RfSV06SjAIW2mT5Lbd14ECLg5d7A2a3F34WMzvtMO/vwzotZzCpNMsOf/w3ID8AI2 cUEgmviuViFuQzwx0zQVk1sijJivknFmBNHI8Azikg7f5vNefqwYEUJlANGQ8/I9zrVA hWijkVDKz1ab2Raq6FHJwRQ/9J8WodMFNY5ivGGCjqExRhNvwFBgFq4gLnimDqwIk9wM g+8EiLsPfjyDFk7uvc7P4PRJI2GbJGDh2CHkeKBSAEfJFkKqlji/xqhSiha9iRFlRqvS SRyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=SvEsEOh13ykWAhTNKj8pxoNW2D9ipfc3VojKP9HyO9g=; b=rOrWUAzuj3IOOmxSW6BHI/TXrRiOZKhBN1i75v3LecsziiYA/WNvD1z/uqqaThw0HJ a52LVDrBk+hX01oy7cEyevzCuhrYg9B8q7NbQlnakoOY27y4OuYdnf9JHEVVKjrQ0wYy EQO/YcKfuuiGpAGFJ23XPbyrpnNAk7N+OBZ4/Ha962PrKpdqEuPtk8gs7VZ2Aj4MHLHa ccrF4echBUeytLzNfBCSN4++K5yPaLuzEtp/29tqSbUFYiPWc2Lhlo0qZvEyulVH0NoI SVOEsRnOP7BSq9UguhHqfxAksERzb/uWnrOX4m9ASxj1Abx3xDFwwjBnX4UZiMAazlR/ /d8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j8si2054242pjm.146.2022.02.24.03.10.50; Thu, 24 Feb 2022 03:11:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233369AbiBXKVX (ORCPT + 99 others); Thu, 24 Feb 2022 05:21:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233259AbiBXKVV (ORCPT ); Thu, 24 Feb 2022 05:21:21 -0500 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A806228AD8A; Thu, 24 Feb 2022 02:20:51 -0800 (PST) Received: from mail-wr1-f50.google.com ([209.85.221.50]) by mrelayeu.kundenserver.de (mreue011 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MXGes-1njfQ746pi-00YmL0; Thu, 24 Feb 2022 11:20:50 +0100 Received: by mail-wr1-f50.google.com with SMTP id d3so2214147wrf.1; Thu, 24 Feb 2022 02:20:49 -0800 (PST) X-Gm-Message-State: AOAM533t6iTrUnDjXs91EkyUdw/i+4T2YIL0LCAWx1rrZwdQl4w42abM aNCNdpGiGEA0243pLllXnw/FE/ElHaNQxRdY21A= X-Received: by 2002:adf:a446:0:b0:1ed:c41b:cf13 with SMTP id e6-20020adfa446000000b001edc41bcf13mr1730833wra.407.1645698049603; Thu, 24 Feb 2022 02:20:49 -0800 (PST) MIME-Version: 1.0 References: <20220223135820.2252470-1-anders.roxell@linaro.org> <20220223135820.2252470-2-anders.roxell@linaro.org> <1645670923.t0z533n7uu.astroid@bobo.none> <1645678884.dsm10mudmp.astroid@bobo.none> <1645694174.z03tip9set.astroid@bobo.none> In-Reply-To: <1645694174.z03tip9set.astroid@bobo.none> From: Arnd Bergmann Date: Thu, 24 Feb 2022 11:20:33 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/3] powerpc: fix build errors To: Nicholas Piggin Cc: Arnd Bergmann , Anders Roxell , Linux Kernel Mailing List , linuxppc-dev , Michael Ellerman , "# 3.4.x" Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:LWUNT/sGK0HY/3BZxg1QBBPTyVYsoKoxgJRq/XKM3pe027b7LyS vonMhlfRGOdiZfd8mFiGpiqQCqosCRtDF/D9eOxbdak5QsgUp4kWHGo6WPYxoZTA6sGRYEe 7XjMBecOLGZjBqFkkaSivTd4KAVl8YUHHdarRMYT1IRvOUx2dMoa9msU/T0q23J7PIhrFyg MQHkkBhXH8LuRInHSLvEw== X-UI-Out-Filterresults: notjunk:1;V03:K0:2ZtXFukJpyc=:lO0BW73fgg7XvxbWSbggKz UcynFwt8Y0UltheQzkOVVFAfbsmb3sbJA/9rj6Donl9T8a04110IsQkRYlbgCtQNJMvi7s8IF 7s3MfFda7sH1PZ+yTi0wP7zzrev9pWUblH84mo+29DrX/JsTXBR2fP0Rg28qI1maS4+oVoBiV hyF1ujBzzSCPcTzpiWSwDQ8/6NDZKmRwAd4Sx8H/sLaof4CzUfw1xgIYZ9G2PE1zXJbxkwwwn V3Lco8Dm7hIilLKZ0CDaI1gBYdfUl9VFgmtxHibRdTuKxCPn+ydx4a7o9M3q+H777KVBwE9B+ 4C4JoOAP4Xlhad3IUnU3KdM/FXU5Wf3E0LHZsAShIRcG57SqYd8S9i2+uAtcXJVzW+jLh1jNr Zqw5WsSO4rytzLMp3l+7gF7WD40pH0Ng7h/VetdA+PDXAA4npcMk3VhpEK6OwWeYMUjoZSbEy ozMbgmFThkhsP3+BTv/DOpThxiCCLXCjD9p56Q4mtasnoO1OdC3V8yfvlL2hpQVUi8SZ1rd0h 0iDZ1sJGit4vMSHAHK+O4GBCQxck3oX4t2q3zf1kvBv0mR7oJ+dtIwsqdyI/oppdwF52Hlr// Xrmb3ChzOXQflpUkgtmCc6t6ddlElrI5UMOhHwZ0mz4XhJtQUlO7QR41J3nNsTQuZC6XIORg8 Ee1bWfJqhSzS+V3F126gUSENLcJs2PAlF/gm1LaWyisZKM9gjjIkVMVAGODjew3xerm2EClT7 KIxyuJVKBhEc99BZD1gnTJOHq5IT6L0RZ6+AIKAhlDyZ1BBNDtrgU1yGnZLj1nFn6xDwTm1LI IVEGJLgcVjIB8Nwr92fyQKeT42/PzN3yWDrQMNDMwZ7+KyPZzA= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 24, 2022 at 11:11 AM Nicholas Piggin wrote: > Excerpts from Arnd Bergmann's message of February 24, 2022 6:55 pm: > > On Thu, Feb 24, 2022 at 6:05 AM Nicholas Piggin wrote: > > We had the same thing on Arm a few years ago when binutils > > started enforcing this more strictly, and it does catch actual > > bugs. I think annotating individual inline asm statements is > > the best choice here, as that documents what the intention is. > > A few cases where there are differences in privileged instructions > (that won't be compiler generated), that will be done anyway. > > For new instructions added to the ISA though? I think it's ugly and > unecesaary. There is no ambiguity about the intention when you see > a lharx instruction is there? > > It would delinate instructions that can't be used on all processors > but I don't see much advantage there, it's not an exhaustive check > because we have other restrictions on instructions in the kernel > environment. And why would inline asm be special but not the rest > of the asm? Would you propose to put these .machine directives > everywhere in thousands of lines of asm code in the kernel? I > don't know that it's an improvement. And inline asm is a small > fraction of instructions. Most of the code is fine, as we tend to only build .S files that are for the given target CPU, the explicit .machine directives are only needed when you have a file that mixes instructions for incompatible machines, using a runtime detection. > Right that should be caught if you just pass -m architecture > to the assembler that does not include the mtpmr. 32-bit is a lot more > complicated than 64s like this though, so it's pssible in some cases > you will want more checking and -m + some .machine directives > will work better. > > Once you add the .machine directive to your inline asm though, you lose > *all* such static checking for the instruction. So it's really not a > panacea and has its own downsides. Again, there should be a minimum number of those .machine directives in inline asm as well, which tends to work out fine as long as the entire kernel is built with the correct -march= option for the minimum supported CPU, and stays away from inline asm that requires a higher CPU level. Arnd