tune-cortexa32: AArch32 Thumb-2/crypto fixes, plus a QEMU machine
cover tune-cortexa32: AArch32 Thumb-2/crypto fixes, plus a QEMU machine
Cortex-A32 is an AArch32-only ARMv8-A core - it has no AArch64 mode at all. The current tune-cortexa32.inc lacks the thumb feature, and its AArch32 crypto FPU selection and PACKAGE_EXTRA_ARCHS names are wrong for a Thumb-2 build.
Patch 1 fixes the equivalent problem on the Rust side: rust-common's target_is_armv7() doesn't recognise armv8a, so an AArch32 Thumb build is missing both the +v8 and +thumb2 LLVM features, and the "arm-..." RUST_TARGET_SYS triple doesn't parse as ARMv8 for inline-asm purposes either. This has to land before patch 2, because once tune-cortexa32 enables the thumb feature, building rust for it fails without this fix.
Patch 2 is the tune-cortexa32.inc fix itself: add arm and thumb to TUNE_FEATURES, fix PACKAGE_EXTRA_ARCHS to use the t2hf naming, and append crypto-neon-fp-armv8 to TUNE_CCARGS_MFPU when both crypto and neon are active, since on AArch32 the ARMv8 crypto extensions live in the FPU rather than -march alone. Without this, GCC rejects the AES intrinsics used by e.g. mbedtls' aesce.c with "target specific option mismatch".
Patch 3 adds a qemuarmv8a32 machine so the above is actually
exercisable: QEMU has no Cortex-A32 model, so it boots the virt machine with qemu-system-arm -cpu max instead, reusing the qemuarma15 linux-yocto BSP via KMACHINE. I'm really not sure if this is appropriate for OE-Core - it's useful, but I suspect it really wants a proper U-Boot and kernel config.
The real breakage I'm attempting to fix is mbedtls, which I need (covered by #2), which then exposes the problems in libstd-rs (covered by #1). #3 is really here so there's a way to show it which isn't the board I'm building for.
AI-Generated: Claude Code (Claude Opus 4.8)
---
Alex Kiernan (3):
rust-target-config: armv8a AArch32 Thumb build fixes
tune-cortexa32: enable Thumb-2 and fix AArch32 crypto FPU selection
qemuarmv8a32: add QEMU machine for AArch32 ARMv8-A
meta/classes-recipe/rust-target-config.bbclass | 21 +++++++++++-- .../machine/include/arm/armv8a/tune-cortexa32.inc | 14 +++++++-- meta/conf/machine/qemuarmv8a32.conf | 36 ++++++++++++++++++++++ meta/recipes-kernel/linux/linux-yocto_6.18.bb | 2 +- 4 files changed, 66 insertions(+), 7 deletions(-)
---
base-commit: 9780e392300549f69e11e2f3bcb9bff77b21d572
change-id: 20260701-tune-a32-78f0212484c9
Best regards,
Signature · 1 line
Alex Kiernan <[email protected]>
PATCH 1/3 rust-target-config: armv8a AArch32 Thumb build fixes
From: Alex Kiernan <[email protected]>
llvm_features_from_tune() calls target_is_armv7() to gate both the +v7 LLVM feature and the +thumb2 feature. target_is_armv7() (in rust-common.bbclass) only recognises armv7a/armv7r/armv7m/armv7ve -- it returns False for armv8a. As a result an ARMv8-A AArch32 Thumb build gets "+neon,+thumb-mode" in the target JSON but neither "+v8" nor "+thumb2".
LLVM's ParseARMTriple() returns "" for "arm-..." triples (ARM::parseArch("arm") = INVALID), leaving HasV4TOps unset in the MCSubtargetInfo used for module-level inline asm parsing. The ARM ASM parser's hasThumb() then returns false and ".thumb" directives in compiler_builtins naked-function trampolines (__aeabi_uldivmod etc.) are rejected.
This produces two failures when building libstd-rs / compiler_builtins:
1. core: "LLVM ERROR: Cannot select: br" in core::fmt::num -- LLVM ARM ISel patterns for Thumb-2 unconditional branches (t2B) are gated on HasV8Ops as well as IsThumb2; without +v8 the pattern never fires.
2. compiler_builtins: "target does not support Thumb mode" on .thumb directives in naked-function trampolines (__aeabi_uldivmod etc.) -- two separate paths both require +thumb2: HasV4TOps in the MCSubtargetInfo (set transitively via ParseARMTriple) and FeatureThumb2 in the code-gen ARMSubtarget.
The natural fix would be to change RUST_TARGET_SYS to "armv8a-...", but "armv8a" is not a recognised Rust target architecture so the triple is not valid there. Instead rust_sys_to_llvm_target() rewrites only the JSON llvm-target field, leaving RUST_TARGET_SYS and rust-common.bbclass unchanged.
- Add +v8 to llvm_features_from_tune for armv8a AArch32.
- Add +thumb2 to llvm_features_from_tune for armv8a AArch32 Thumb.
- Extend rust_sys_to_llvm_target() to accept the datastore and rewrite the "arm-..." triple to "armv8a-..." for armv8a AArch32 targets, so the JSON llvm-target field uses "armv8a-..." while RUST_TARGET_SYS keeps "arm-...". ParseARMTriple then adds "+armv8-a" to the MCSubtargetInfo, transitively setting HasV4TOps and making hasThumb() return true.
The TARGET_ARCH == 'arm' guard is required because AArch64 tunes also carry armv8a in TUNE_FEATURES (via arch-armv8a.inc) but must not be affected.
AI-Generated: Claude Code (Claude Opus 4.8)
--- meta/classes-recipe/rust-target-config.bbclass | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
meta/classes-recipe/rust-target-config.bbclass +18 -3
@@ -19,6 +19,8 @@ def llvm_features_from_tune(d): mach_overrides = d.getVar('MACHINEOVERRIDES') mach_overrides = frozenset(mach_overrides.split(':')) + target_arch = d.getVar('TARGET_ARCH') + if 'vfpv4' in feat: f.append("+vfp4") elif 'vfpv4d16' in feat:
@@ -46,6 +48,9 @@ def llvm_features_from_tune(d): if target_is_armv7(d): f.append('+v7') + if 'armv8a' in feat and target_arch == 'arm': + f.append('+v8') + if ('armv6' in mach_overrides) or ('armv6' in feat): f.append("+v6") if 'armv5te' in feat:
@@ -63,7 +68,8 @@ def llvm_features_from_tune(d): if 'thumb' in feat: if d.getVar('ARM_THUMB_OPT') == "thumb": - if target_is_armv7(d): + if target_is_armv7(d) or \ + ('armv8a' in feat and target_arch == 'arm'): f.append('+thumb2') f.append("+thumb-mode")
@@ -302,7 +308,16 @@ def arch_to_rust_target_arch(arch): return arch # Convert a rust target string to a llvm-compatible triplet -def rust_sys_to_llvm_target(sys): +def rust_sys_to_llvm_target(sys, d): + # For AArch32 ARMv8-A, RUST_TARGET_SYS stays "arm-..." because "armv8a" is not a + # valid Rust target architecture. Rewrite llvm-target to "armv8a-..." here so + # ParseARMTriple adds "+armv8-a" and transitively sets HasV4TOps in the + # MCSubtargetInfo used for module-level inline asm parsing, making hasThumb() + # return true for .thumb directives. + if sys.startswith('arm-') and \ + 'armv8a' in (d.getVar('TUNE_FEATURES') or '').split() and \ + d.getVar('TARGET_ARCH') == 'arm': + return 'armv8a-' + sys[4:] return sys # generates our target CPU value
@@ -382,7 +397,7 @@ def rust_gen_target(d, thing, wd, arch): # build tspec tspec = {} - tspec['llvm-target'] = rust_sys_to_llvm_target(rustsys) + tspec['llvm-target'] = rust_sys_to_llvm_target(rustsys, d) tspec['data-layout'] = d.getVarFlag('DATA_LAYOUT', arch_abi) if tspec['data-layout'] is None: bb.fatal("No rust target defined for %s" % arch_abi)
Signature · 1 line
2.43.0
PATCH 2/3 tune-cortexa32: enable Thumb-2 and fix AArch32 crypto FPU selection
In reply to Alex KiernanCortex-A32 is an AArch32-only ARMv8-A core, but its tune was configured as if it were a plain 64-bit-style tune: TUNE_FEATURES lacked both 'arm' and 'thumb', so userspace and the kernel were built as fixed-width ARM rather than Thumb-2, and the package architecture names did not match a Thumb-2 build.
Add 'thumb' so the core is built as Thumb-2, and 'arm' so that feature-arm-thumb.inc honours a recipe's explicit ARM_INSTRUCTION_SET = "arm" instead of silently forcing it to thumb. Without 'arm', ARM_M_OPT is pinned to "thumb" and recipes that request ARM warn, e.g.:
Recipe 'libmad' selects ARM_INSTRUCTION_SET to be 'arm', but tune configuration overrides it to 'thumb'
On AArch32 the ARMv8 crypto extensions (AES/SHA) are part of the FPU, not just the -march ISA. The 'crypto' feature only appends '+crypto' to -march and leaves -mfpu at plain 'neon', so building the AES intrinsics (e.g. mbedtls aesce.c) fails:
error: inlining failed in call to 'always_inline' 'vaesdq_u8':
target specific option mismatch
Select the crypto FPU by appending crypto-neon-fp-armv8 as the last word of TUNE_CCARGS_MFPU when both 'crypto' and 'neon' are active, mirroring the vfpv4+neon -> neon-vfpv4 idiom in feature-arm-neon.inc.
Update PACKAGE_EXTRA_ARCHS to match the resulting package arches:
cortexa32hf-neon becomes cortexa32t2hf-neon, and the crypto variant becomes cortexa32t2hf-neon plus cortexa32t2hf-crypto-neon-fp-armv8.
AI-Generated: Claude Code (Claude Opus 4.8)
--- meta/conf/machine/include/arm/armv8a/tune-cortexa32.inc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
meta/conf/machine/include/arm/armv8a/tune-cortexa32.inc +11 -3
@@ -5,14 +5,22 @@ TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexa32', ' -mcpu=corte require conf/machine/include/arm/arch-armv8a.inc +# On AArch32 the ARMv8 crypto extensions (AES/SHA) live in the FPU, not just +# -march. OE-Core's 'crypto' feature only adds '+crypto' to -march, leaving the +# FPU at plain 'neon', so GCC refuses to inline the AES intrinsics used by e.g. +# mbedtls' aesce.c ("target specific option mismatch"). Select the crypto FPU by +# making it the last word of TUNE_CCARGS_MFPU - the same idiom OE-Core uses for +# the vfpv4+neon -> neon-vfpv4 combination in feature-arm-neon.inc. +TUNE_CCARGS_MFPU .= "${@bb.utils.contains('TUNE_FEATURES', [ 'crypto', 'neon' ], ' crypto-neon-fp-armv8', '', d)}" + # Little Endian base configs AVAILTUNES += "cortexa32 cortexa32-crypto" ARMPKGARCH:tune-cortexa32 = "cortexa32" ARMPKGARCH:tune-cortexa32-crypto = "cortexa32" # We do not want -march since -mcpu is added above to cover for it -TUNE_FEATURES:tune-cortexa32 = "armv8a cortexa32 crc callconvention-hard neon" +TUNE_FEATURES:tune-cortexa32 = "arm armv8a cortexa32 crc callconvention-hard neon thumb" TUNE_FEATURES:tune-cortexa32-crypto = "${TUNE_FEATURES:tune-cortexa32} crypto" -PACKAGE_EXTRA_ARCHS:tune-cortexa32 = "${PACKAGE_EXTRA_ARCHS:tune-armv8a-crc} cortexa32 cortexa32hf-neon" -PACKAGE_EXTRA_ARCHS:tune-cortexa32-crypto = "${PACKAGE_EXTRA_ARCHS:tune-armv8a-crc-crypto} cortexa32 cortexa32hf-neon cortexa32hf-neon-crypto" +PACKAGE_EXTRA_ARCHS:tune-cortexa32 = "${PACKAGE_EXTRA_ARCHS:tune-armv8a-crc} cortexa32 cortexa32t2hf-neon" +PACKAGE_EXTRA_ARCHS:tune-cortexa32-crypto = "${PACKAGE_EXTRA_ARCHS:tune-armv8a-crc-crypto} cortexa32 cortexa32t2hf-neon cortexa32t2hf-crypto-neon-fp-armv8" BASE_LIB:tune-cortexa32 = "lib" BASE_LIB:tune-cortexa32-crypto = "lib"
Signature · 1 line
2.43.0
PATCH 3/3 qemuarmv8a32: add QEMU machine for AArch32 ARMv8-A
In reply to Alex KiernanAdd a QEMU machine for exercising an AArch32-only ARMv8-A target (Cortex-A32) under emulation, defaulting to the cortexa32-crypto tune. QEMU has no Cortex-A32 model, so it runs on the 'virt' machine with qemu-system-arm and -cpu max, which provides the ARMv8-A AArch32 feature set including the crypto extensions needed by the crypto tune. The kernel is built as a zImage and u-boot uses qemu_arm_defconfig, matching the other 32-bit ARM QEMU machines.
Map KMACHINE to qemuarma15 so the existing linux-yocto BSP is reused, and add qemuarmv8a32 to linux-yocto's COMPATIBLE_MACHINE so a kernel can be built for it.
AI-Generated: Claude Code (Claude Opus 4.8)
--- meta/conf/machine/qemuarmv8a32.conf | 36 +++++++++++++++++++++++++++ meta/recipes-kernel/linux/linux-yocto_6.18.bb | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-)
meta/conf/machine/qemuarmv8a32.conf new file +36 -0
@@ -0,0 +1,36 @@ +#@TYPE: Machine +#@NAME: QEMU ARMv8 AArch32 machine on Cortex-A32 +#@DESCRIPTION: Machine configuration for running an AArch32 system on QEMU + +DEFAULTTUNE = "cortexa32-crypto" + +require conf/machine/include/arm/armv8a/tune-cortexa32.inc +require conf/machine/include/qemu.inc + +KERNEL_IMAGETYPE = "zImage" + +PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot" +UBOOT_MACHINE ?= "qemu_arm_defconfig" + +SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;hvc0" + +# For runqemu +QB_SYSTEM_NAME = "qemu-system-arm" +QB_MACHINE = "-machine virt" +# QEMU doesn't know about Cortex-A32 +QB_CPU = "-cpu max" +QB_SMP ?= "-smp 4" +QB_CPU_KVM = "-cpu host -machine gic-version=3" +# For graphics to work we need to define the VGA device as well as the necessary USB devices +QB_GRAPHICS = "-device virtio-gpu-pci" +QB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd" +# Virtio Networking support +QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" +QB_NETWORK_DEVICE = "-device virtio-net-pci,netdev=net0,mac=@MAC@" +# Virtio block device +QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-pci,drive=disk0" +# Virtio serial console +QB_SERIAL_OPT = "-device virtio-serial-pci -chardev null,id=virtcon -device virtconsole,chardev=virtcon" +QB_TCPSERIAL_OPT = "-device virtio-serial-pci -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1,nodelay=on -device virtconsole,chardev=virtcon" + +KMACHINE:qemuarmv8a32 = "qemuarma15"
meta/recipes-kernel/linux/linux-yocto_6.18.bb +1 -1
@@ -52,7 +52,7 @@ KCONF_BSP_AUDIT_LEVEL = "1" KERNEL_DEVICETREE:qemuarmv5 = "arm/versatile-pb.dtb" -COMPATIBLE_MACHINE = "^(qemuarm|qemuarmv5|qemuarm64|qemux86|qemuppc|qemuppc64|qemumips|qemumips64|qemux86-64|qemuriscv64|qemuriscv32|qemuloongarch64)$" +COMPATIBLE_MACHINE = "^(qemuarm|qemuarmv5|qemuarmv8a32|qemuarm64|qemux86|qemuppc|qemuppc64|qemumips|qemumips64|qemux86-64|qemuriscv64|qemuriscv32|qemuloongarch64)$" # Functionality flags KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
Signature · 1 line
2.43.0
Re: [OE-core] [PATCH 3/3] qemuarmv8a32: add QEMU machine for AArch32 ARMv8-A
Quoted 38 lines · Alex Kiernan via lists.openembedded.org
Add a QEMU machine for exercising an AArch32-only ARMv8-A target (Cortex-A32) under emulation, defaulting to the cortexa32-crypto tune. QEMU has no Cortex-A32 model, so it runs on the 'virt' machine with qemu-system-arm and -cpu max, which provides the ARMv8-A AArch32 feature set including the crypto extensions needed by the crypto tune. The kernel is built as a zImage and u-boot uses
qemu_arm_defconfig, matching the other 32-bit ARM QEMU machines.Map KMACHINE to qemuarma15 so the existing linux-yocto BSP is reused, and add qemuarmv8a32 to linux-yocto's
COMPATIBLE_MACHINEso a kernel can be built for it.AI-Generated: Claude Code (Claude Opus 4.8)
Signed-off-by Alex Kiernan <[email protected]>Signed-off-by Alex Kiernan <[email protected]>--- meta/conf/machine/qemuarmv8a32.conf | 36 +++++++++++++++++++++++++++ meta/recipes-kernel/linux/linux-yocto_6.18.bb | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-)meta/conf/machine/qemuarmv8a32.conf new file +11
-0@@ -0,0 +1,36 @@ +#@TYPE: Machine +#@NAME: QEMU ARMv8 AArch32 machine on Cortex-A32 +#@DESCRIPTION: Machine configuration for running an AArch32 system on QEMU + +DEFAULTTUNE = "cortexa32-crypto" + +require conf/machine/include/arm/armv8a/tune-cortexa32.inc +require conf/machine/include/qemu.inc + +KERNEL_IMAGETYPE = "zImage" +
meta/conf/machine/qemuarmv8a32.conf line 21
Quoted 10 lines
meta/conf/machine/qemuarmv8a32.conf new file +10
-0+PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot" +UBOOT_MACHINE ?= "qemu_arm_defconfig" + +SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;hvc0" + +# For runqemu +QB_SYSTEM_NAME = "qemu-system-arm" +QB_MACHINE = "-machine virt" +# QEMU doesn't know about Cortex-A32 +QB_CPU = "-cpu max"
I have concerns that this isn't doing what is expected. Looking at qemu-system-arm -machine virt -cpu
I'm seeing
...
cortex-a15
cortex-a7
cortex-a8
cortex-a9
...
and not any of the armv8 cores. So, I think that you aren't going to get any of the ARMv8 features with 'max', despite them possibly being in the tune referenced above, which might cause crashes or other unintended issues.
You might be okay on qemu-system-aarch64, given the ARMv8 cores there. Maybe you can try emulating the cortex-a35 core and running it in 32bit mode
If I'm wrong, please provide a link to the documentation stating that max on qemu-system-arm does what you say, because I'm not seeing it on
https://www.qemu.org/docs/master/system/arm/virt.html
Thanks,
Jon
Quoted 41 lines
meta/conf/machine/qemuarmv8a32.conf new file +15
-0+QB_SMP ?= "-smp 4" +QB_CPU_KVM = "-cpu host -machine gic-version=3" +# For graphics to work we need to define the VGA device as well as the necessary USB devices +QB_GRAPHICS = "-device virtio-gpu-pci" +QB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd" +# Virtio Networking support +QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" +QB_NETWORK_DEVICE = "-device virtio-net-pci,netdev=net0,mac=@MAC@" +# Virtio block device +QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-pci,drive=disk0" +# Virtio serial console +QB_SERIAL_OPT = "-device virtio-serial-pci -chardev null,id=virtcon -device virtconsole,chardev=virtcon" +QB_TCPSERIAL_OPT = "-device virtio-serial-pci -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1,nodelay=on -device virtconsole,chardev=virtcon" + +KMACHINE:qemuarmv8a32 = "qemuarma15"meta/recipes-kernel/linux/linux-yocto_6.18.bb +1
-2@@ -52,7 +52,7 @@ KCONF_BSP_AUDIT_LEVEL = "1" KERNEL_DEVICETREE:qemuarmv5 = "arm/versatile-pb.dtb" -COMPATIBLE_MACHINE = "^(qemuarm|qemuarmv5|qemuarm64|qemux86|qemuppc|qemuppc64|qemumips|qemumips64|qemux86-64|qemuriscv64|qemuriscv32|qemuloongarch64)$" +COMPATIBLE_MACHINE = "^(qemuarm|qemuarmv5|qemuarmv8a32|qemuarm64|qemux86|qemuppc|qemuppc64|qemumips|qemumips64|qemux86-64|qemuriscv64|qemuriscv32|qemuloongarch64)$" # Functionality flags KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc" --2.43.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#239980): https://lists.openembedded.org/g/openembedded-core/message/239980
Mute This Topic: https://lists.openembedded.org/mt/120062731/3616920
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCH 3/3] qemuarmv8a32: add QEMU machine for AArch32 ARMv8-A
Quoted 57 lines · Jon Mason
Quoted 38 lines · Alex Kiernan via lists.openembedded.org
Add a QEMU machine for exercising an AArch32-only ARMv8-A target (Cortex-A32) under emulation, defaulting to the cortexa32-crypto tune. QEMU has no Cortex-A32 model, so it runs on the 'virt' machine with qemu-system-arm and -cpu max, which provides the ARMv8-A AArch32 feature set including the crypto extensions needed by the crypto tune. The kernel is built as a zImage and u-boot uses
qemu_arm_defconfig, matching the other 32-bit ARM QEMU machines.Map KMACHINE to qemuarma15 so the existing linux-yocto BSP is reused, and add qemuarmv8a32 to linux-yocto's
COMPATIBLE_MACHINEso a kernel can be built for it.AI-Generated: Claude Code (Claude Opus 4.8)
Signed-off-by Alex Kiernan <[email protected]>Signed-off-by Alex Kiernan <[email protected]>--- meta/conf/machine/qemuarmv8a32.conf | 36 +++++++++++++++++++++++++++ meta/recipes-kernel/linux/linux-yocto_6.18.bb | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-)meta/conf/machine/qemuarmv8a32.conf new file +11
-0@@ -0,0 +1,36 @@ +#@TYPE: Machine +#@NAME: QEMU ARMv8 AArch32 machine on Cortex-A32 +#@DESCRIPTION: Machine configuration for running an AArch32 system on QEMU + +DEFAULTTUNE = "cortexa32-crypto" + +require conf/machine/include/arm/armv8a/tune-cortexa32.inc +require conf/machine/include/qemu.inc + +KERNEL_IMAGETYPE = "zImage" +meta/conf/machine/qemuarmv8a32.conf line 21
Quoted 10 lines
meta/conf/machine/qemuarmv8a32.conf new file +10
-0+PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot" +UBOOT_MACHINE ?= "qemu_arm_defconfig" + +SERIAL_CONSOLES ?= "115200;ttyAMA0 115200;hvc0" + +# For runqemu +QB_SYSTEM_NAME = "qemu-system-arm" +QB_MACHINE = "-machine virt" +# QEMU doesn't know about Cortex-A32 +QB_CPU = "-cpu max"I have concerns that this isn't doing what is expected. Looking at qemu-system-arm -machine virt -cpu
I'm seeing
...
cortex-a15
Quoted 8 lines
cortex-a7
cortex-a8
cortex-a9
...
and not any of the armv8 cores. So, I think that you aren't going to get any of the ARMv8 features with 'max', despite them possibly being in the tune referenced above, which might cause crashes or other unintended issues.
Totally agree... this is the part I really wasn't happy with.
Quoted 4 lines
You might be okay on qemu-system-aarch64, given the ARMv8 cores there. Maybe you can try emulating the cortex-a35 core and running it in 32bit mode
At some point I had this working, but I went around it repeatedly and failed to get it to work again :(
The commented out pieces I have (which I'm 99% sure I had working):
QB_SYSTEM_NAME = "qemu-system-aarch64"QB_CPU = "-cpu cortex-a32"QB_CPU_KVM = "-cpu host,aarch64=off -machine gic-version=3"
Any pointers on what I might be missing?
Quoted 48 lines
If I'm wrong, please provide a link to the documentation stating that max on qemu-system-arm does what you say, because I'm not seeing it on
https://www.qemu.org/docs/master/system/arm/virt.htmlThanks,
JonQuoted 41 lines
meta/conf/machine/qemuarmv8a32.conf new file +15
-0+QB_SMP ?= "-smp 4" +QB_CPU_KVM = "-cpu host -machine gic-version=3" +# For graphics to work we need to define the VGA device as well as the necessary USB devices +QB_GRAPHICS = "-device virtio-gpu-pci" +QB_OPT_APPEND = "-device qemu-xhci -device usb-tablet -device usb-kbd" +# Virtio Networking support +QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" +QB_NETWORK_DEVICE = "-device virtio-net-pci,netdev=net0,mac=@MAC@" +# Virtio block device +QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-pci,drive=disk0" +# Virtio serial console +QB_SERIAL_OPT = "-device virtio-serial-pci -chardev null,id=virtcon -device virtconsole,chardev=virtcon" +QB_TCPSERIAL_OPT = "-device virtio-serial-pci -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1,nodelay=on -device virtconsole,chardev=virtcon" + +KMACHINE:qemuarmv8a32 = "qemuarma15"meta/recipes-kernel/linux/linux-yocto_6.18.bb +1
-2@@ -52,7 +52,7 @@ KCONF_BSP_AUDIT_LEVEL = "1" KERNEL_DEVICETREE:qemuarmv5 = "arm/versatile-pb.dtb" -COMPATIBLE_MACHINE = "^(qemuarm|qemuarmv5|qemuarm64|qemux86|qemuppc|qemuppc64|qemumips|qemumips64|qemux86-64|qemuriscv64|qemuriscv32|qemuloongarch64)$" +COMPATIBLE_MACHINE = "^(qemuarm|qemuarmv5|qemuarmv8a32|qemuarm64|qemux86|qemuppc|qemuppc64|qemumips|qemumips64|qemux86-64|qemuriscv64|qemuriscv32|qemuloongarch64)$" # Functionality flags KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc" --2.43.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#239980): https://lists.openembedded.org/g/openembedded-core/message/239980
Mute This Topic: https://lists.openembedded.org/mt/120062731/3616920
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 1 line
Alex Kiernan