Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1057462rwe; Thu, 1 Sep 2022 11:47:01 -0700 (PDT) X-Google-Smtp-Source: AA6agR6P6T2l/fhSgQF2alc/2ymknt+eOk97CFINzte9MnOgMinBQFqhWb+LgW4VU9AzQpLEMfcU X-Received: by 2002:a63:1a04:0:b0:42b:d33a:2613 with SMTP id a4-20020a631a04000000b0042bd33a2613mr19816703pga.429.1662058021482; Thu, 01 Sep 2022 11:47:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662058021; cv=none; d=google.com; s=arc-20160816; b=ZN1jcmnot3PJ/kJeiGUl/vsQE2fHSZSFuEVUhV92VLMZJaNozQ/VSHkybLJVVq3Fcj ldz51twhBjy+QdW2plJYM72kKiTLibetYQvTh53q8kbQdn/RV2t8d5Pvu8oDMEIOS5xg c2u4vLN1x4+xDplcXdh9Zta9sQCDxMwZURWRYjg2F/DOROR+XpvqZQPpMlC2VC73dBjn GsRBZg0as0Sr9hVM0tM2fWgTS8qJgbqLm30MVMwfqN4d8GOx7e40pBjXwunyXx8AkJ9i w558UyWfJaNF/13jThrDEojnUASyvkShqaBiOvZQPvRqKpeCIqrR3V/3RyQCLmnu3qij zTMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=r++OPeHeMbZfdobT0p5R6vQyoLemx/l+zo3wwGOUcIg=; b=QLUoZqGeWjgra9YU0taj83tmS7xhoIhEfiEP4iaCGLvAW8/dKkbCJ6BhXsujv/2x75 1qEJMJwI4YlOzdNDAxKNWIieZSaYFX0ZND0qXpoj5Z3nBa26lflvydYgOBQ5CMbMDqHG UunkBn9soq9lfHj/ze3OjSkF2Fo7v6jWldybgNoXVRFuihf/LIQijneECPi/cedy1swI WPOgmdcn75KiFypu2S3UQzQ/iRv3+NkOdtYFJ9ezYJ25jHcXKBn7SSWZE/l0XIbPIJ1U cbploZ8hM8iNMrdpvJQMDYUWSjkkhqLQhFGdl/48KWwOuPknT/45g+KRAwokwOS8TZHG Ic1g== 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 c4-20020a63ef44000000b0042ae0312f65si8368486pgk.128.2022.09.01.11.46.50; Thu, 01 Sep 2022 11:47:01 -0700 (PDT) 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 S233595AbiIASOJ (ORCPT + 99 others); Thu, 1 Sep 2022 14:14:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229781AbiIASOH (ORCPT ); Thu, 1 Sep 2022 14:14:07 -0400 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AB06246DAE for ; Thu, 1 Sep 2022 11:14:05 -0700 (PDT) Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 281I7qru032240; Thu, 1 Sep 2022 13:07:52 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 281I7phS032237; Thu, 1 Sep 2022 13:07:51 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 1 Sep 2022 13:07:51 -0500 From: Segher Boessenkool To: Gabriel Paubert Cc: Christophe Leroy , Michael Ellerman , Zhouyi Zhou , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" , Nicholas Piggin Subject: Re: [PATCH v2] powerpc: Fix irq_soft_mask_set() and irq_soft_mask_return() with sanitizer Message-ID: <20220901180751.GH25951@gate.crashing.org> References: <7c11b659-5b8e-256c-508e-39395041fccb@csgroup.eu> <20220831224522.GX25951@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,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, Sep 01, 2022 at 09:37:42AM +0200, Gabriel Paubert wrote: > On Thu, Sep 01, 2022 at 05:22:32AM +0000, Christophe Leroy wrote: > > Le 01/09/2022 ? 00:45, Segher Boessenkool a ?crit?: > > > I would have used real assembler code here (in a .s file). But there > > > probably are reasons to do things this way, performance probably? > > > > We changed it to inline asm in order to ... inline it in the caller. > > And there is a single caller it seems. Typically GCC inlines function > with a single call site, but it may be confused by asm statements. "Confused"... It might estimate the assembler statement to be significantly more expensive than it really is. The compiler has to be somewhat conservative, to be able to generate code that can be assembled without errors. It counts instructions by counting newlines and semis and that kind of thing. Since GCC 7 there is "asm inline", to make the compiler think for inlining purposes that the asm outputs minimum size code. You can use asm_inline in the kernel for this. > > I also find that those operand names make it awull more difficult to > > read that traditional numbering. I really dislike that new trend. Yup. All the extra markup it needs doesn't benefit readability either. > > And same with those // comments, better use meaningfull C variable names. I wrote: > > > Comments like "// Inputs" are just harmful. As is the "creative" > > > indentation here. Both harm readability and do not help understanding > > > in any other way either. This is a comment trying to explain (GNU) C syntax. I certainly agree that variable naming is very important, but this was meant as commentary on a worse comment offence :-) Segher