€•7Œ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/tagged-pointers”Œ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/tagged-pointers”Œ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/tagged-pointers”Œ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/tagged-pointers”Œ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/tagged-pointers”Œ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/tagged-pointers”Œ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/tagged-pointers”Œ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Œ)Tagged virtual addresses in AArch64 Linux”h]”hŒ)Tagged virtual addresses in AArch64 Linux”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒH/var/lib/git/docbuild/linux/Documentation/arch/arm64/tagged-pointers.rst”h´KubhŒ paragraph”“”)”}”(hŒ)Author: Will Deacon ”h]”(hŒAuthor: Will Deacon <”…””}”(hhÍh²hh³Nh´NubhŒ reference”“”)”}”(hŒwill.deacon@arm.com”h]”hŒwill.deacon@arm.com”…””}”(hh×h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:will.deacon@arm.com”uh1hÕhhÍubhŒ>”…””}”(hhÍh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)”}”(hŒDate : 12 June 2013”h]”hŒDate : 12 June 2013”…””}”(hhñh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)”}”(hŒ–This document briefly describes the provision of tagged virtual addresses in the AArch64 translation system and their potential uses in AArch64 Linux.”h]”hŒ–This document briefly describes the provision of tagged virtual addresses in the AArch64 translation system and their potential uses in AArch64 Linux.”…””}”(hhÿh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hh·h²hubhÌ)”}”(hŒòThe kernel configures the translation tables so that translations made via TTBR0 (i.e. userspace mappings) have the top byte (bits 63:56) of the virtual address ignored by the translation hardware. This frees up this byte for application use.”h]”hŒòThe kernel configures the translation tables so that translations made via TTBR0 (i.e. userspace mappings) have the top byte (bits 63:56) of the virtual address ignored by the translation hardware. This frees up this byte for application use.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hh·h²hubh¶)”}”(hhh]”(h»)”}”(hŒ&Passing tagged addresses to the kernel”h]”hŒ&Passing tagged addresses to the kernel”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´KubhÌ)”}”(hŒÚAll interpretation of userspace memory addresses by the kernel assumes an address tag of 0x00, unless the application enables the AArch64 Tagged Address ABI explicitly (Documentation/arch/arm64/tagged-address-abi.rst).”h]”hŒÚAll interpretation of userspace memory addresses by the kernel assumes an address tag of 0x00, unless the application enables the AArch64 Tagged Address ABI explicitly (Documentation/arch/arm64/tagged-address-abi.rst).”…””}”(hj,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khjh²hubhÌ)”}”(hŒ9This includes, but is not limited to, addresses found in:”h]”hŒ9This includes, but is not limited to, addresses found in:”…””}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khjh²hubhŒ block_quote”“”)”}”(hX- pointer arguments to system calls, including pointers in structures passed to system calls, - the stack pointer (sp), e.g. when interpreting it to deliver a signal, - the frame pointer (x29) and frame records, e.g. when interpreting them to generate a backtrace or call graph. ”h]”hŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒ\pointer arguments to system calls, including pointers in structures passed to system calls, ”h]”hÌ)”}”(hŒ[pointer arguments to system calls, including pointers in structures passed to system calls,”h]”hŒ[pointer arguments to system calls, including pointers in structures passed to system calls,”…””}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KhjUubah}”(h]”h ]”h"]”h$]”h&]”uh1jShjPubjT)”}”(hŒGthe stack pointer (sp), e.g. when interpreting it to deliver a signal, ”h]”hÌ)”}”(hŒFthe stack pointer (sp), e.g. when interpreting it to deliver a signal,”h]”hŒFthe stack pointer (sp), e.g. when interpreting it to deliver a signal,”…””}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hjmubah}”(h]”h ]”h"]”h$]”h&]”uh1jShjPubjT)”}”(hŒnthe frame pointer (x29) and frame records, e.g. when interpreting them to generate a backtrace or call graph. ”h]”hÌ)”}”(hŒmthe frame pointer (x29) and frame records, e.g. when interpreting them to generate a backtrace or call graph.”h]”hŒmthe frame pointer (x29) and frame records, e.g. when interpreting them to generate a backtrace or call graph.”…””}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K#hj…ubah}”(h]”h ]”h"]”h$]”h&]”uh1jShjPubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jNh³hÊh´KhjJubah}”(h]”h ]”h"]”h$]”h&]”uh1jHh³hÊh´Khjh²hubhÌ)”}”(hŒèUsing non-zero address tags in any of these locations when the userspace application did not enable the AArch64 Tagged Address ABI may result in an error code being returned, a (fatal) signal being raised, or other modes of failure.”h]”hŒèUsing non-zero address tags in any of these locations when the userspace application did not enable the AArch64 Tagged Address ABI may result in an error code being returned, a (fatal) signal being raised, or other modes of failure.”…””}”(hj«h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K&hjh²hubhÌ)”}”(hŒÏFor these reasons, when the AArch64 Tagged Address ABI is disabled, passing non-zero address tags to the kernel via system calls is forbidden, and using a non-zero address tag for sp is strongly discouraged.”h]”hŒÏFor these reasons, when the AArch64 Tagged Address ABI is disabled, passing non-zero address tags to the kernel via system calls is forbidden, and using a non-zero address tag for sp is strongly discouraged.”…””}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K+hjh²hubhÌ)”}”(hŒ—Programs maintaining a frame pointer and frame records that use non-zero address tags may suffer impaired or inaccurate debug and profiling visibility.”h]”hŒ—Programs maintaining a frame pointer and frame records that use non-zero address tags may suffer impaired or inaccurate debug and profiling visibility.”…””}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K0hjh²hubeh}”(h]”Œ&passing-tagged-addresses-to-the-kernel”ah ]”h"]”Œ&passing tagged addresses to the kernel”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒPreserving tags”h]”hŒPreserving tags”…””}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjÝh²hh³hÊh´K6ubhÌ)”}”(hXmWhen delivering signals, non-zero tags are not preserved in siginfo.si_addr unless the flag SA_EXPOSE_TAGBITS was set in sigaction.sa_flags when the signal handler was installed. This means that signal handlers in applications making use of tags cannot rely on the tag information for user virtual addresses being maintained in these fields unless the flag was set.”h]”hXmWhen delivering signals, non-zero tags are not preserved in siginfo.si_addr unless the flag SA_EXPOSE_TAGBITS was set in sigaction.sa_flags when the signal handler was installed. This means that signal handlers in applications making use of tags cannot rely on the tag information for user virtual addresses being maintained in these fields unless the flag was set.”…””}”(hjîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K8hjÝh²hubhÌ)”}”(hX¡If FEAT_MTE_TAGGED_FAR (Armv8.9) is supported, bits 63:60 of the fault address are preserved in response to synchronous tag check faults (SEGV_MTESERR) otherwise not preserved even if SA_EXPOSE_TAGBITS was set. Applications should interpret the values of these bits based on the support for the HWCAP3_MTE_FAR. If the support is not present, the values of these bits should be considered as undefined otherwise valid.”h]”hX¡If FEAT_MTE_TAGGED_FAR (Armv8.9) is supported, bits 63:60 of the fault address are preserved in response to synchronous tag check faults (SEGV_MTESERR) otherwise not preserved even if SA_EXPOSE_TAGBITS was set. Applications should interpret the values of these bits based on the support for the HWCAP3_MTE_FAR. If the support is not present, the values of these bits should be considered as undefined otherwise valid.”…””}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K?hjÝh²hubhÌ)”}”(hŒ–For signals raised in response to watchpoint debug exceptions, the tag information will be preserved regardless of the SA_EXPOSE_TAGBITS flag setting.”h]”hŒ–For signals raised in response to watchpoint debug exceptions, the tag information will be preserved regardless of the SA_EXPOSE_TAGBITS flag setting.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KFhjÝh²hubhÌ)”}”(hŒoNon-zero tags are never preserved in sigcontext.fault_address regardless of the SA_EXPOSE_TAGBITS flag setting.”h]”hŒoNon-zero tags are never preserved in sigcontext.fault_address regardless of the SA_EXPOSE_TAGBITS flag setting.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KJhjÝh²hubhÌ)”}”(hŒ‚The architecture prevents the use of a tagged PC, so the upper byte will be set to a sign-extension of bit 55 on exception return.”h]”hŒ‚The architecture prevents the use of a tagged PC, so the upper byte will be set to a sign-extension of bit 55 on exception return.”…””}”(hj&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KMhjÝh²hubhÌ)”}”(hŒLThis behaviour is maintained when the AArch64 Tagged Address ABI is enabled.”h]”hŒLThis behaviour is maintained when the AArch64 Tagged Address ABI is enabled.”…””}”(hj4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KPhjÝh²hubeh}”(h]”Œpreserving-tags”ah ]”h"]”Œpreserving tags”ah$]”h&]”uh1hµhh·h²hh³hÊh´K6ubh¶)”}”(hhh]”(h»)”}”(hŒOther considerations”h]”hŒOther considerations”…””}”(hjMh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjJh²hh³hÊh´KUubhÌ)”}”(hŒ¤Special care should be taken when using tagged pointers, since it is likely that C compilers will not hazard two virtual addresses differing only in the upper byte.”h]”hŒ¤Special care should be taken when using tagged pointers, since it is likely that C compilers will not hazard two virtual addresses differing only in the upper byte.”…””}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KWhjJh²hubeh}”(h]”Œother-considerations”ah ]”h"]”Œother considerations”ah$]”h&]”uh1hµhh·h²hh³hÊh´KUubeh}”(h]”Œ)tagged-virtual-addresses-in-aarch64-linux”ah ]”h"]”Œ)tagged virtual addresses in aarch64 linux”ah$]”h&]”uh1hµhhh²hh³hÊh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÊuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hºNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jœŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÊŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jvjsjÚj×jGjDjnjkuŒ nametypes”}”(jv‰jÚ‰jG‰jn‰uh}”(jsh·j×jjDjÝjkjJuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.