All of lore.kernel.org
 help / color / mirror / Atom feed
* Is linux-yocto-rt kernel compatible with x32 tune?
@ 2017-06-15  2:11 Paul D. DeRocco
  2017-06-15  6:13 ` Bruce Ashfield
  0 siblings, 1 reply; 4+ messages in thread
From: Paul D. DeRocco @ 2017-06-15  2:11 UTC (permalink / raw)
  To: yocto

I've been fighting with this off and on for a week. If I build
core-image-minimal for a generic86-64 machine, I can get it to use the x32
ABI, or I can switch to the linux-yocto-rt 4.8 kernel, but I can't do
both.

If I do both, it builds with no complaint other than a lot of bit size
errors in grub-efi do_package_qa (which don't seem to matter with the
standard kernel). Most binaries, including loadable kernel modules, are
properly built as ELF architecture i386:x64-32, but the kernel itself is
built as i386:x86-64. The result is an immediate kernel panic trying to
run init, because the kernel doesn't know how to load it.

I understand that not all packages have been updated to work with x32, but
the RT kernel? Is this a combination that is known not to work? If it is
expected to work, am I the first person to try to boot it on actual
hardware? I'd like to know either that this simply won't work, so I can
stop wasting time on it, or get some help diagnosing the problem and
fixing it. I'm stumped.

-- 

Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.com



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

* Re: Is linux-yocto-rt kernel compatible with x32 tune?
  2017-06-15  2:11 Is linux-yocto-rt kernel compatible with x32 tune? Paul D. DeRocco
@ 2017-06-15  6:13 ` Bruce Ashfield
  2017-06-15 18:19   ` Andre McCurdy
  0 siblings, 1 reply; 4+ messages in thread
From: Bruce Ashfield @ 2017-06-15  6:13 UTC (permalink / raw)
  To: Paul D. DeRocco; +Cc: Yocto Project Discussion

[-- Attachment #1: Type: text/plain, Size: 1858 bytes --]

On Thu, Jun 15, 2017 at 4:11 AM, Paul D. DeRocco <pderocco@ix.netcom.com>
wrote:

> I've been fighting with this off and on for a week. If I build
> core-image-minimal for a generic86-64 machine, I can get it to use the x32
> ABI, or I can switch to the linux-yocto-rt 4.8 kernel, but I can't do
> both.
>
> If I do both, it builds with no complaint other than a lot of bit size
> errors in grub-efi do_package_qa (which don't seem to matter with the
> standard kernel). Most binaries, including loadable kernel modules, are
> properly built as ELF architecture i386:x64-32, but the kernel itself is
> built as i386:x86-64. The result is an immediate kernel panic trying to
> run init, because the kernel doesn't know how to load it.
>
> I understand that not all packages have been updated to work with x32, but
> the RT kernel? Is this a combination that is known not to work? If it is
> expected to work, am I the first person to try to boot it on actual
> hardware? I'd like to know either that this simply won't work, so I can
> stop wasting time on it, or get some help diagnosing the problem and
> fixing it. I'm stumped.
>

I can't think of a reason off the top of my head that would prevent this
from working at the kernel level.

But can you confirm that a non-rt build for the same board works with
x32 ? It could just be a kernel configuration issue if it does work with
non-rt, since the -rt variant may not have a BSP entry point defined.

Bruce


>
> --
>
> Ciao,               Paul D. DeRocco
> Paul                mailto:pderocco@ix.netcom.com
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"

[-- Attachment #2: Type: text/html, Size: 2832 bytes --]

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

* Re: Is linux-yocto-rt kernel compatible with x32 tune?
  2017-06-15  6:13 ` Bruce Ashfield
@ 2017-06-15 18:19   ` Andre McCurdy
  2017-06-15 22:50     ` Paul D. DeRocco
  0 siblings, 1 reply; 4+ messages in thread
From: Andre McCurdy @ 2017-06-15 18:19 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: Yocto Project Discussion

On Wed, Jun 14, 2017 at 11:13 PM, Bruce Ashfield
<bruce.ashfield@gmail.com> wrote:
> On Thu, Jun 15, 2017 at 4:11 AM, Paul D. DeRocco <pderocco@ix.netcom.com>
> wrote:
>>
>> I've been fighting with this off and on for a week. If I build
>> core-image-minimal for a generic86-64 machine, I can get it to use the x32
>> ABI, or I can switch to the linux-yocto-rt 4.8 kernel, but I can't do
>> both.
>>
>> If I do both, it builds with no complaint other than a lot of bit size
>> errors in grub-efi do_package_qa (which don't seem to matter with the
>> standard kernel). Most binaries, including loadable kernel modules, are
>> properly built as ELF architecture i386:x64-32, but the kernel itself is
>> built as i386:x86-64. The result is an immediate kernel panic trying to
>> run init, because the kernel doesn't know how to load it.

Isn't the point of x32 that the kernel should be full 64bit (and so
able to directly address all memory) and only user space should be
restricted to 32bit pointers?

If so, then the kernel ELF architecture x86-64 seems correct. If that
kernel can't run x32 user space binaries then maybe the kernel config
option to enable support for x32 user space is somehow missing?

>>
>> I understand that not all packages have been updated to work with x32, but
>> the RT kernel? Is this a combination that is known not to work? If it is
>> expected to work, am I the first person to try to boot it on actual
>> hardware? I'd like to know either that this simply won't work, so I can
>> stop wasting time on it, or get some help diagnosing the problem and
>> fixing it. I'm stumped.
>
>
> I can't think of a reason off the top of my head that would prevent this
> from working at the kernel level.
>
> But can you confirm that a non-rt build for the same board works with
> x32 ? It could just be a kernel configuration issue if it does work with
> non-rt, since the -rt variant may not have a BSP entry point defined.
>
> Bruce
>
>>
>>
>> --
>>
>> Ciao,               Paul D. DeRocco
>> Paul                mailto:pderocco@ix.netcom.com
>>
>> --
>> _______________________________________________
>> yocto mailing list
>> yocto@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
>
>
>
>
> --
> "Thou shalt not follow the NULL pointer, for chaos and madness await thee at
> its end"
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>


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

* Re: Is linux-yocto-rt kernel compatible with x32 tune?
  2017-06-15 18:19   ` Andre McCurdy
@ 2017-06-15 22:50     ` Paul D. DeRocco
  0 siblings, 0 replies; 4+ messages in thread
From: Paul D. DeRocco @ 2017-06-15 22:50 UTC (permalink / raw)
  To: 'Andre McCurdy', 'Bruce Ashfield', yocto

> From: Andre McCurdy [mailto:armccurdy@gmail.com] 
> 
> Isn't the point of x32 that the kernel should be full 64bit (and so
> able to directly address all memory) and only user space should be
> restricted to 32bit pointers?
> 
> If so, then the kernel ELF architecture x86-64 seems correct. If that
> kernel can't run x32 user space binaries then maybe the kernel config
> option to enable support for x32 user space is somehow missing?

You're probably right, although I never saw any docs that spelled that out. That would explain why there are libx32 directories. I was hoping that x32 just meant that everything was compiled with a single architecture, just like a 32-bit processor, just using 64-bit mode for the larger register set, and 32-bit pointers everywhere. No need for any multi-arch logic. That would seem to be desirable for a modest sized embedded system. But if it still produces a 64-bit kernel, I can live with that, as long as I can get it to work.

> From: Bruce Ashfield [mailto:bruce.ashfield@gmail.com] 
> 
> I can't think of a reason off the top of my head that would 
> prevent this from working at the kernel level.
> 
> But can you confirm that a non-rt build for the same board works with
> x32 ? It could just be a kernel configuration issue if it 
> does work with
> non-rt, since the -rt variant may not have a BSP entry point defined.

I did more thorough testing, doing six core-image-minimal builds: 32, 32rt, 64, 64rt, 64x32, and 64x32rt. All the non-rt ones and the 64rt one work. The 32rt and 64x32rt both panic loading init.

I'm not sure if I'm specifying the rt kernel properly. My 32-bit local.conf includes

  MACHINE = "genericx86"
  PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto-rt"
  PREFERRED_VERSION_linux-yocto-rt ?= "4.8%"

and my 64-bit x32 local.conf includes

  MACHINE = "genericx86-64"
  DEFAULTTUNE = "core2-64-x32"
  baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE', True) \
         or 'INVALID'), True) or 'lib'}"
  PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto-rt"
  PREFERRED_VERSION_linux-yocto-rt ?= "4.8%"

I have a tiny layer that just includes a linux-yocto-rt_4.8.bbappend:

  COMPATIBLE_MACHINE = "genericx86|genericx86-64"
  KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", \
          "mx32", " cfg/x32.scc", "" ,d)}"

and a non-rt one just specifying COMPATIBLE_MACHINE. I copied that last line from the linux-yocto_4.8.bb file, because it's not in the rt recipe. The .scc file pulls in a .cfg file which turns on CONFIG_X86_X32 and CONFIG_COMPAT. 

Yet the problem isn't with x32, it's that it can't run 32-bit binaries, even in a plain 32-bit kernel. So what am I leaving out, in my effort to specify the rt kernel?

-- 

Ciao,               Paul D. DeRocco
Paul                mailto:pderocco@ix.netcom.com



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

end of thread, other threads:[~2017-06-15 22:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-15  2:11 Is linux-yocto-rt kernel compatible with x32 tune? Paul D. DeRocco
2017-06-15  6:13 ` Bruce Ashfield
2017-06-15 18:19   ` Andre McCurdy
2017-06-15 22:50     ` Paul D. DeRocco

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.