Bug 15618 - qemuarmv5: mrc considered an illegal instruction (as used by python 3.13)
Summary: qemuarmv5: mrc considered an illegal instruction (as used by python 3.13)
Status: RESOLVED ReportedUpstream
Alias: None
Product: BSPs
Classification: Build System, Metadata & Runtime
Component: bsps-oe-core (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 5.2 M1
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2024-10-11 13:21 UTC by Alexander Kanavin
Modified: 2024-10-17 14:34 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kanavin 2024-10-11 13:21:18 UTC
Python 3.13 introduced usage of mrc instructions via inline assembly:

https://github.com/python/cpython/blob/main/Include/object.h#L195
https://github.com/python/cpython/blob/main/Include/internal/mimalloc/mimalloc/prim.h#L172
https://github.com/python/cpython/blob/main/Include/internal/mimalloc/mimalloc/prim.h#L199

This seems to work ok in qemuarm (I didn't specifically confirm that these code paths are executed though), but in qemuarmv5 it throws 'Illegal instruction'.

It isn't clear if qemu makes incorrect decisions, or the instruction as specified by python is indeed not universal on arm hardware.

For now, I was able to disable the use of it via disabling mimalloc feature on armv5 targets.
Comment 1 Ross Burton 2024-10-14 10:53:13 UTC
Filed upstream at https://github.com/python/cpython/issues/125444.
Comment 2 Ross Burton 2024-10-17 14:34:12 UTC
Upstream has now resolved this issue in the 3.13.x branch and we don't have 3.13.0 yet. Closing as filed upstream, we'll backport the fix for the upgrade.