From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by sourceware.org (Postfix) with ESMTPS id A84073858015 for ; Sat, 22 Oct 2022 08:37:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A84073858015 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=foss.st.com Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29M2T7fR031260; Sat, 22 Oct 2022 10:37:12 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=content-type : message-id : date : mime-version : subject : to : references : from : in-reply-to; s=selector1; bh=WrfQhTf+Wm6cX8LLoipijWaKvLKsoxm8URGI+GZJZlw=; b=qZg2T2H0zSXd5xa0IGpBSSHHnyJv4WESHogPFaWvzvX6VqjL7nZH9EDLvai14laWWy1U iepQkTqlxA2sh2/DNo6Z72QI8oUhigeyMmUUCkmwlBOUQSVRyW6fJAk1zyMNXliiiF0r GwaOA+JxoaDfpv5vPbaT8e6glljsVLog0zVW2f20ZllCPzlK39nigYPyV8oTxEMQDLJ+ MhafxzaJUe/E6hupCwdO0mqkZfChnH87thoH4zr5TQT1T9y262lHTVM9QV2cggW8TqdJ yFe3T0QoVKyAY/Gq58c6piaiKZKXANvtbynE9Zwj5ERyYJTkSEWlt46i2QY2Wv+Pc9Va QA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3kc5nb1j5t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 22 Oct 2022 10:37:11 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 6AE5B100038; Sat, 22 Oct 2022 10:37:07 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 5F165215157; Sat, 22 Oct 2022 10:37:07 +0200 (CEST) Received: from [10.252.19.128] (10.252.19.128) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 22 Oct 2022 10:37:06 +0200 Content-Type: multipart/mixed; boundary="------------wZgvJV0hdlIUJjI0e2absUiF" Message-ID: Date: Sat, 22 Oct 2022 10:37:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: Fwd: Undelivered Mail Returned to Sender Content-Language: en-US To: "Frank Ch. Eigler" , Overseers mailing list References: <20221021191325.9FEBD3856DC0@sourceware.org> <20221021194551.GG24703@redhat.com> From: Torbjorn SVENSSON In-Reply-To: <20221021194551.GG24703@redhat.com> X-Originating-IP: [10.252.19.128] X-ClientProxiedBy: EQNCAS1NODE3.st.com (10.75.129.80) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP,UNDELIVERED_MAIL_SUBJECT 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: --------------wZgvJV0hdlIUJjI0e2absUiF Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit Hi again, On 2022-10-21 21:45, Frank Ch. Eigler wrote: > Hi - > >> FYI, it looks like there is an issue with the mail system at sourceware.org >> (maybe this mail wont be delivered either...). > > Thanks, we tweaked two related things, pls let us know if this reoccurs. I just noticed another failure (attached), identical to the one yesterday. Kind regards, Torbjörn > > - FChE > --------------wZgvJV0hdlIUJjI0e2absUiF Content-Type: message/rfc822; name="Undelivered Mail Returned to Sender.eml" Content-Disposition: attachment; filename="Undelivered Mail Returned to Sender.eml" Content-Transfer-Encoding: 8bit Received: from SHFDAG1NODE3.st.com (10.75.129.71) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Mailbox Transport; Sat, 22 Oct 2022 10:32:17 +0200 Received: from SHFCAS1NODE1.st.com (10.75.129.72) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 22 Oct 2022 10:32:17 +0200 Received: from euls16032.sgp.st.com (10.75.44.19) by SHFCAS1NODE1.st.com (10.75.129.79) with Microsoft SMTP Server id 15.1.2375.31 via Frontend Transport; Sat, 22 Oct 2022 10:32:17 +0200 Received: from alpha.dmz-eu.st.com (alpha.dmz-eu.st.com [164.129.1.34]) by euls16032.sgp.st.com (STMicroelectronics) with ESMTP id 098E3100034 for ; Sat, 22 Oct 2022 10:32:17 +0200 (CEST) Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alpha.dmz-eu.st.com (STMicroelectronics) with ESMTPS id EFD1F40032 for ; Sat, 22 Oct 2022 10:32:16 +0200 (CEST) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29M040qc025215 for ; Sat, 22 Oct 2022 10:32:16 +0200 Authentication-Results: stmicroelectronics.com; spf=pass smtp.mailfrom=postmaster@sourceware.org; dmarc=pass header.from=sourceware.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3kc5nb1hr2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 22 Oct 2022 10:32:16 +0200 Received: by sourceware.org (Postfix) id 3ED533858C53; Sat, 22 Oct 2022 08:32:14 +0000 (GMT) Date: Sat, 22 Oct 2022 08:32:14 +0000 From: Mail Delivery System Subject: Undelivered Mail Returned to Sender To: Auto-Submitted: auto-replied Content-Type: multipart/report; report-type=delivery-status; boundary="106E53858C2C.1666427534/sourceware.org" Content-Transfer-Encoding: 8bit Message-ID: <20221022083214.3ED533858C53@sourceware.org> X-CLX-Response: 1TFkXBxsaGhkRCllEF21JHnlIb2NdZH9NEQpYWBdnXnkZf1loUGZlTxEKeE4 Xa29jBVtvcHJrclMRCnlMF2tpGHtmQ19AGx9bEQpDSBcbGhkRCkNZFwcZHx8RCkNJFxoEGhoaEQ pZTRdnZnIRCllJFxEKWV4XaGN5EQpJRhdHQ0lYRU9GT0leWEVEQ0lZdUJFWV5PThEKSUcXeE9NE QpDThdGTERzbUxzQxlhXGF4ZUVZYHkbQEV5G05GG35HQ2geQREKWFwXHwQaBBgdGQUbGgQSGgQd BBsQGx4aHxoRCl5ZF0tDfxJYEQpNXBcaEQpMRhdja3trEQpCTxdrb2MFW29wcmtyUxEKQ1oXEgQ eGQQSHwQTHREKQl4XGxEKQkUXYWR5WEByQGtTH0URCkJOF2tvYwVbb3Bya3JTEQpCTBdnXnkZf1 loUGZlTxEKQmwXYWR5WEByQGtTH0URCkJAF2twYX9JRhleWmJHEQpCWBdtfVlGfRNzGGREZREKe UMXb3llc35ZZ1JdWgURCm1+FxoRClhNF0sRIA== X-Proofpoint-GUID: lfnYGfYi3KvKROosJS1joS1dl1TmiB4k X-Proofpoint-ORIG-GUID: lfnYGfYi3KvKROosJS1joS1dl1TmiB4k X-CLX-Shades: MLX X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 a mx ~all X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=pq_spampolicy_notspam policy=pq_spampolicy score=0 malwarescore=0 suspectscore=0 priorityscore=1501 spamscore=0 clxscore=-1003 adultscore=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=316 impostorscore=0 bulkscore=0 ndrscore=0 adjustscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210220053 Return-Path: <> X-MS-Exchange-Organization-Network-Message-Id: 412d6a0f-4944-4538-5520-08dab407ed9b X-MS-Exchange-Organization-AuthSource: SHFCAS1NODE1.st.com X-MS-Exchange-Organization-AuthAs: Internal X-MS-Exchange-Organization-AuthMechanism: 10 X-MS-Exchange-Transport-EndToEndLatency: 00:00:00.8272290 X-MS-Exchange-Processed-By-BccFoldering: 15.01.2375.031 MIME-Version: 1.0 --106E53858C2C.1666427534/sourceware.org Content-Description: Notification Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit This is the mail system at host sourceware.org. I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below. For further assistance, please send mail to postmaster. If you do so, please include this problem report. You can delete your own text from the attached returned message. The mail system (expanded from ): Command time limit exceeded: "/home/inbox/public-inbox-mda-true.sh" --106E53858C2C.1666427534/sourceware.org Content-Description: Delivery report Content-Type: message/delivery-status Reporting-MTA: dns; sourceware.org X-Postfix-Queue-ID: 106E53858C2C X-Postfix-Sender: rfc822; prvs=6294d2573f=torbjorn.svensson@foss.st.com Arrival-Date: Sat, 22 Oct 2022 08:11:37 +0000 (GMT) Final-Recipient: rfc822; inbox@sourceware.org Original-Recipient: rfc822;gdb-patches@sourceware.org Action: failed Status: 5.3.0 Diagnostic-Code: x-unix; internal software error --106E53858C2C.1666427534/sourceware.org Content-Description: Undelivered Message Content-Type: message/rfc822 Content-Transfer-Encoding: 8bit Return-Path: Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by sourceware.org (Postfix) with ESMTPS id 106E53858C2C for ; Sat, 22 Oct 2022 08:11:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 106E53858C2C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=foss.st.com Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29M24ntu008051; Sat, 22 Oct 2022 10:11:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=/GxGZjZimv7unQKm1WC8RFHPwnW1b9aDE2N6k0RS2bo=; b=h2sphcde6XevPk0JCIXWVYLbDsBQbnRvnqG8+kQp1S2ckQY8Cs/QPPOf+o79tuCSm5fx QpKq1hTOMIuCA1eGkM9neXSaY/X+5+iwi9J+ZFt97IhYr5wab1QxeiTBLqdSdd1clCEF AOEy4oTvjdkqtW9myXF+G7kiKWd234YODW9qjtIpwzaYyI1pt4lNbn2Q3FBOPOLa3RBJ AkZ2yMc79HxcgLXT55XQdoQ1zW1GXapl8vKI/m53wVHx0X83PTzFpquBXkDGb0cuZM6B dbphHbircLZO6KS5tlC7lDcP8rZl4RJrfEcy5CxglkbL7lFW2Owz5mP2a9K+qC6kxnqG 2w== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3kc7djs440-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 22 Oct 2022 10:11:35 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 737EF10002A; Sat, 22 Oct 2022 10:11:30 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 5E018214D1B; Sat, 22 Oct 2022 10:11:30 +0200 (CEST) Received: from [10.252.19.128] (10.252.19.128) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 22 Oct 2022 10:11:29 +0200 Message-ID: <48df83b6-054f-6d0b-c1e3-076eef904eb3@foss.st.com> Date: Sat, 22 Oct 2022 10:11:28 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v2] gdb/arm: Fix M-profile EXC_RETURN exception_domain_is_secure logic Content-Language: en-US To: Tomas Vanek , References: <1666426048-22477-1-git-send-email-vanekt@fbl.cz> From: Torbjorn SVENSSON In-Reply-To: <1666426048-22477-1-git-send-email-vanekt@fbl.cz> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.252.19.128] X-ClientProxiedBy: EQNCAS1NODE3.st.com (10.75.129.80) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-21_04,2022-10-21_01,2022-06-22_01 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org MIME-Version: 1.0 Hi Tomas, On 2022-10-22 10:07, Tomas Vanek wrote: > Arm v8-M Architecture Reference Manual, > D1.2.95 EXC_RETURN, Exception Return Payload > describes ES bit: > > "ES, bit [0] > Exception Secure. The security domain the exception was taken to. > The possible values of this bit are: > 0 Non-secure. > 1 Secure" > > arm-tdep.c:3443, arm_m_exception_cache () function tests this bit: > > exception_domain_is_secure = (bit (lr, 0) == 0); > > The test is negated! Good catch! I'm not sure how I thought when I wrote this, but thanks for correcting it. > > Later on line 3553, the condition evaluates if an additional state > context is stacked: > > /* With the Security extension, the hardware saves R4..R11 too. */ > if (tdep->have_sec_ext && secure_stack_used > && (!default_callee_register_stacking || exception_domain_is_secure)) > > RM, B3.19 Exception entry, context stacking > reads: > RPLHM "In a PE with the Security Extension, on taking an exception, > the PE hardware: > ... > 2. If exception entry requires a transition from Secure state to > Non-secure state, the PE hardware extends the stack frame and also > saves additional state context." > > So we should test for !exception_domain_is_secure instead of non-negated > value! > These two bugs compensate each other so unstacking works correctly. > > But another test of exception_domain_is_secure (negated due to the > first bug) prevents arm_unwind_secure_frames to work as expected: > > /* Unwinding from non-secure to secure can trip security > measures. In order to avoid the debugger being > intrusive, rely on the user to configure the requested > mode. */ > if (secure_stack_used && !exception_domain_is_secure > && !arm_unwind_secure_frames) > > Test with GNU gdb (GDB) 13.0.50.20221016-git. > Stopped in a non-secure handler: > > (gdb) set arm unwind-secure-frames 0 > (gdb) bt > #0 HAL_SYSTICK_Callback () at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/NonSecure/Src/nsmain.c:490 > #1 0x0804081c in SysTick_Handler () > at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/NonSecure/Src/nsstm32l5xx_it.c:134 > #2 > #3 HAL_GPIO_ReadPin (GPIOx=0x52020800, GPIO_Pin=8192) > at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Drivers/STM32L5xx_HAL_Driver/Src/stm32l5xx_hal_gpio.c:386 > #4 0x0c000338 in SECURE_Mode () at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Secure/Src/main.c:86 > #5 0x080403f2 in main () at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/NonSecure/Src/nsmain.c:278 > Backtrace stopped: previous frame inner to this frame (corrupt stack?) > > The frames #3 and #4 are secure. backtrace should stop before #3. > > Stopped in a secure handler: > > (gdb) bt > #0 HAL_SYSTICK_Callback () at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Secure/Src/main.c:425 > #1 0x0c000b6a in SysTick_Handler () > at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Secure/Src/stm32l5xx_it.c:234 > warning: Non-secure to secure stack unwinding disabled. > #2 > > The exception from secure to secure erroneously stops unwinding. It should > continue as far as the security unlimited backtrace: > > (gdb) set arm unwind-secure-frames 1 > (gdb) si <-- used to rebuild frame cache after change of unwind-secure-frames Is there any way to make gdb rebuild the frame cache directly when doing the "set arm unwind-secure-frames"? Feels dirty to do a instruction step just to get the right trace... Regardless of the answer to the above question, it's not something to address in this patch. > 0x0c0008e6 425 if (SecureTimingDelay != 0U) > (gdb) bt > #0 0x0c0008e6 in HAL_SYSTICK_Callback () at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Secure/Src/main.c:425 > #1 0x0c000b6a in SysTick_Handler () > at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Secure/Src/stm32l5xx_it.c:234 > #2 > #3 0x0c000328 in SECURE_Mode () at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Secure/Src/main.c:88 > #4 0x080403f2 in main () at C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/NonSecure/Src/nsmain.c:278 > > Backtrace stopped: previous frame inner to this frame (corrupt stack?) > > Set exception_domain_is_secure to the value expected by its name. > Fix exception_domain_is_secure usage in the additional state context > stacking condition. > > v2: Corrected backtrace logs in commit message > > Signed-off-by: Tomas Vanek > --- > gdb/arm-tdep.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c > index 55295e1..20b6f3f 100644 > --- a/gdb/arm-tdep.c > +++ b/gdb/arm-tdep.c > @@ -3496,7 +3496,7 @@ struct frame_unwind arm_stub_unwind = { > { > secure_stack_used = (bit (lr, 6) != 0); > default_callee_register_stacking = (bit (lr, 5) != 0); > - exception_domain_is_secure = (bit (lr, 0) == 0); > + exception_domain_is_secure = (bit (lr, 0) != 0); > > /* Unwinding from non-secure to secure can trip security > measures. In order to avoid the debugger being > @@ -3606,7 +3606,7 @@ struct frame_unwind arm_stub_unwind = { > > /* With the Security extension, the hardware saves R4..R11 too. */ > if (tdep->have_sec_ext && secure_stack_used > - && (!default_callee_register_stacking || exception_domain_is_secure)) > + && (!default_callee_register_stacking || !exception_domain_is_secure)) > { > /* Read R4..R11 from the integer callee registers. */ > cache->saved_regs[4].set_addr (unwound_sp + 0x08); Kind regards, Torbjörn --106E53858C2C.1666427534/sourceware.org-- --------------wZgvJV0hdlIUJjI0e2absUiF--