€•¸.Œ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/bpf/clang-notes”Œ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/bpf/clang-notes”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ#/translations/it_IT/bpf/clang-notes”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ#/translations/ja_JP/bpf/clang-notes”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ#/translations/ko_KR/bpf/clang-notes”Œ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/bpf/clang-notes”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒtopic”“”)”}”(hŒ Contents ”h]”(hŒtitle”“”)”}”(hŒContents”h]”hŒContents”…””}”(hh©hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h§hh£hŸŒ=/var/lib/git/docbuild/linux/Documentation/bpf/clang-notes.rst”h KubhŒ bullet_list”“”)”}”(hhh]”hŒ list_item”“”)”}”(hhh]”(hŒ paragraph”“”)”}”(hhh]”hŒ reference”“”)”}”(hhh]”(hŒ generated”“”)”}”(hhh]”hŒ1   ”…””}”(hhÎhžhhŸNh Nubah}”(h]”h ]”Œsectnum”ah"]”h$]”h&]”uh1hÌhŸNh NhhÉubhŒClang implementation notes”…””}”(hhÉhžhhŸNh Nubeh}”(h]”Œid1”ah ]”h"]”h$]”h&]”Œrefid”Œclang-implementation-notes”uh1hÇhhÄubah}”(h]”h ]”h"]”h$]”h&]”uh1hÂhh¿ubh¹)”}”(hhh]”(h¾)”}”(hhh]”hÃ)”}”(hhh]”hÈ)”}”(hhh]”(hÍ)”}”(hhh]”hŒ 1.1   ”…””}”(hhûhžhhŸNh Nubah}”(h]”h ]”hØah"]”h$]”h&]”uh1hÌhŸNh NhhøubhŒVersions”…””}”(hhøhžhhŸNh Nubeh}”(h]”Œid2”ah ]”h"]”h$]”h&]”Œrefid”Œversions”uh1hÇhhõubah}”(h]”h ]”h"]”h$]”h&]”uh1hÂhhòubah}”(h]”h ]”h"]”h$]”h&]”uh1h½hhïubh¾)”}”(hhh]”hÃ)”}”(hhh]”hÈ)”}”(hhh]”(hÍ)”}”(hhh]”hŒ 1.2   ”…””}”(hj*hžhhŸNh Nubah}”(h]”h ]”hØah"]”h$]”h&]”uh1hÌhŸNh Nhj'ubhŒArithmetic instructions”…””}”(hj'hžhhŸNh Nubeh}”(h]”Œid3”ah ]”h"]”h$]”h&]”Œrefid”Œarithmetic-instructions”uh1hÇhj$ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÂhj!ubah}”(h]”h ]”h"]”h$]”h&]”uh1h½hhïubh¾)”}”(hhh]”hÃ)”}”(hhh]”hÈ)”}”(hhh]”(hÍ)”}”(hhh]”hŒ 1.3   ”…””}”(hjYhžhhŸNh Nubah}”(h]”h ]”hØah"]”h$]”h&]”uh1hÌhŸNh NhjVubhŒJump instructions”…””}”(hjVhžhhŸNh Nubeh}”(h]”Œid4”ah ]”h"]”h$]”h&]”Œrefid”Œjump-instructions”uh1hÇhjSubah}”(h]”h ]”h"]”h$]”h&]”uh1hÂhjPubah}”(h]”h ]”h"]”h$]”h&]”uh1h½hhïubh¾)”}”(hhh]”hÃ)”}”(hhh]”hÈ)”}”(hhh]”(hÍ)”}”(hhh]”hŒ 1.4   ”…””}”(hjˆhžhhŸNh Nubah}”(h]”h ]”hØah"]”h$]”h&]”uh1hÌhŸNh Nhj…ubhŒAtomic operations”…””}”(hj…hžhhŸNh Nubeh}”(h]”Œid5”ah ]”h"]”h$]”h&]”Œrefid”Œatomic-operations”uh1hÇhj‚ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÂhjubah}”(h]”h ]”h"]”h$]”h&]”uh1h½hhïubeh}”(h]”h ]”Œauto-toc”ah"]”h$]”h&]”uh1h¸hh¿ubeh}”(h]”h ]”h"]”h$]”h&]”uh1h½hhºubah}”(h]”h ]”j±ah"]”h$]”h&]”uh1h¸hh£hžhhŸNh Nubeh}”(h]”Œcontents”ah ]”Œcontents”ah"]”Œcontents”ah$]”h&]”uh1h¡hŸh·h KhhhžhubhŒsection”“”)”}”(hhh]”(h¨)”}”(hŒClang implementation notes”h]”(hÍ)”}”(hhh]”hŒ1   ”…””}”(hjÓhžhhŸNh Nubah}”(h]”h ]”hØah"]”h$]”h&]”uh1hÌhjÏhžhhŸNh NubhŒClang implementation notes”…””}”(hjÏhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”Œauto”KŒrefid”hâuh1h§hjÌhžhhŸh·h KubhÃ)”}”(hŒjThis document provides more details specific to the Clang/LLVM implementation of the eBPF instruction set.”h]”hŒjThis document provides more details specific to the Clang/LLVM implementation of the eBPF instruction set.”…””}”(hjìhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÂhŸh·h KhjÌhžhubjË)”}”(hhh]”(h¨)”}”(hŒVersions”h]”(hÍ)”}”(hhh]”hŒ 1.1   ”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”hØah"]”h$]”h&]”uh1hÌhjýhžhhŸNh NubhŒVersions”…””}”(hjýhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”jêKjëjuh1h§hjúhžhhŸh·h K ubhÃ)”}”(hŒ[Clang defined "CPU" versions, where a CPU version of 3 corresponds to the current eBPF ISA.”h]”hŒ_Clang defined “CPU†versions, where a CPU version of 3 corresponds to the current eBPF ISA.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÂhŸh·h K hjúhžhubhÃ)”}”(hŒYClang can select the eBPF ISA version using ``-mcpu=v3`` for example to select version 3.”h]”(hŒ,Clang can select the eBPF ISA version using ”…””}”(hj&hžhhŸNh NubhŒliteral”“”)”}”(hŒ ``-mcpu=v3``”h]”hŒ-mcpu=v3”…””}”(hj0hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j.hj&ubhŒ! for example to select version 3.”…””}”(hj&hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÂhŸh·h Khjúhžhubeh}”(h]”jah ]”h"]”Œversions”ah$]”h&]”uh1jÊhjÌhžhhŸh·h K ubjË)”}”(hhh]”(h¨)”}”(hŒArithmetic instructions”h]”(hÍ)”}”(hhh]”hŒ 1.2   ”…””}”(hjVhžhhŸNh Nubah}”(h]”h ]”hØah"]”h$]”h&]”uh1hÌhjRhžhhŸNh NubhŒArithmetic instructions”…””}”(hjRhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”jêKjëj=uh1h§hjOhžhhŸh·h KubhÃ)”}”(hŒ·For CPU versions prior to 3, Clang v7.0 and later can enable ``BPF_ALU`` support with ``-Xclang -target-feature -Xclang +alu32``. In CPU version 3, support is automatically included.”h]”(hŒ=For CPU versions prior to 3, Clang v7.0 and later can enable ”…””}”(hjmhžhhŸNh Nubj/)”}”(hŒ ``BPF_ALU``”h]”hŒBPF_ALU”…””}”(hjuhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j.hjmubhŒ support with ”…””}”(hjmhžhhŸNh Nubj/)”}”(hŒ*``-Xclang -target-feature -Xclang +alu32``”h]”hŒ&-Xclang -target-feature -Xclang +alu32”…””}”(hj‡hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j.hjmubhŒ7. In CPU version 3, support is automatically included.”…””}”(hjmhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÂhŸh·h KhjOhžhubeh}”(h]”jCah ]”h"]”Œarithmetic instructions”ah$]”h&]”uh1jÊhjÌhžhhŸh·h KubjË)”}”(hhh]”(h¨)”}”(hŒJump instructions”h]”(hÍ)”}”(hhh]”hŒ 1.3   ”…””}”(hj­hžhhŸNh Nubah}”(h]”h ]”hØah"]”h$]”h&]”uh1hÌhj©hžhhŸNh NubhŒJump instructions”…””}”(hj©hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”jêKjëjluh1h§hj¦hžhhŸh·h KubhÃ)”}”(hŒ“If ``-O0`` is used, Clang will generate the ``BPF_CALL | BPF_X | BPF_JMP`` (0x8d) instruction, which is not supported by the Linux kernel verifier.”h]”(hŒIf ”…””}”(hjÄhžhhŸNh Nubj/)”}”(hŒ``-O0``”h]”hŒ-O0”…””}”(hjÌhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j.hjÄubhŒ" is used, Clang will generate the ”…””}”(hjÄhžhhŸNh Nubj/)”}”(hŒ``BPF_CALL | BPF_X | BPF_JMP``”h]”hŒBPF_CALL | BPF_X | BPF_JMP”…””}”(hjÞhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j.hjÄubhŒI (0x8d) instruction, which is not supported by the Linux kernel verifier.”…””}”(hjÄhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÂhŸh·h Khj¦hžhubeh}”(h]”jrah ]”h"]”Œjump instructions”ah$]”h&]”uh1jÊhjÌhžhhŸh·h KubjË)”}”(hhh]”(h¨)”}”(hŒAtomic operations”h]”(hÍ)”}”(hhh]”hŒ 1.4   ”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”hØah"]”h$]”h&]”uh1hÌhjhžhhŸNh NubhŒAtomic operations”…””}”(hjhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”jêKjëj›uh1h§hjýhžhhŸh·h KubhÃ)”}”(hX\Clang can generate atomic instructions by default when ``-mcpu=v3`` is enabled. If a lower version for ``-mcpu`` is set, the only atomic instruction Clang can generate is ``BPF_ADD`` *without* ``BPF_FETCH``. If you need to enable the atomics features, while keeping a lower ``-mcpu`` version, you can use ``-Xclang -target-feature -Xclang +alu32``.”h]”(hŒ7Clang can generate atomic instructions by default when ”…””}”(hjhžhhŸNh Nubj/)”}”(hŒ ``-mcpu=v3``”h]”hŒ-mcpu=v3”…””}”(hj#hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j.hjubhŒ$ is enabled. If a lower version for ”…””}”(hjhžhhŸNh Nubj/)”}”(hŒ ``-mcpu``”h]”hŒ-mcpu”…””}”(hj5hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j.hjubhŒ; is set, the only atomic instruction Clang can generate is ”…””}”(hjhžhhŸNh Nubj/)”}”(hŒ ``BPF_ADD``”h]”hŒBPF_ADD”…””}”(hjGhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j.hjubhŒ ”…””}”(hjhžhhŸNh NubhŒemphasis”“”)”}”(hŒ *without*”h]”hŒwithout”…””}”(hj[hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jYhjubhŒ ”…””}”hjsbj/)”}”(hŒ ``BPF_FETCH``”h]”hŒ BPF_FETCH”…””}”(hjmhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j.hjubhŒD. If you need to enable the atomics features, while keeping a lower ”…””}”(hjhžhhŸNh Nubj/)”}”(hŒ ``-mcpu``”h]”hŒ-mcpu”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j.hjubhŒ version, you can use ”…””}”(hjhžhhŸNh Nubj/)”}”(hŒ*``-Xclang -target-feature -Xclang +alu32``”h]”hŒ&-Xclang -target-feature -Xclang +alu32”…””}”(hj‘hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j.hjubhŒ.”…””}”(hjhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÂhŸh·h K hjýhžhubeh}”(h]”j¡ah ]”h"]”Œatomic operations”ah$]”h&]”uh1jÊhjÌhžhhŸh·h Kubeh}”(h]”hèah ]”h"]”Œclang implementation notes”ah$]”h&]”uh1jÊ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”}”(jÇjÃj´hèjLjj£jCjújrj­j¡uŒ nametypes”}”(jljj´‰jL‰j£‰jú‰j­‰uh}”(jÃh£hèjÌjjújCjOjrj¦j¡jýhâhÉjhøj=j'jljVj›j…uŒ 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”“”}”jèKs…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.