Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp331120iob; Fri, 13 May 2022 02:40:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbfhpP/6khGTE6oNfut0K6PxuevRZDm2Lrgbr+dTdH/Q60p30QVyqxUUAr+QP5gXoMvGhU X-Received: by 2002:a65:6e9a:0:b0:382:1804:35c8 with SMTP id bm26-20020a656e9a000000b00382180435c8mr3361189pgb.584.1652434858598; Fri, 13 May 2022 02:40:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652434858; cv=none; d=google.com; s=arc-20160816; b=SaFenmumcNoJftfbuNBtKXuGKE5CIRxAkYWh23z9YuOPdTglDtkUhaudxI6CDJCqgM ZcUJRjkhNXiyYavzWLkA7VmRDj/W0cTGJkLbu3zLZ9EB+lqIOKPFQihhdTyVi8jP8KoV 94qVWS8QV/g/Wko+J+RUyUZJ6X8MNzlYV+rvEl0JOLT+4L8QaUPS5LiU1qJkc3q2DaBU sAEFIXEpmV27Jz4xHMHqwg/XCO/H+GpwXOmr6b5v0cabCgqOunn61pbSkD6doqLfNoOm M2rrhX70FKdjAXwP1lGYNoYH2y8dmHSlMKyKre+gY3ZzlJ9Zaq8WXORQ137n+bHZQ7lf fWPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=APUbB+93DyVLuD6+hyg/+708T6yqeK29pgQNUVEg540=; b=e35AebDWR+SpxMsn6MxhGiiiRwNB5LYreknNp164AluAkRiPsdAnC4ZGTMAoNewrn5 dNLmb9lldneh4o6SX6bpX5V7HgLZlIh5bXGjXyUAfPqFk8KCjBiWeOATsQnoWuJ+LQmL /WVox5w+gctH8QofRfhuWdu000HgGlDdvZNh2H8crU1+LgIY7pKDYLR8zpvlGbMGHJ7U IQu2kmQk24Z8bxxLAE+W2Sb4ex4KY/Mv3T/y+sDGf6Qm8LcmKAQ1NRpy68meOG6dMxcW utz2LMID5vjPR1iOQZW4bb9FG6GbX88OQqVRb3tFcBGpcgFFpvrSL+mOj6EBVfdXiXXd 1D/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ngO8388P; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a056a00098600b0050df0383302si2695135pfg.255.2022.05.13.02.40.40; Fri, 13 May 2022 02:40:58 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ngO8388P; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354202AbiELTHJ (ORCPT + 99 others); Thu, 12 May 2022 15:07:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357878AbiELTHE (ORCPT ); Thu, 12 May 2022 15:07:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF8C82457B9; Thu, 12 May 2022 12:07:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 103EE61B87; Thu, 12 May 2022 19:07:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD27CC385B8; Thu, 12 May 2022 19:07:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652382422; bh=UAhhpbytMvD5GfxmgGkk/MtSBThhQKdLGrX/1MNtNA8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ngO8388PC0TyRKE6gLj7jvwizRWRPkJKgXmmKrxbqDGcTq1kvkKMFwlRuhdcfOreR F19MBziPbLyG6srNayZkpqIworEmPnsbdVXw4ZKh/ePQ/sh5f0DuZ6Oo7qGy/mN12e Ix0ubp1oYNMDSlYrYryPW6LBd9MF0q7Xs60lLkoesQP3x8ALiELwb0nCl51tZfYnoy gTnX0Kaqsi8lBUP7QWqDMIkG+VS2GEZHpd2RVsVYEQKdWs+YTJgv6uCUlcsrUdj5hu vqcpfBOBPturfU1Pfhvms+qNzjJa+92sS1kIQcX4BMRr8MG945W+KEy4o8YmiIUVEq nIdCzP0vRn5rw== Date: Thu, 12 May 2022 12:06:59 -0700 From: Nathan Chancellor To: Heiko Carstens Cc: Vasily Gorbik , Alexander Gordeev , Jonas Paulsson , Ulrich Weigand , Masahiro Yamada , Alexander Egorenkov , Sven Schnelle , Andreas Krebbel , Nathan Chancellor , Nick Desaulniers , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Subject: Re: [PATCH 4/8] s390/entry: workaround llvm's IAS limitations Message-ID: References: <20220511120532.2228616-1-hca@linux.ibm.com> <20220511120532.2228616-5-hca@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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, May 12, 2022 at 07:24:25PM +0200, Heiko Carstens wrote: > On Wed, May 11, 2022 at 10:30:05AM -0700, Nathan Chancellor wrote: > > Hi Heiko, > > > > On Wed, May 11, 2022 at 02:05:28PM +0200, Heiko Carstens wrote: > > > llvm's integrated assembler cannot handle immediate values which are > > > calculated with two local labels: > > > > > > :3:13: error: invalid operand for instruction > > > clgfi %r14,.Lsie_done - .Lsie_gmap > > > > > > Workaround this by adding clang specific code which reads the specific > > > value from memory. Since this code is within the hot paths of the kernel > > > and adds an additional memory reference, keep the original code, and add > > > ifdef'ed code. > > > > > > Signed-off-by: Heiko Carstens > > > --- > > > arch/s390/kernel/entry.S | 11 +++++++++++ > > > 1 file changed, 11 insertions(+) > > > > > > diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S > > > index e1664b45090f..ff7a75078e93 100644 > > > --- a/arch/s390/kernel/entry.S > > > +++ b/arch/s390/kernel/entry.S > > > @@ -171,8 +171,19 @@ _LPP_OFFSET = __LC_LPP > > > .macro OUTSIDE reg,start,end,outside_label > > > larl %r14,\start > > > slgrk %r14,\reg,%r14 > > > +#ifdef CONFIG_CC_IS_CLANG > > > > I intend to put this series through my build and boot test matrix later > > today but one fly by comment in the meantime. Should this be > > CONFIG_AS_IS_LLVM if this is an integrated assembler limitation, rather > > than a clang one? > > Yes, that makes a lot of sense. Considering that I will drop the > previous patch within this series, the new version looks like: > > From fe4fb0b014378d84ae517deaea338577b2ea6ae0 Mon Sep 17 00:00:00 2001 > From: Heiko Carstens > Date: Sat, 7 May 2022 15:00:40 +0200 > Subject: [PATCH 3/7] s390/entry: workaround llvm's IAS limitations > > llvm's integrated assembler cannot handle immediate values which are > calculated with two local labels: > > :3:13: error: invalid operand for instruction > clgfi %r14,.Lsie_done - .Lsie_gmap > > Workaround this by adding clang specific code which reads the specific > value from memory. Since this code is within the hot paths of the kernel > and adds an additional memory reference, keep the original code, and add > ifdef'ed code. > > Signed-off-by: Heiko Carstens > --- > arch/s390/kernel/entry.S | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > > diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S > index a6b45eaa3450..f2f30bfba1e9 100644 > --- a/arch/s390/kernel/entry.S > +++ b/arch/s390/kernel/entry.S > @@ -172,9 +172,19 @@ _LPP_OFFSET = __LC_LPP > lgr %r14,\reg > larl %r13,\start > slgr %r14,%r13 > - lghi %r13,\end - \start > - clgr %r14,%r13 > +#ifdef CONFIG_AS_IS_LLVM > + clgfrl %r14,.Lrange_size\@ > +#else > + clgfi %r14,\end - \start > +#endif > jhe \outside_label > +#ifdef CONFIG_CC_IS_CLANG I think this one also wants to be CONFIG_AS_IS_LLVM, right? Other than that, seems fine to me, although I have no knowledge of s390 assembly so that statement probably means next to nothing :) Cheers, Nathan > + .section .rodata, "a" > + .align 4 > +.Lrange_size\@: > + .long \end - \start > + .previous > +#endif > .endm > > .macro SIEEXIT > -- > 2.32.0