From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 40D05385842C for ; Fri, 18 Feb 2022 04:21:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 40D05385842C Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 21I2dk7l025091; Fri, 18 Feb 2022 04:21:34 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3ea23q29ev-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Feb 2022 04:21:34 +0000 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 21I4LYH0026156; Fri, 18 Feb 2022 04:21:34 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com with ESMTP id 3ea23q29eq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Feb 2022 04:21:33 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 21I4C3RK009349; Fri, 18 Feb 2022 04:21:33 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma02dal.us.ibm.com with ESMTP id 3e64hdqyjg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 18 Feb 2022 04:21:33 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 21I4LWD537814758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Feb 2022 04:21:32 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 11A9F7805F; Fri, 18 Feb 2022 04:21:32 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8254C7805C; Fri, 18 Feb 2022 04:21:31 +0000 (GMT) Received: from [9.160.83.230] (unknown [9.160.83.230]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 18 Feb 2022 04:21:31 +0000 (GMT) Message-ID: <1f433717-0b26-4c53-6f21-9efeab7dcdc7@linux.ibm.com> Date: Thu, 17 Feb 2022 22:21:30 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: regression with binutils 2.28 for ppc Content-Language: en-US To: Alan Modra Cc: Waldemar Brodkorb , binutils@sourceware.org References: <8b8a3144-5c59-786f-a2ba-6f8813d60845@linux.ibm.com> From: Peter Bergner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: DDq5PH2oTVisLFmsbxTCtUoFWOkY01KG X-Proofpoint-GUID: GgcfDaocUjc0jXSBmaqphurd18CA_opP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-02-18_01,2022-02-17_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0 bulkscore=0 malwarescore=0 adultscore=0 mlxscore=0 phishscore=0 priorityscore=1501 clxscore=1015 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202180021 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Feb 2022 04:21:38 -0000 On 2/17/22 7:34 PM, Alan Modra wrote: > On Thu, Feb 17, 2022 at 02:03:24PM -0600, Peter Bergner wrote: >> On 2/17/22 3:28 AM, Waldemar Brodkorb wrote: >>> -mcpu=powerpc -mbig-endian -m32 -msoft-float -mcpu=powerpc64 -mno-altivec -mno-vsx >> >> So a 32-bit compile, which is why the assembler complains about ptesync. > > Not from what you posted there. The last -mcpu=powerpc64 ought to > enable ppc64. If you remove that, then yes, you'll get a complaint > about ptesync. Well it's a 32-bit compile in that the obj is Elf32: linux$ gcc -m32 -mcpu=powerpc64 simple.c linux$ file a.out a.out: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=804e1b0621e258ef9a1e4691d5f0764e4c5e852a, not stripped That said, the -mcpu=power64 with newish gccs seems to emit a .machine ppc64. The older gcc I was using seems to emit a ".machine ppc" which is why I saw the same issue with ptesync when using a new binutils. >> You could try adding -Wa,-mppc64 or -Wa,-many to your options as a work around. >> Newish GCCs removed passing -many to the assembler and the commit you >> mentioned changed handling of sticky cpu options which is exposing the >> issue. > > -Wa cpu hacks won't work any more. Ah right, thanks for correcting me! >> The use of those ptesyncs in the kernel really needs to be audited though! >> If they are legitimate, then the inline assembler needs to wrap their >> use with ".machine push ; .machine ppc64 ; ptesync ; .machine pop". > > Right. Or we should allow the user command line to control the > assembler, even with -Wa,-many if they so desire. But that's killed > by that stupid .machine from gcc. I thought we were moving towards more reliance on .machine and not away from it? You think we shouldn't be? > I didn't even get as far as Waldemar. With recent gcc, binutils and > linux git source my > ARCH=powerpc CROSS_COMPILE=powerpc-linux- pmac32_defconfig > kernel compile bombs here: > [snip] > {standard input}:997: Error: unrecognized opcode: `mfsrin' [snip] > So, last -mcpu is powerpc64. gas quite correctly flags an error on > instructions phased out for ppc64. This is probably the difference between new gccs emiting .machine ppc64 when using -mcpu=powerpc64 and old gccs that emit .machine ppc. One more confusing thing to have to handle! :-( Given all the above though, I'm surprised the kernel team hasn't hit this already and complained to us about it! :-) Peter