From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D24033858414; Fri, 4 Nov 2022 18:01:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D24033858414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667584869; bh=aCc+6GYSp/BncY2FYK508NsMX+L2+seeJqj5HqEqiOI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DUFtlfs7+7V+HnSxvPGTYVMIjmycPmRf2bYFe4E1ET5gKe1Ps+iGYcJNgyyE3HjZD +D6Ur9zAzTlI/R+siTwwgXR9lNr43hBeVxPDE9KCsKNDhJ2dplJ8gF8CFZjfHWz/qS ux3dlb4G7n3MZsrv7jsDD4hiH6/uBczBMA2kPCKE= 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:01:09 +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 #4 from tomas.vanek at fbl dot cz --- (In reply to Torbj=C3=B6rn SVENSSON from comment #3) >=20 > I have not been able to reproduce this issue after applying below patch > series. Maybe they are still there, maybe they are indirectly fixed. > https://sourceware.org/pipermail/gdb-patches/2022-November/193391.html >=20 > @Tomas, can you take a look at them and see if it resolves the issues you= 've > seen? Tested with the patch series and all 3 problems persist. > Regarding the use of CONTROL.SPSEL instead of the xspr value; you can't u= se > CONTROL as it's not stacked on EXC_RETURN/FNC_RETURN and to my knowledge, > it's not part of the DWARF2 info either. Oh yes, I suspected it. The only viable solution for FNC_RETURN seems me to use CONTROL_S from the actual CPU register. Typically the SPSEL bit is set at the app initialisati= on and then kept unchanged, so it will mostly work - at least unwinding will be less broken than without any use of SPSEL. Similarly we can use CONTROL_NS for return from secure to non-secure. There is tricky to detect the security state change. I made some code to address both interstate directions. I will modify it for the latest arm-tdep.c with your patch series and send to patches ml. --=20 You are receiving this mail because: You are on the CC list for the bug.=