Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp644755ybm; Tue, 21 May 2019 00:44:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkZr2teG3m6R6SPVQdfKMjDd/5eC+by43gb82XGTmKh5WW396acrreVGUiFMEctYA/vD+G X-Received: by 2002:a17:902:6b81:: with SMTP id p1mr79885858plk.207.1558424640069; Tue, 21 May 2019 00:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558424640; cv=none; d=google.com; s=arc-20160816; b=x2b2GCWs7U5a/NbVJw1evNDvblGwy4Rk1YOd2ugspnSdoEraca0OiUdu3GgXfXV80L QSSs5sWpbOEV2ACd+4IZBtbhrV7ldblnyry+OSBHG/p1dgsSajUAQwIZ1W+kqbqByH5c 2bByXjZDm3MyeHnePySjhcTeFQHITMu69mZZLKJz6xHMYbKOF29YColfj6ThQnEZ7te8 Hw9OYRAbi8FJkGJ2MdB1HmyGfxnc9rYA75lQ7CrddkVw8sKym/u2pWIfK7AeGgrMo5An 21Cpeg4/5BhvNCTBt8iO2qpzmYwsFrJ1DR4l/4Q7FZF9SOEy44S8TvQQBPT8rZffKV+4 0OOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from; bh=hr2rXdr3dhf+NsDH2pnynOGMl6qv+0Pu0iSmbXO2J0s=; b=Np3cRLOaK0fFZCLS0tOeC5JK2jH2hpkxyRcaO3Xe/0r5O9x8n+8sLE52DSfXBHIksr 0idht/DYMvpVeqjTuypD+PzF8yGxw4rQ8rJh/yJNsU0+XIAfy9qNBWQ49IdnEfQwYbXI kxaqmb18m/wnYDFgdYX1QuKiem6DEMXrDtt9vtHk5ugjCx7ygOwFGQ9anE3mXVOMIeVl fcRTZNL20kBtokJyuOrm5Pq5ssHcNQ+BdiSe863UVd++09qNo5hISj/EZ7iApE6+FkRe xH+DvTlRcftVbzBg4yv/j6ZgUTl+PZlsrHn+U1VLBpKCU2xy0yIoLqTdCDfPPfUlBQX1 IwbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s17si23194179pfc.273.2019.05.21.00.43.45; Tue, 21 May 2019 00:44:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726316AbfEUHmc convert rfc822-to-8bit (ORCPT + 99 others); Tue, 21 May 2019 03:42:32 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:42413 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725809AbfEUHmc (ORCPT ); Tue, 21 May 2019 03:42:32 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 457SQs0PKRz9s55; Tue, 21 May 2019 17:42:29 +1000 (AEST) From: Michael Ellerman To: Masahiro Yamada , Christophe Leroy Cc: linuxppc-dev , Paul Mackerras , Linux Kernel Mailing List Subject: Re: [PATCH] powerpc/mm: mark more tlb functions as __always_inline In-Reply-To: References: <20190521061659.6073-1-yamada.masahiro@socionext.com> <16d967dd-9f8f-4e9e-97fd-3f9761e5d97c@c-s.fr> Date: Tue, 21 May 2019 17:42:27 +1000 Message-ID: <87y3306yos.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Masahiro Yamada writes: > On Tue, May 21, 2019 at 3:54 PM Christophe Leroy > wrote: >> Le 21/05/2019 à 08:16, Masahiro Yamada a écrit : >> > With CONFIG_OPTIMIZE_INLINING enabled, Laura Abbott reported error >> > with gcc 9.1.1: >> > >> > arch/powerpc/mm/book3s64/radix_tlb.c: In function '_tlbiel_pid': >> > arch/powerpc/mm/book3s64/radix_tlb.c:104:2: warning: asm operand 3 probably doesn't match constraints >> > 104 | asm volatile(PPC_TLBIEL(%0, %4, %3, %2, %1) >> > | ^~~ >> > arch/powerpc/mm/book3s64/radix_tlb.c:104:2: error: impossible constraint in 'asm' >> > >> > Fixing _tlbiel_pid() is enough to address the warning above, but I >> > inlined more functions to fix all potential issues. >> > >> > To meet the 'i' (immediate) constraint for the asm operands, functions >> > propagating propagated 'ric' must be always inlined. >> > >> > Fixes: 9012d011660e ("compiler: allow all arches to enable CONFIG_OPTIMIZE_INLINING") >> > Reported-by: Laura Abbott >> > Signed-off-by: Masahiro Yamada >> > --- >> > >> > arch/powerpc/mm/book3s64/hash_native.c | 8 +++-- >> > arch/powerpc/mm/book3s64/radix_tlb.c | 44 +++++++++++++++----------- >> > 2 files changed, 30 insertions(+), 22 deletions(-) >> > >> > diff --git a/arch/powerpc/mm/book3s64/hash_native.c b/arch/powerpc/mm/book3s64/hash_native.c >> > index aaa28fd918fe..bc2c35c0d2b1 100644 >> > --- a/arch/powerpc/mm/book3s64/hash_native.c >> > +++ b/arch/powerpc/mm/book3s64/hash_native.c >> > @@ -60,9 +60,11 @@ static inline void tlbiel_hash_set_isa206(unsigned int set, unsigned int is) >> > * tlbiel instruction for hash, set invalidation >> > * i.e., r=1 and is=01 or is=10 or is=11 >> > */ >> > -static inline void tlbiel_hash_set_isa300(unsigned int set, unsigned int is, >> > - unsigned int pid, >> > - unsigned int ric, unsigned int prs) >> > +static __always_inline void tlbiel_hash_set_isa300(unsigned int set, >> > + unsigned int is, >> > + unsigned int pid, >> > + unsigned int ric, >> > + unsigned int prs) >> >> Please don't split the line more than it is. >> >> powerpc accepts lines up to 90 chars, see arch/powerpc/tools/checkpatch.pl > > Ugh, I did not know this. Horrible. > > The Linux coding style should be global in the kernel tree. > No subsystem should adopts its own coding style. Well that ship sailed long ago. But we don't have our own coding style, we just don't enforce 80 columns rigidly, there are cases where a slightly longer line (up to ~90) is preferable to a split line. In a case like this with a long attribute and function name I think this is probably the least worst option: static __always_inline void tlbiel_hash_set_isa300(unsigned int set, unsigned int is, unsigned int pid, unsigned int ric, unsigned int prs) { ... cheers