Skip to contentSkip to conversation

poky-tiny: prefer thumb mode by default

PATCH In review Sinan Kaya 3 participants 7 messages Nov 17, 2020 – Nov 18, 2020

lore
Share & tools
lore

Sinan Kaya

author
#0 lore raw

PATCH 1/1 poky-tiny: prefer thumb mode by default

We can use ARM_INSTRUCTION_SET to select the default instruction mode for userspace.

---
 meta-poky/conf/distro/poky-tiny.conf | 3 +++
 1 file changed, 3 insertions(+)
meta-poky/conf/distro/poky-tiny.conf +3 -0
index c6d4b88f83d..87ee0970b93 100644
@@ -122,3 +122,6 @@ PNBLACKLIST[core-image-weston] = "not buildable with poky-tiny"
 
 # Disable python usage in opkg-utils since it won't build with tiny config
 PACKAGECONFIG_remove_pn-opkg-utils = "python"
+
+# prefer thumb mode by default for userspace
+ARM_INSTRUCTION_SET = "thumb"
Signature · 1 line
2.17.1
#1 lore raw
Quoted 14 lines · Sinan Kaya

We can use ARM_INSTRUCTION_SET to select the default instruction mode for userspace.

---
 meta-poky/conf/distro/poky-tiny.conf | 3 +++
 1 file changed, 3 insertions(+)
meta-poky/conf/distro/poky-tiny.conf +0 -0
index c6d4b88f83d..87ee0970b93 100644

meta-poky/conf/distro/poky-tiny.conf PNBLACKLIST[core-image-weston] = "not buildable with poky-tiny" · line 127

Quoted 6 lines
meta-poky/conf/distro/poky-tiny.conf +3 -0
@@ -122,3 +122,6 @@ PNBLACKLIST[core-image-weston] = "not buildable with poky-tiny"
 
 # Disable python usage in opkg-utils since it won't build with tiny config
 PACKAGECONFIG_remove_pn-opkg-utils = "python"
+
+# prefer thumb mode by default for userspace
+ARM_INSTRUCTION_SET = "thumb"

we have defaulted armv7a+ machines to use thumb ISA if DEFAULTTUNE has 't' attribute in it
which SOCs do you target with this change ?

Quoted 6 lines

--
2.17.1

author
#2 lore raw
Quoted 6 lines · Khem Raj

meta-poky/conf/distro/poky-tiny.conf PNBLACKLIST[core-image-weston] = "not buildable with poky-tiny" · line 127

Quoted 2 lines
meta-poky/conf/distro/poky-tiny.conf +2 -0
+# prefer thumb mode by default for userspace
+ARM_INSTRUCTION_SET = "thumb"

we have defaulted armv7a+ machines to use thumb ISA if DEFAULTTUNE has 't' attribute in it
which SOCs do you target with this change ?

I wanted to use it on ARM926EJS. I noticed that it is defaulting to arm even though the CPU supports thumb.

Why was the same decision not made for armv5 and armv6?

#3 lore raw
Quoted 8 lines · Sinan Kaya
Quoted 6 lines · Khem Raj

meta-poky/conf/distro/poky-tiny.conf PNBLACKLIST[core-image-weston] = "not buildable with poky-tiny" · line 127

Quoted 2 lines
meta-poky/conf/distro/poky-tiny.conf +2 -0
+# prefer thumb mode by default for userspace
+ARM_INSTRUCTION_SET = "thumb"

we have defaulted armv7a+ machines to use thumb ISA if DEFAULTTUNE has 't' attribute in it
which SOCs do you target with this change ?

Quoted 4 lines

I wanted to use it on ARM926EJS. I noticed that it is defaulting to arm even though the CPU supports thumb.

Why was the same decision not made for armv5 and armv6?

Right lot of older arm implementation may or may not have thumb ISA so there was no reliable way of choosing it and secondly it’s a bit less tested ISA especially when it came to thumb1 for long Martin ran qemuarm/v5 build using thumb ISA and he would find weird corner cases and build failures

I think this makes sense for poky-tiny but we do not test it as much and it might give a bad experience unless we test this combo regularly

Quoted 5 lines
author
#4 lore raw
Quoted 11 lines · Khem Raj

Why was the same decision not made for armv5 and armv6?

Right lot of older arm implementation may or may not have thumb ISA so there was no reliable way of choosing it and secondly it’s a bit less tested ISA especially when it came to thumb1 for long Martin ran qemuarm/v5 build using thumb ISA and he would find weird corner cases and build failures

I think this makes sense for poky-tiny but we do not test it as much and it might give a bad experience unless we test this combo regularly

I think I need to bring the support detection logic here to find out if platform in use supports thumb mode.

I'll do some more builds to ensure everything builds correctly with thumb mode. I think I found one more recipe that doesn't play nice.

Setting it default for tiny profile makes sense so that it also gets regularly exercised.

#5 lore raw

The detection should work fine as long as you select the right DEFAULTTUNE

thumb is used only when ARM_INSTRUCTION_SET is set to thumb AND thumb appears in TUNE_FEATURES (which are defined by selected DEFAULTTUNE).

I've stopped building for armv4t (om-gta0* MACHINEs dropped in
https://github.com/shr-distribution/meta-smartphone/commit/647d43223ed6ace5d68b1e36d34978da472634e7)
and armv5te (tune-xscare.inc used by e.g. spitz MACHINE from meta-handheld) more than 3 years ago, I don't know how much the support for thumb1 degraded since then.

Quoted 25 lines · Sinan Kaya
Quoted 11 lines · Khem Raj

Why was the same decision not made for armv5 and armv6?

Right lot of older arm implementation may or may not have thumb ISA so there was no reliable way of choosing it and secondly it’s a bit less tested ISA especially when it came to thumb1 for long Martin ran qemuarm/v5 build using thumb ISA and he would find weird corner cases and build failures

I think this makes sense for poky-tiny but we do not test it as much and it might give a bad experience unless we test this combo regularly

I think I need to bring the support detection logic here to find out if platform in use supports thumb mode.

I'll do some more builds to ensure everything builds correctly with thumb mode. I think I found one more recipe that doesn't play nice.

Setting it default for tiny profile makes sense so that it also gets regularly exercised.

author
#6 lore raw
Quoted 11 lines · Martin Jansa

The detection should work fine as long as you select the right DEFAULTTUNE

thumb is used only when ARM_INSTRUCTION_SET is set to thumb AND thumb appears in TUNE_FEATURES (which are defined by selected DEFAULTTUNE).

I've stopped building for armv4t (om-gta0* MACHINEs dropped in
https://github.com/shr-distribution/meta-smartphone/commit/647d43223ed6ace5d68b1e36d34978da472634e7
<https://github.com/shr-distribution/meta-smartphone/commit/647d43223ed6ace5d68b1e36d34978da472634e7>)
and armv5te (tune-xscare.inc used by e.g. spitz MACHINE from meta-handheld) more than 3 years ago, I don't know how much the support for thumb1 degraded since then.

Thanks for sharing. I'm building core-image-minimal at this moment and am not having any issues. There were some issues in the SDK world that I need to debug.