From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AA7183858423; Fri, 4 Nov 2022 18:24:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA7183858423 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667586255; bh=gxwCFDrYu3CCAU0VaEt0DVsKPzO6HD9dgcXVq2I+8Ig=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gN6AH5J3mQgvDdUckUubJOaKlk5BnwdT9+/NM4bLXujDxRmDtwcnNGkgTgViWmc3R qyY1T+5DuWKjyzaPYAiC1nATPKZ7jtdwaI0Q6MNYNHdF6FAvLWaP4erM4hAF2zgms6 xkJV3GuJ4nkwRHhFZZklBTZz+eZ3Gzn3bOBoZ1EU= From: "tomas.vanek at fbl dot cz" To: gdb-prs@sourceware.org Subject: [Bug tdep/29716] Arm v8 M-profile FNC_RETURN unwinder uses wrong stack Date: Fri, 04 Nov 2022 18:24:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tdep X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: tomas.vanek at fbl dot cz X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29716 --- Comment #5 from tomas.vanek at fbl dot cz --- My modifications to ST GTZC_TZSC_MPCBB_TrustZone example to exercise FNC_RE= TURN and return from secure to non-secure (LED3 indicates secure mode): Secure/main.c: void SECURE_Mode(funcptr back_ns); void NSCalledFromSec(void); void NSCalledFromNS(void); void SecCalledFromNS(void); static void SecCalledFromSec(funcptr back_ns) { if (back_ns) { back_ns(); } } CMSE_NS_ENTRY void SECURE_Mode(funcptr back_ns) { HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, 1); SecCalledFromSec(back_ns); } CMSE_NS_ENTRY void SecCalledFromNS(void) { HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, 1); } NonSecure/main.c: void NSCalledFromNS(void) { SecCalledFromNS(); HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, 0); } void NSCalledFromSec(void) { HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, 0); NSCalledFromNS(); } int main(void) { ... add to while loop: SECURE_Mode(&NSCalledFromSec); HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, 0); --=20 You are receiving this mail because: You are on the CC list for the bug.=