All of lore.kernel.org
 help / color / mirror / Atom feed
* 32bit compat mode for arm64
@ 2020-02-28 21:01 Richard Weinberger
  2020-02-28 22:11 ` Lennart Sorensen
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Richard Weinberger @ 2020-02-28 21:01 UTC (permalink / raw)
  To: xenomai

Hi!

I noticed that running 32bit arm EABI xenomai userspace is currently
not possible
on arm64 kernels.

>From a quick look I see the following tasks to make it happen:
- syscall gate adaptations for cobalt arm32 syscalls (they are
different from regular arm EABI)
- teach ipipe_root_nr_syscalls() on arm64 about __NR_compat_syscalls
- Don't use XENOMAI_ABI_REV for compat userspace on arm64
- Implement a syscall32-table.h (for COBALT_SYSCALL32emu_DECL() and friends)

Is this something which will be supported sooner or later?
...or is there a massive show-stopper I didn't notice so far?

-- 
Thanks,
//richard


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 32bit compat mode for arm64
  2020-02-28 21:01 32bit compat mode for arm64 Richard Weinberger
@ 2020-02-28 22:11 ` Lennart Sorensen
  2020-02-28 22:16   ` Richard Weinberger
  2020-02-29 11:46 ` Richard Weinberger
  2020-03-02 12:16 ` Jan Kiszka
  2 siblings, 1 reply; 12+ messages in thread
From: Lennart Sorensen @ 2020-02-28 22:11 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: xenomai

On Fri, Feb 28, 2020 at 10:01:04PM +0100, Richard Weinberger via Xenomai wrote:
> I noticed that running 32bit arm EABI xenomai userspace is currently
> not possible
> on arm64 kernels.
> 
> From a quick look I see the following tasks to make it happen:
> - syscall gate adaptations for cobalt arm32 syscalls (they are
> different from regular arm EABI)
> - teach ipipe_root_nr_syscalls() on arm64 about __NR_compat_syscalls
> - Don't use XENOMAI_ABI_REV for compat userspace on arm64
> - Implement a syscall32-table.h (for COBALT_SYSCALL32emu_DECL() and friends)
> 
> Is this something which will be supported sooner or later?
> ...or is there a massive show-stopper I didn't notice so far?

Even x86 doesn't allow 32 bit userspace xenomai to run on a 64 bit kernel.
I suspect the use case is just so insignificant that noone wants to
bother working on such support.

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 32bit compat mode for arm64
  2020-02-28 22:11 ` Lennart Sorensen
@ 2020-02-28 22:16   ` Richard Weinberger
  2020-03-02 20:25     ` Lennart Sorensen
  0 siblings, 1 reply; 12+ messages in thread
From: Richard Weinberger @ 2020-02-28 22:16 UTC (permalink / raw)
  To: Lennart Sorensen; +Cc: xenomai

On Fri, Feb 28, 2020 at 11:11 PM Lennart Sorensen
<lsorense@csclub.uwaterloo.ca> wrote:
>
> On Fri, Feb 28, 2020 at 10:01:04PM +0100, Richard Weinberger via Xenomai wrote:
> > I noticed that running 32bit arm EABI xenomai userspace is currently
> > not possible
> > on arm64 kernels.
> >
> > From a quick look I see the following tasks to make it happen:
> > - syscall gate adaptations for cobalt arm32 syscalls (they are
> > different from regular arm EABI)
> > - teach ipipe_root_nr_syscalls() on arm64 about __NR_compat_syscalls
> > - Don't use XENOMAI_ABI_REV for compat userspace on arm64
> > - Implement a syscall32-table.h (for COBALT_SYSCALL32emu_DECL() and friends)
> >
> > Is this something which will be supported sooner or later?
> > ...or is there a massive show-stopper I didn't notice so far?
>
> Even x86 doesn't allow 32 bit userspace xenomai to run on a 64 bit kernel.
> I suspect the use case is just so insignificant that noone wants to
> bother working on such support.

Huh?
I currently do so...
It was broken but got fixed.

-- 
Thanks,
//richard


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 32bit compat mode for arm64
  2020-02-28 21:01 32bit compat mode for arm64 Richard Weinberger
  2020-02-28 22:11 ` Lennart Sorensen
@ 2020-02-29 11:46 ` Richard Weinberger
  2020-03-02 12:21   ` Jan Kiszka
  2020-03-02 12:16 ` Jan Kiszka
  2 siblings, 1 reply; 12+ messages in thread
From: Richard Weinberger @ 2020-02-29 11:46 UTC (permalink / raw)
  To: xenomai

On Fri, Feb 28, 2020 at 10:01 PM Richard Weinberger
<richard.weinberger@gmail.com> wrote:
>
> Hi!
>
> I noticed that running 32bit arm EABI xenomai userspace is currently
> not possible
> on arm64 kernels.
>
> From a quick look I see the following tasks to make it happen:
> - syscall gate adaptations for cobalt arm32 syscalls (they are
> different from regular arm EABI)
> - teach ipipe_root_nr_syscalls() on arm64 about __NR_compat_syscalls
> - Don't use XENOMAI_ABI_REV for compat userspace on arm64
> - Implement a syscall32-table.h (for COBALT_SYSCALL32emu_DECL() and friends)

One more thing: TSC emulation is missing on arm64.

-- 
Thanks,
//richard


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 32bit compat mode for arm64
  2020-02-28 21:01 32bit compat mode for arm64 Richard Weinberger
  2020-02-28 22:11 ` Lennart Sorensen
  2020-02-29 11:46 ` Richard Weinberger
@ 2020-03-02 12:16 ` Jan Kiszka
  2020-03-02 12:52   ` Richard Weinberger
  2 siblings, 1 reply; 12+ messages in thread
From: Jan Kiszka @ 2020-03-02 12:16 UTC (permalink / raw)
  To: Richard Weinberger, xenomai

On 28.02.20 22:01, Richard Weinberger via Xenomai wrote:
> Hi!
> 
> I noticed that running 32bit arm EABI xenomai userspace is currently
> not possible
> on arm64 kernels.
> 
>  From a quick look I see the following tasks to make it happen:
> - syscall gate adaptations for cobalt arm32 syscalls (they are
> different from regular arm EABI)
> - teach ipipe_root_nr_syscalls() on arm64 about __NR_compat_syscalls
> - Don't use XENOMAI_ABI_REV for compat userspace on arm64
> - Implement a syscall32-table.h (for COBALT_SYSCALL32emu_DECL() and friends)
> 
> Is this something which will be supported sooner or later?
> ...or is there a massive show-stopper I didn't notice so far?
> 

Well, if there is a strong use case, usually proprietary legacy software 
that refuses to be ported to 64-bit, I would not refuse such a contribution.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 32bit compat mode for arm64
  2020-02-29 11:46 ` Richard Weinberger
@ 2020-03-02 12:21   ` Jan Kiszka
  2020-03-02 12:34     ` Richard Weinberger
  0 siblings, 1 reply; 12+ messages in thread
From: Jan Kiszka @ 2020-03-02 12:21 UTC (permalink / raw)
  To: Richard Weinberger, xenomai

On 29.02.20 12:46, Richard Weinberger via Xenomai wrote:
> On Fri, Feb 28, 2020 at 10:01 PM Richard Weinberger
> <richard.weinberger@gmail.com> wrote:
>>
>> Hi!
>>
>> I noticed that running 32bit arm EABI xenomai userspace is currently
>> not possible
>> on arm64 kernels.
>>
>>  From a quick look I see the following tasks to make it happen:
>> - syscall gate adaptations for cobalt arm32 syscalls (they are
>> different from regular arm EABI)
>> - teach ipipe_root_nr_syscalls() on arm64 about __NR_compat_syscalls
>> - Don't use XENOMAI_ABI_REV for compat userspace on arm64
>> - Implement a syscall32-table.h (for COBALT_SYSCALL32emu_DECL() and friends)
> 
> One more thing: TSC emulation is missing on arm64.
> 

What exactly are you referring to?

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 32bit compat mode for arm64
  2020-03-02 12:21   ` Jan Kiszka
@ 2020-03-02 12:34     ` Richard Weinberger
  2020-03-02 12:39       ` Jan Kiszka
  0 siblings, 1 reply; 12+ messages in thread
From: Richard Weinberger @ 2020-03-02 12:34 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai

On Mon, Mar 2, 2020 at 1:21 PM Jan Kiszka <jan.kiszka@siemens.com> wrote:
>
> On 29.02.20 12:46, Richard Weinberger via Xenomai wrote:
> > On Fri, Feb 28, 2020 at 10:01 PM Richard Weinberger
> > <richard.weinberger@gmail.com> wrote:
> >>
> >> Hi!
> >>
> >> I noticed that running 32bit arm EABI xenomai userspace is currently
> >> not possible
> >> on arm64 kernels.
> >>
> >>  From a quick look I see the following tasks to make it happen:
> >> - syscall gate adaptations for cobalt arm32 syscalls (they are
> >> different from regular arm EABI)
> >> - teach ipipe_root_nr_syscalls() on arm64 about __NR_compat_syscalls
> >> - Don't use XENOMAI_ABI_REV for compat userspace on arm64
> >> - Implement a syscall32-table.h (for COBALT_SYSCALL32emu_DECL() and friends)
> >
> > One more thing: TSC emulation is missing on arm64.
> >
>
> What exactly are you referring to?

I think CONFIG_IPIPE_ARM_KUSER_TSC.

In lib/cobalt/arch/arm/features.c cobalt_check_features() sets a
function pointer:
        __xn_tscinfo.kuser_tsc_get =
                (__xn_rdtsc_t *)(0xffff1004 -
                                ((*(unsigned *)(0xffff0ffc) + 3) << 5));

On arm64 this pointer is invalid.

Anyway, I did already some prototyping and managed to run 32bit
Xenomai applications on
arm64.
As soon I have something to show I'll send patches. :-)

-- 
Thanks,
//richard


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 32bit compat mode for arm64
  2020-03-02 12:34     ` Richard Weinberger
@ 2020-03-02 12:39       ` Jan Kiszka
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Kiszka @ 2020-03-02 12:39 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: xenomai

On 02.03.20 13:34, Richard Weinberger wrote:
> On Mon, Mar 2, 2020 at 1:21 PM Jan Kiszka <jan.kiszka@siemens.com> wrote:
>>
>> On 29.02.20 12:46, Richard Weinberger via Xenomai wrote:
>>> On Fri, Feb 28, 2020 at 10:01 PM Richard Weinberger
>>> <richard.weinberger@gmail.com> wrote:
>>>>
>>>> Hi!
>>>>
>>>> I noticed that running 32bit arm EABI xenomai userspace is currently
>>>> not possible
>>>> on arm64 kernels.
>>>>
>>>>   From a quick look I see the following tasks to make it happen:
>>>> - syscall gate adaptations for cobalt arm32 syscalls (they are
>>>> different from regular arm EABI)
>>>> - teach ipipe_root_nr_syscalls() on arm64 about __NR_compat_syscalls
>>>> - Don't use XENOMAI_ABI_REV for compat userspace on arm64
>>>> - Implement a syscall32-table.h (for COBALT_SYSCALL32emu_DECL() and friends)
>>>
>>> One more thing: TSC emulation is missing on arm64.
>>>
>>
>> What exactly are you referring to?
> 
> I think CONFIG_IPIPE_ARM_KUSER_TSC.
> 
> In lib/cobalt/arch/arm/features.c cobalt_check_features() sets a
> function pointer:
>          __xn_tscinfo.kuser_tsc_get =
>                  (__xn_rdtsc_t *)(0xffff1004 -
>                                  ((*(unsigned *)(0xffff0ffc) + 3) << 5));
> 
> On arm64 this pointer is invalid.
> 

To my understanding, there is not need for those workarounds on ARM64 
because that arch provides a userspace-accessible TSC architecturally.

> Anyway, I did already some prototyping and managed to run 32bit
> Xenomai applications on
> arm64.
> As soon I have something to show I'll send patches. :-)

Great.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 32bit compat mode for arm64
  2020-03-02 12:16 ` Jan Kiszka
@ 2020-03-02 12:52   ` Richard Weinberger
  0 siblings, 0 replies; 12+ messages in thread
From: Richard Weinberger @ 2020-03-02 12:52 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai

On Mon, Mar 2, 2020 at 1:16 PM Jan Kiszka <jan.kiszka@siemens.com> wrote:

> Well, if there is a strong use case, usually proprietary legacy software
> that refuses to be ported to 64-bit, I would not refuse such a contribution.

This is exactly the case. The said application was designed with 32bits in mind
and it is almost impossible to change that.
At least I can recompile it. ;-)

-- 
Thanks,
//richard


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 32bit compat mode for arm64
  2020-02-28 22:16   ` Richard Weinberger
@ 2020-03-02 20:25     ` Lennart Sorensen
  2020-03-02 20:33       ` Jan Kiszka
  0 siblings, 1 reply; 12+ messages in thread
From: Lennart Sorensen @ 2020-03-02 20:25 UTC (permalink / raw)
  To: Richard Weinberger; +Cc: xenomai

On Fri, Feb 28, 2020 at 11:16:41PM +0100, Richard Weinberger wrote:
> Huh?
> I currently do so...
> It was broken but got fixed.

OK, then apparently section 3.4.1 of
https://xenomai.org/documentation/xenomai-3/html/README.INSTALL/ is wrong.

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 32bit compat mode for arm64
  2020-03-02 20:25     ` Lennart Sorensen
@ 2020-03-02 20:33       ` Jan Kiszka
  2020-03-02 20:42         ` Lennart Sorensen
  0 siblings, 1 reply; 12+ messages in thread
From: Jan Kiszka @ 2020-03-02 20:33 UTC (permalink / raw)
  To: Lennart Sorensen, Richard Weinberger; +Cc: xenomai

On 02.03.20 21:25, Lennart Sorensen via Xenomai wrote:
> On Fri, Feb 28, 2020 at 11:16:41PM +0100, Richard Weinberger wrote:
>> Huh?
>> I currently do so...
>> It was broken but got fixed.
> 
> OK, then apparently section 3.4.1 of
> https://xenomai.org/documentation/xenomai-3/html/README.INSTALL/ is wrong.
> 

Sigh, outdated. Compat support was added a long time ago, prior to 3.0 
in fact.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: 32bit compat mode for arm64
  2020-03-02 20:33       ` Jan Kiszka
@ 2020-03-02 20:42         ` Lennart Sorensen
  0 siblings, 0 replies; 12+ messages in thread
From: Lennart Sorensen @ 2020-03-02 20:42 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Richard Weinberger, xenomai

On Mon, Mar 02, 2020 at 09:33:15PM +0100, Jan Kiszka wrote:
> Sigh, outdated. Compat support was added a long time ago, prior to 3.0 in
> fact.

Well that's a lot less work than implementing it at least.

Nice to know it does in fact work.

-- 
Len Sorensen


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-03-02 20:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28 21:01 32bit compat mode for arm64 Richard Weinberger
2020-02-28 22:11 ` Lennart Sorensen
2020-02-28 22:16   ` Richard Weinberger
2020-03-02 20:25     ` Lennart Sorensen
2020-03-02 20:33       ` Jan Kiszka
2020-03-02 20:42         ` Lennart Sorensen
2020-02-29 11:46 ` Richard Weinberger
2020-03-02 12:21   ` Jan Kiszka
2020-03-02 12:34     ` Richard Weinberger
2020-03-02 12:39       ` Jan Kiszka
2020-03-02 12:16 ` Jan Kiszka
2020-03-02 12:52   ` Richard Weinberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.