[yocto] Is linux-yocto-rt kernel compatible with x32 tune?

Paul D. DeRocco pderocco at ix.netcom.com
Thu Jun 15 15:50:20 PDT 2017

> From: Andre McCurdy [mailto:armccurdy at 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 at 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 at ix.netcom.com

More information about the yocto mailing list