This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Arm semihosting v2 implementation isn't complete
- From: Alexander Fedotov <alfedotov at gmail dot com>
- To: Tamar Christina <Tamar dot Christina at arm dot com>
- Cc: Newlib <newlib at sourceware dot org>, nd <nd at arm dot com>
- Date: Wed, 9 Jan 2019 12:45:58 +0300
- Subject: Re: Arm semihosting v2 implementation isn't complete
- References: <CAN8C2CpEFMVy-F0SMRxg96JxrjecWLnSLOegSj2NgQnHK3ksUg@mail.gmail.com> <DB6PR0802MB23096B2247E3259F0314ABFBFFBD0@DB6PR0802MB2309.eurprd08.prod.outlook.com> <CAN8C2CpMFhpUv7=oJdyWQPYp-ikTM-=9ERoFYjnyg7k4hTYFXw@mail.gmail.com> <CAN8C2Co=xOnHH_9FvnvNZVkUjLor4BKJu93QT2M2nNnjpq8N7g@mail.gmail.com> <20181218165405.GA19574@arm.com> <CAN8C2CrCQHzK9E8RGvRx2Mq0EOX4NmD8x_3RuXch0XbWnKboog@mail.gmail.com> <20181219121524.GA28525@arm.com> <CAN8C2CpxAe7j4mJApkw-5yEgFVk3ff=H3qiRwvZeyC=zqThrBw@mail.gmail.com>
For future archaeologists: related issue in bug tracker is there
https://sourceware.org/bugzilla/show_bug.cgi?id=24070
Alex
On Wed, Dec 19, 2018 at 3:21 PM Alexander Fedotov <alfedotov@gmail.com> wrote:
>
> Ok, I see now.
> Thank you so much Tamar !
>
> Alex
>
> On Wed, Dec 19, 2018 at 3:15 PM Tamar Christina <Tamar.Christina@arm.com> wrote:
> >
> > Hi Alex,
> >
> > The 12/18/2018 21:08, Alexander Fedotov wrote:
> > > Disassembling rdimon-v2m libraries for armv8 I see following:
> > > svc 0x0000f000
> > >
> > > while that document states immediate 0xf000 must be used with HLT only.
> > >
> >
> > Yes, that's what your patch fixes, the change I mentioned was because it only needs to
> > use hlt 0xf000 for the -v2m and not the non -v2m versions which are also version 2.
> >
> > newlib no longer builds v1 by default so your original patch with just #defined (SEMIHOST_V2)
> > is always true and semihosting v2 requires support for hlt on earlier architectures than Armv8 as well.
> >
> > However I'd like to put this on hold till January as there is something I need to check with
> > a colleague whom has already gone on leave for the holidays.
> >
> > Kind Regards,
> > Tamar
> >
> > > If this v2m implementation assumes to use SVC and BKPT instructions with new immed values - should I create "pure" rdimon-v2 version then with HLT only ?
> > >
> > > Alex
> > >
> > >
> > > On Tue, 18 Dec 2018 at 19:54, Tamar Christina <Tamar.Christina@arm.com<mailto:Tamar.Christina@arm.com>> wrote:
> > > Hi Alexander,
> > >
> > > #ifdef THUMB_VXM
> > > #define AngelSWIInsn "bkpt"
> > > #define AngelSWIAsm bkpt
> > > +#elif defined (SEMIHOST_V2) && (__ARM_ARCH == 8)
> > >
> > > You'll want to use the same condition as the reason number setting code above,
> > >
> > > #if defined (SEMIHOST_V2) && defined (SEMIHOST_V2_MIXED_MODE)
> > >
> > > As we only want to use hlt in the mixed mode and not always.
> > > The Armv8 check isn't needed due to the note in the specification
> > > "Note: This requirement includes supporting the HLT encodings on ARMv7 and earlier processors, even though HLT
> > > is only defined as an instruction in ARMv8."
> > >
> > > So we just generate all the multilibs and leave it up to the implementations to support it or not.
> > >
> > > Thanks,
> > > Tamar
> > >
> > > + #define AngelSWIInsn "hlt"
> > > + #define AngelSWIAsm hlt
> > > #else
> > > #define AngelSWIInsn "swi"
> > > #define AngelSWIAsm swi
> > > --
> > >
> > >
> > > The 12/18/2018 15:09, Alexander Fedotov wrote:
> > > > I suggest following patch:
> > > >
> > > > On Tue, Dec 18, 2018 at 5:12 PM Alexander Fedotov <alfedotov@gmail.com<mailto:alfedotov@gmail.com>> wrote:
> > > > >
> > > > > Hi Tamar
> > > > >
> > > > > I see HLT only in comments, not in defines:
> > > > >
> > > > > #ifdef THUMB_VXM
> > > > > #define AngelSWIInsn "bkpt"
> > > > > #define AngelSWIAsm bkpt
> > > > > #else
> > > > > #define AngelSWIInsn "swi"
> > > > > #define AngelSWIAsm swi
> > > > > #endif
> > > > >
> > > > >
> > > > > On Tue, Dec 18, 2018 at 4:50 PM Tamar Christina <Tamar.Christina@arm.com<mailto:Tamar.Christina@arm.com>> wrote:
> > > > > >
> > > > > > Hi Alex
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: newlib-owner@sourceware.org<mailto:newlib-owner@sourceware.org> <newlib-owner@sourceware.org<mailto:newlib-owner@sourceware.org>> On
> > > > > > > Behalf Of Alexander Fedotov
> > > > > > > Sent: Tuesday, December 18, 2018 13:08
> > > > > > > To: Newlib <newlib@sourceware.org<mailto:newlib@sourceware.org>>
> > > > > > > Subject: Arm semihosting v2 implementation isn't complete
> > > > > > >
> > > > > > > Hi all
> > > > > > >
> > > > > > > I see that number of commits were dedicated to changes for Arm
> > > > > > > Semihosting v2 specification that states:
> > > > > > > ARM encourages semihosting callers to implement support for trapping using
> > > > > > > HLT on A32 and T32 as a configurable option. ARM strongly discourages
> > > > > > > semihosting callers from mixing the HLT and SVC mechanisms within the
> > > > > > > same executable.
> > > > > > >
> > > > > > > At the moment there is no HLT instruction used in libgloss/arm.
> > > > > >
> > > > > > There is, see swi.h, we don't support mixing of HLT and SVC (as mentioned in the specification bit you quoted) so they are in different libraries.
> > > > > > HLT is used when you used the MIXED_MODE spec files. E.g. aprofile-validation-v2m.specs will use HLT and aprofile-validation.specs uses SVC.
> > > > > >
> > > > > > Regards,
> > > > > > Tamar
> > > > > >
> > > > > > >
> > > > > > > So the question is: is there any reason to not have HLT right now ?
> > > > > > >
> > > > > > > Alex
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Best regards,
> > > > > AF
> > > >
> > > >
> > > >
> > > > --
> > > > Best regards,
> > > > AF
> > >
> > >
> > >
> > > --
> > > --
> > > Best regards,
> > > AF
> >
> > --
>
>
>
> --
> Best regards,
> AF
--
Best regards,
AF