Skip to contentSkip to conversation

qemu.bbclass: Allow use different QEMU binary depending of target

PATCH In review Otavio Salvador 4 participants 6 messages Sep 23, 2016 – Sep 26, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 qemu.bbclass: Allow use different QEMU binary depending of target

There are architectures which support running in 32 and 64 bit flavours however the simulation is provided in a specific QEMU setting, requiring us to use a different binary. This patch allow this to be done using, for example:

QEMU_TARGET_BINARY_ppce5500 = "qemu-ppc64abi32"

---

 meta/classes/qemu.bbclass | 5 +++++
 1 file changed, 5 insertions(+)
meta/classes/qemu.bbclass +5 -0
index 75739db..f2d4d1c 100644
@@ -4,6 +4,11 @@
 #
 
 def qemu_target_binary(data):
+    package_arch = data.getVar("PACKAGE_ARCH", True)
+    qemu_target_binary = (data.getVar("QEMU_TARGET_BINARY_%s" % package_arch, True) or "")
+    if qemu_target_binary:
+        return qemu_target_binary
+
     target_arch = data.getVar("TARGET_ARCH", True)
     if target_arch in ("i486", "i586", "i686"):
         target_arch = "i386"
Signature · 1 line
2.10.0
#1 lore raw

PATCH 2/2 tune-ppc[65]00.inc: Disable QEMU usermode usage

The QEMU usermode fails with invalid instruction error when used with those tunes.

The issue is being tracked in [YOCTO: #10304].

---

 meta/conf/machine/include/tune-ppce5500.inc | 3 +++
 meta/conf/machine/include/tune-ppce6500.inc | 3 +++
 2 files changed, 6 insertions(+)
meta/conf/machine/include/tune-ppce5500.inc +3 -0
index ace2614..cebb244 100644
@@ -18,3 +18,6 @@ PACKAGE_EXTRA_ARCHS_tune-ppc64e5500 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc
 
 # glibc configure options to get e5500 specific library (for sqrt)
 GLIBC_EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'e5500', '--with-cpu=e5500', '', d)}"
+
+# QEMU usermode fails with invalid instruction error (YOCTO: #10304)
+MACHINE_FEATURES_BACKFILL_CONSIDERED_append = "${@bb.utils.contains('TUNE_FEATURES', 'e5500', ' qemu-usermode', '', d)}"
meta/conf/machine/include/tune-ppce6500.inc +3 -0
index da1e864..5db7e76 100644
@@ -19,3 +19,6 @@ PACKAGE_EXTRA_ARCHS_tune-ppc64e6500 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc
 # glibc configure options to get e6500 specific library
 GLIBC_EXTRA_OECONF_powerpc64 += "${@bb.utils.contains('TUNE_FEATURES', 'e6500', '--with-cpu=e6500', '', d)}"
 GLIBC_EXTRA_OECONF_powerpc += "${@bb.utils.contains('TUNE_FEATURES', 'e6500', '--with-cpu=e6500', '', d)}"
+
+# QEMU usermode fails with invalid instruction error (YOCTO: #10304)
+MACHINE_FEATURES_BACKFILL_CONSIDERED_append = "${@bb.utils.contains('TUNE_FEATURES', 'e6500', ' qemu-usermode', '', d)}"
Signature · 1 line
2.10.0
#2 lore raw

Re: [PATCH 2/2] tune-ppc[65]00.inc: Disable QEMU usermode usage

Quoted 4 lines · Otavio Salvador

The QEMU usermode fails with invalid instruction error when used with those tunes.

The issue is being tracked in [YOCTO: #10304].

Does this option remove using particular SPE option when invoking QEMU in usermode ? if so there may be another issue where these instructions are emitted by compiler and they wont be emulated.

What will this change do which fixes the problem ?
from bug it seems it needs a Qemu with 32bit ABI, are we building that version of qemu-ppc

Quoted 37 lines

---

 meta/conf/machine/include/tune-ppce5500.inc | 3 +++
 meta/conf/machine/include/tune-ppce6500.inc | 3 +++
 2 files changed, 6 insertions(+)
meta/conf/machine/include/tune-ppce5500.inc +3 -0
index ace2614..cebb244 100644
@@ -18,3 +18,6 @@ PACKAGE_EXTRA_ARCHS_tune-ppc64e5500 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc
 
 # glibc configure options to get e5500 specific library (for sqrt)
 GLIBC_EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'e5500', '--with-cpu=e5500', '', d)}"
+
+# QEMU usermode fails with invalid instruction error (YOCTO: #10304)
+MACHINE_FEATURES_BACKFILL_CONSIDERED_append = "${@bb.utils.contains('TUNE_FEATURES', 'e5500', ' qemu-usermode', '', d)}"
meta/conf/machine/include/tune-ppce6500.inc +3 -1
index da1e864..5db7e76 100644
@@ -19,3 +19,6 @@ PACKAGE_EXTRA_ARCHS_tune-ppc64e6500 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc
 # glibc configure options to get e6500 specific library
 GLIBC_EXTRA_OECONF_powerpc64 += "${@bb.utils.contains('TUNE_FEATURES', 'e6500', '--with-cpu=e6500', '', d)}"
 GLIBC_EXTRA_OECONF_powerpc += "${@bb.utils.contains('TUNE_FEATURES', 'e6500', '--with-cpu=e6500', '', d)}"
+
+# QEMU usermode fails with invalid instruction error (YOCTO: #10304)
+MACHINE_FEATURES_BACKFILL_CONSIDERED_append = "${@bb.utils.contains('TUNE_FEATURES', 'e6500', ' qemu-usermode', '', d)}"
--

2.10.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw

Re: [PATCH 2/2] tune-ppc[65]00.inc: Disable QEMU usermode usage

Quoted 7 lines · Khem Raj
Quoted 4 lines · Otavio Salvador

The QEMU usermode fails with invalid instruction error when used with those tunes.

The issue is being tracked in [YOCTO: #10304].

Quoted 7 lines

Does this option remove using particular SPE option when invoking QEMU in usermode ? if so there may be another issue where these instructions are emitted by compiler and they wont be emulated.

What will this change do which fixes the problem ?
from bug it seems it needs a Qemu with 32bit ABI, are we building that version of qemu-ppc

We are not, at this moment.

I did a local patch to enable it and test the usermode and it still produces an exception at runtime:

http://termbin.com/9g6t

if we can fix the underlying issue, better, but disabling it allow for better user experience in meanwhile.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#4 lore raw
In reply to Otavio Salvador
Quoted 6 lines · Otavio Salvador

There are architectures which support running in 32 and 64 bit flavours however the simulation is provided in a specific QEMU setting, requiring us to use a different binary. This patch allow this to be done using, for example:

QEMU_TARGET_BINARY_ppce5500 = "qemu-ppc64abi32"

Should there also be a patch that makes use of this feature?

Alex

#5 lore raw
Quoted 11 lines · Alexander Kanavin
Quoted 7 lines · Otavio Salvador

There are architectures which support running in 32 and 64 bit flavours however the simulation is provided in a specific QEMU setting, requiring us to use a different binary. This patch allow this to be done using, for example:

QEMU_TARGET_BINARY_ppce5500 = "qemu-ppc64abi32"

Should there also be a patch that makes use of this feature?

QEMU for e5500 is not working for us; until it is working it is no sense to submit the patch however I am using it for test.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750