€•drŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ//translations/zh_CN/arch/arm64/asymmetric-32bit”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/zh_TW/arch/arm64/asymmetric-32bit”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/it_IT/arch/arm64/asymmetric-32bit”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/ja_JP/arch/arm64/asymmetric-32bit”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/ko_KR/arch/arm64/asymmetric-32bit”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/pt_BR/arch/arm64/asymmetric-32bit”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/sp_SP/arch/arm64/asymmetric-32bit”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒAsymmetric 32-bit SoCs”h]”hŒAsymmetric 32-bit SoCs”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒI/var/lib/git/docbuild/linux/Documentation/arch/arm64/asymmetric-32bit.rst”h´KubhŒ paragraph”“”)”}”(hŒ%Author: Will Deacon ”h]”(hŒAuthor: Will Deacon <”…””}”(hhÍh²hh³Nh´NubhŒ reference”“”)”}”(hŒwill@kernel.org”h]”hŒwill@kernel.org”…””}”(hh×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:will@kernel.org”uh1hÕhhÍubhŒ>”…””}”(hhÍh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)”}”(hŒsThis document describes the impact of asymmetric 32-bit SoCs on the execution of 32-bit (``AArch32``) applications.”h]”(hŒYThis document describes the impact of asymmetric 32-bit SoCs on the execution of 32-bit (”…””}”(hhñh²hh³Nh´NubhŒliteral”“”)”}”(hŒ ``AArch32``”h]”hŒAArch32”…””}”(hhûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hùhhñubhŒ) applications.”…””}”(hhñh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)”}”(hŒDate: 2021-05-17”h]”hŒDate: 2021-05-17”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hh·h²hubh¶)”}”(hhh]”(h»)”}”(hŒ Introduction”h]”hŒ Introduction”…””}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj!h²hh³hÊh´K ubhÌ)”}”(hXöSome Armv9 SoCs suffer from a big.LITTLE misfeature where only a subset of the CPUs are capable of executing 32-bit user applications. On such a system, Linux by default treats the asymmetry as a "mismatch" and disables support for both the ``PER_LINUX32`` personality and ``execve(2)`` of 32-bit ELF binaries, with the latter returning ``-ENOEXEC``. If the mismatch is detected during late onlining of a 64-bit-only CPU, then the onlining operation fails and the new CPU is unavailable for scheduling.”h]”(hŒõSome Armv9 SoCs suffer from a big.LITTLE misfeature where only a subset of the CPUs are capable of executing 32-bit user applications. On such a system, Linux by default treats the asymmetry as a “mismatch†and disables support for both the ”…””}”(hj2h²hh³Nh´Nubhú)”}”(hŒ``PER_LINUX32``”h]”hŒ PER_LINUX32”…””}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hùhj2ubhŒ personality and ”…””}”(hj2h²hh³Nh´Nubhú)”}”(hŒ ``execve(2)``”h]”hŒ execve(2)”…””}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hùhj2ubhŒ3 of 32-bit ELF binaries, with the latter returning ”…””}”(hj2h²hh³Nh´Nubhú)”}”(hŒ ``-ENOEXEC``”h]”hŒ-ENOEXEC”…””}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hùhj2ubhŒ™. If the mismatch is detected during late onlining of a 64-bit-only CPU, then the onlining operation fails and the new CPU is unavailable for scheduling.”…””}”(hj2h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj!h²hubhÌ)”}”(hŒ²Surprisingly, these SoCs have been produced with the intention of running legacy 32-bit binaries. Unsurprisingly, that doesn't work very well with the default behaviour of Linux.”h]”hŒ´Surprisingly, these SoCs have been produced with the intention of running legacy 32-bit binaries. Unsurprisingly, that doesn’t work very well with the default behaviour of Linux.”…””}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj!h²hubhÌ)”}”(hXVIt seems inevitable that future SoCs will drop 32-bit support altogether, so if you're stuck in the unenviable position of needing to run 32-bit code on one of these transitionary platforms then you would be wise to consider alternatives such as recompilation, emulation or retirement. If neither of those options are practical, then read on.”h]”hXXIt seems inevitable that future SoCs will drop 32-bit support altogether, so if you’re stuck in the unenviable position of needing to run 32-bit code on one of these transitionary platforms then you would be wise to consider alternatives such as recompilation, emulation or retirement. If neither of those options are practical, then read on.”…””}”(hj„h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj!h²hubeh}”(h]”Œ introduction”ah ]”h"]”Œ introduction”ah$]”h&]”uh1hµhh·h²hh³hÊh´K ubh¶)”}”(hhh]”(h»)”}”(hŒEnabling kernel support”h]”hŒEnabling kernel support”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjšh²hh³hÊh´K#ubhÌ)”}”(hXSince the kernel support is not completely transparent to userspace, allowing 32-bit tasks to run on an asymmetric 32-bit system requires an explicit "opt-in" and can be enabled by passing the ``allow_mismatched_32bit_el0`` parameter on the kernel command-line.”h]”(hŒÅSince the kernel support is not completely transparent to userspace, allowing 32-bit tasks to run on an asymmetric 32-bit system requires an explicit “opt-in†and can be enabled by passing the ”…””}”(hj«h²hh³Nh´Nubhú)”}”(hŒ``allow_mismatched_32bit_el0``”h]”hŒallow_mismatched_32bit_el0”…””}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hùhj«ubhŒ& parameter on the kernel command-line.”…””}”(hj«h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K%hjšh²hubhÌ)”}”(hŒ§For the remainder of this document we will refer to an *asymmetric system* to mean an asymmetric 32-bit SoC running Linux with this kernel command-line option enabled.”h]”(hŒ7For the remainder of this document we will refer to an ”…””}”(hjËh²hh³Nh´NubhŒemphasis”“”)”}”(hŒ*asymmetric system*”h]”hŒasymmetric system”…””}”(hjÕh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jÓhjËubhŒ] to mean an asymmetric 32-bit SoC running Linux with this kernel command-line option enabled.”…””}”(hjËh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K*hjšh²hubeh}”(h]”Œenabling-kernel-support”ah ]”h"]”Œenabling kernel support”ah$]”h&]”uh1hµhh·h²hh³hÊh´K#ubh¶)”}”(hhh]”(h»)”}”(hŒUserspace impact”h]”hŒUserspace impact”…””}”(hjøh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjõh²hh³hÊh´K/ubhÌ)”}”(hŒ›32-bit tasks running on an asymmetric system behave in mostly the same way as on a homogeneous system, with a few key differences relating to CPU affinity.”h]”hŒ›32-bit tasks running on an asymmetric system behave in mostly the same way as on a homogeneous system, with a few key differences relating to CPU affinity.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K1hjõh²hubh¶)”}”(hhh]”(h»)”}”(hŒsysfs”h]”hŒsysfs”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´K6ubhÌ)”}”(hŒ»The subset of CPUs capable of running 32-bit tasks is described in ``/sys/devices/system/cpu/aarch32_el0`` and is documented further in Documentation/ABI/testing/sysfs-devices-system-cpu.”h]”(hŒCThe subset of CPUs capable of running 32-bit tasks is described in ”…””}”(hj%h²hh³Nh´Nubhú)”}”(hŒ'``/sys/devices/system/cpu/aarch32_el0``”h]”hŒ#/sys/devices/system/cpu/aarch32_el0”…””}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hùhj%ubhŒQ and is documented further in Documentation/ABI/testing/sysfs-devices-system-cpu.”…””}”(hj%h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K8hjh²hubhÌ)”}”(hŒë**Note:** CPUs are advertised by this file as they are detected and so late-onlining of 32-bit-capable CPUs can result in the file contents being modified by the kernel at runtime. Once advertised, CPUs are never removed from the file.”h]”(hŒstrong”“”)”}”(hŒ **Note:**”h]”hŒNote:”…””}”(hjKh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jIhjEubhŒâ CPUs are advertised by this file as they are detected and so late-onlining of 32-bit-capable CPUs can result in the file contents being modified by the kernel at runtime. Once advertised, CPUs are never removed from the file.”…””}”(hjEh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K