This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ARM/FDPIC v6 13/24] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture
- From: Matthew Malcomson <Matthew dot Malcomson at arm dot com>
- To: Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>, Christophe Lyon <christophe dot lyon at linaro dot org>, Christophe Lyon <christophe dot lyon at st dot com>
- Cc: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Fri, 20 Sep 2019 12:51:35 +0000
- Subject: Re: [ARM/FDPIC v6 13/24] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mpgKIwmY5ErD/4sR+de1XlCXExMzphHAMZB3pISX6wc=; b=jMtxF0WDMynX1ZgdtK8K5kky/0TMnbhFVjp9E5vHhJEnpJUIWmZsXmgfFPOO90HQYPKEwrBk9Zk0U0hAStYptX/cx3FEtoDLKxg0Wpl8YnPlEgq4H/JtNVZGSCMNNXAPfDZ/ikPsQDKqXhUIT1WpKB9k0+tOeTlA5G4iVNyYtwmSPxftkvk+YYGx5ReJB40jGj9x+X5jQQUz1tCyuWjCH/ff5todW1gy9FdUAo57n/ZEPBOkN6n4OTaSGa4FY7VcbGsCOhO9D4FDpFu8cXmf2Zyg4k2LSXxt/pH908UdC9qfhfJXgR89C0KYnRkLrhL9w+uR9MqP3ipqquq0Vo/6vQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mN2JeY2rVRYdVnbPpCtPFjoGcjsCQrOrCaiyV7hVxsKfPgtUVCStcs5TG5T3Ve8WAKBJmnTmuhLlgRyhHoYA3EH5TCmatW1tlkrfMBzARJQ3x3Nooz7dTcrCTO4Wc/2RkO5tueYbjvy8j+6Ly7Q1cCrnEIdljlhmQlp/Kevb3fX2LDoSkIC6iWdX9T/7GBuNmKU7niCxvPNSdUePvjeWEr3EhGGb86lSMfh3Zzmh7gcbZyb79ZFKVMbgQoNrg1nCMtADFaHICbr4wEAvSKsIt97kvZaYFCdeNSdGtAA358DKv3U0+8xX2AVGByV0+BM9o3VsZoKya9l5o/DEmBPtTQ==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Matthew dot Malcomson at arm dot com;
- References: <20190909154526.11630-1-christophe.lyon@st.com> <20190909154526.11630-14-christophe.lyon@st.com> <7dd95d39-c60e-4f3c-fa16-2886daf44449@arm.com> <HE1PR0801MB2121F234EC237318E1B39A58838F0@HE1PR0801MB2121.eurprd08.prod.outlook.com> <f8234628-2820-821e-712b-d65738be0f02@st.com> <CAKdteOaakTVx1J-Z83ORetwO0BTXqKDZ72c-QNHVmkHYfXw+wg@mail.gmail.com> <c46c4789-9942-69f6-d491-eb09f08efdea@foss.arm.com>
On 19/09/19 16:14, Kyrill Tkachov wrote:
>
> On 9/19/19 4:13 PM, Christophe Lyon wrote:
>> On Tue, 17 Sep 2019 at 14:08, Christophe Lyon <christophe.lyon@st.com>
>> wrote:
>> >
>> > On 17/09/2019 13:38, Wilco Dijkstra wrote:
>> > > Hi Christophe,
>> > >
>> > > Can you explain this in more detail - it doesn't make sense to me
>> to force the
>> > > Thumb bit during unwinding since it should already be correct,
>> even on a
>> > > Thumb-only CPU. Perhaps the kernel code that pushes an incorrect
>> address on
>> > > the stack could be fixed instead?
>> > >
>> > >> Without this, when we are unwinding across a signal frame we can
>> jump
>> > >> to an even address which leads to an exception.
>> > >>
>> > >> This is needed in __gnu_persnality_sigframe_fdpic() when
>> restoring the
>> > >> PC from the signal frame since the PC saved by the kernel has the
>> LSB
>> > >> bit set to zero.
>> > >
>> > > Wilco
>> > > .
>> > >
>> >
>> > Indeed, I've noticed the problem mentioned by Matthew since I
>> committed that patch.
>> >
>> > I was about to propose a fix, replacing #if (__thumb__) with #if
>> (!__ARM_ARCH_ISA_ARM), but you are right: maybe the kernel code should
>> be fixed instead.
>> >
>> > So far I haven't managed to reproduce a failure in FDPIC mode
>> without this patch though...
>> >
>> > Thanks and sorry for the breakage.
>> >
>>
>> I'm having problems with the board I use for testing, so I propose to
>> revert that patch until I have a better description of the problem it
>> fixed.
>> OK?
>
> Ok by me as long as lives the fdpic toolchain in a usable state (barring
> the potential issue here)
Thanks Christophe -- reverting that patch would help our internal
testing a lot!
MM
>
> Thanks,
>
> Kyrill
>
>
>>
>> Christophe
>>
>> > Christophe
>> >