From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id D0C963882100 for ; Fri, 14 Jun 2024 03:26:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D0C963882100 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D0C963882100 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718335570; cv=none; b=V3zHA+/ZLJYKcb2MWHzh1OAa2GS42xS/dpFe0Z+3vb9Fz9NTCWq5PN3dAnUTVWVG0cJpTObw879Sj7tdbsrOfac5yEb39/eetD3Uq14dl6XDA7QqdQSaTvOZGEV37i02McLtJWNLd5mU9ZWi1i04Ton183qjIZ/Lnlm6xIXd2H4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718335570; c=relaxed/simple; bh=FUCwZvipAcbwkWtfj0KvEwrBAErB741VkIdxA1ZoHqg=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=bKuRhaNL6/Pm4D7nmYUIV0g3ALGZasyYJPtvONLuiem0NcWpwGjNp2eMgRVkKJeXioqTlV7dbtnOvk+IyG3kUBP9+hoPDGGDXq2T9t55/KIk8t2XFa4ZJWIHx1TP/m/NYIfJjGLb35sYZtecX/HSW8lxf1XF/g0rceCPWs6nWgc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45E2ocJe023173; Fri, 14 Jun 2024 03:26:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s=pp1; bh=B ixh7ti+ZrYvP57UnFdvl7In5gAnkGb6xuWWVzGZQFo=; b=EEZ9Z1fv1Dpk5Xeq6 Tcnh/Gpgqa9FXAE/o5cYrwW3yC8GNzkyHa/imzrxiur6a1IOaTFcT+O1/4XQeYvA m8YpbZ+0gQGgf/tl0TYETWzmhyqYVxyZi0dxxe7iCpz8VSSp2dy8O+SclNPkOKMu bBl/bFGgqf1HxRc/rT7Db1Ys3GzH8309f13lWYJxueUAWSe0FzpD6UrESMezcLMd T+WJpqy32xWCHXmkWfCkU1/lxV6qHUikjZ2tyq0O0HZaNv52Q4621KHe5tD1qlSd 0HdpVUXPHH10H7Q7zcQMQHZLIIRxLpSSp4Hiyt4DCsxmliJ3GP1OvXK9JRYUML80 hftJQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yra1f8gng-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Jun 2024 03:26:06 +0000 (GMT) Received: from m0353728.ppops.net (m0353728.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 45E3Q6P8012963; Fri, 14 Jun 2024 03:26:06 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yra1f8gnc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Jun 2024 03:26:06 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 45E1QIXa027243; Fri, 14 Jun 2024 03:26:04 GMT Received: from smtprelay04.wdc07v.mail.ibm.com ([172.16.1.71]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3yn211dvye-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Jun 2024 03:26:04 +0000 Received: from smtpav04.dal12v.mail.ibm.com (smtpav04.dal12v.mail.ibm.com [10.241.53.103]) by smtprelay04.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 45E3Q1nt41484632 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jun 2024 03:26:03 GMT Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5035F58064; Fri, 14 Jun 2024 03:26:01 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DD05F58056; Fri, 14 Jun 2024 03:26:00 +0000 (GMT) Received: from [9.61.28.160] (unknown [9.61.28.160]) by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTP; Fri, 14 Jun 2024 03:26:00 +0000 (GMT) Message-ID: <544eb6de-906d-4c25-8dbb-422c5bf6fef2@linux.ibm.com> Date: Thu, 13 Jun 2024 22:26:00 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] rs6000: Compute rop_hash_save_offset for non-Altivec compiles [PR115389] To: "Kewen.Lin" Cc: GCC Patches , Segher Boessenkool , David Edelsohn References: <4a8bf020-b15f-3929-6a13-6c0981784895@linux.ibm.com> Content-Language: en-US From: Peter Bergner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: MGF1HdfAT1xNq92fZzO9xlT8SNQQvKZA X-Proofpoint-ORIG-GUID: cdJvNH7IxiZT5R0jvebMgeLnuW2Hzc3P X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-13_15,2024-06-13_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 priorityscore=1501 phishscore=0 clxscore=1015 impostorscore=0 adultscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406140020 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,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 server2.sourceware.org List-Id: On 6/13/24 9:26 PM, Kewen.Lin wrote: > on 2024/6/13 21:24, Peter Bergner wrote: >> On 6/13/24 12:35 AM, Kewen.Lin wrote: >>>> @@ -826,7 +826,14 @@ rs6000_stack_info (void) >>>> info->ehrd_offset -= info->rop_hash_size; >>>> } >>>> else >>>> - info->ehrd_offset = info->gp_save_offset - ehrd_size; >>>> + { >>>> + info->ehrd_offset = info->gp_save_offset - ehrd_size; >>>> + >>>> + /* Adjust for ROP protection. */ >>>> + info->rop_hash_save_offset >>>> + = info->gp_save_offset - info->rop_hash_size; >>>> + info->ehrd_offset -= info->rop_hash_size; >>>> + } >>> >>> I understand this is just copied from the if arm, but if I read this right, it can be >>> simplified as: >> >> Ok, I'll retest with that simplification. So I retested a normal powerpc64le-linux build (ie, we default to Power8 with Altivec) and it bootstrapped and regtested with no regressions. I then attempted a --with-cpu=power5 build to test the non-altivec path, but both the unpatched and patched builds died building libgfortran with the following error: "error: ‘_Float128’ is not supported on this target". I believe that is related to PR113652. I'll kick off the build again, this time disabling Fortran and seeing if the build completes. >>>> +/* { dg-do assemble } */ >>>> +/* { dg-options "-O2 -mdejagnu-cpu=power10 -mrop-protect -mno-vsx -mno-altivec -mabi=no-altivec -save-temps" } */ >>> >>> I'd expect -mabi=no-altivec is default for -mno-altivec, but specifying it explicitly >>> looks fine to me. :) >> >> That's what I expected too! :-) However, I was surprised to learn that -mno-altivec >> does *not* disable TARGET_ALTIVEC_ABI. I had to explicitly use the -mabi= option to >> expose the bug. > > oh, it's surprising, I learn something today! :) I guess it's not intentional but just no > one noticed it, as it seems nonsense to have altivec ABI extension but not using any altivec > features. Agreed! Peter