€•—WŒ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”Œ3/translations/zh_CN/userspace-api/accelerators/ocxl”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ3/translations/zh_TW/userspace-api/accelerators/ocxl”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ3/translations/it_IT/userspace-api/accelerators/ocxl”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ3/translations/ja_JP/userspace-api/accelerators/ocxl”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ3/translations/ko_KR/userspace-api/accelerators/ocxl”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ3/translations/pt_BR/userspace-api/accelerators/ocxl”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ3/translations/sp_SP/userspace-api/accelerators/ocxl”Œ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Œ8OpenCAPI (Open Coherent Accelerator Processor Interface)”h]”hŒ8OpenCAPI (Open Coherent Accelerator Processor Interface)”…””}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒM/var/lib/git/docbuild/linux/Documentation/userspace-api/accelerators/ocxl.rst”h´KubhŒ paragraph”“”)”}”(hŒnOpenCAPI is an interface between processors and accelerators. It aims at being low-latency and high-bandwidth.”h]”hŒnOpenCAPI is an interface between processors and accelerators. It aims at being low-latency and high-bandwidth.”…””}”(hhÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)”}”(hŒÇThe specification was developed by the OpenCAPI Consortium, and is now available from the `Compute Express Link Consortium `_.”h]”(hŒZThe specification was developed by the OpenCAPI Consortium, and is now available from the ”…””}”(hhÛh²hh³Nh´NubhŒ reference”“”)”}”(hŒl`Compute Express Link Consortium `_”h]”hŒCompute Express Link Consortium”…””}”(hhåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”ŒCompute Express Link Consortium”Œrefuri”ŒGhttps://computeexpresslink.org/resource/opencapi-specification-archive/”uh1hãhhÛubhŒtarget”“”)”}”(hŒJ ”h]”h}”(h]”Œcompute-express-link-consortium”ah ]”h"]”Œcompute express link consortium”ah$]”h&]”Œrefuri”höuh1h÷Œ referenced”KhhÛubhŒ.”…””}”(hhÛh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubhÌ)”}”(hŒÑIt allows an accelerator (which could be an FPGA, ASICs, ...) to access the host memory coherently, using virtual addresses. An OpenCAPI device can also host its own memory, that can be accessed from the host.”h]”hŒÑIt allows an accelerator (which could be an FPGA, ASICs, ...) to access the host memory coherently, using virtual addresses. An OpenCAPI device can also host its own memory, that can be accessed from the host.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hh·h²hubhÌ)”}”(hŒ×OpenCAPI is known in linux as 'ocxl', as the open, processor-agnostic evolution of 'cxl' (the driver for the IBM CAPI interface for powerpc), which was named that way to avoid confusion with the ISDN CAPI subsystem.”h]”hŒßOpenCAPI is known in linux as ‘ocxl’, as the open, processor-agnostic evolution of ‘cxl’ (the driver for the IBM CAPI interface for powerpc), which was named that way to avoid confusion with the ISDN CAPI subsystem.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khh·h²hubh¶)”}”(hhh]”(h»)”}”(hŒHigh-level view”h]”hŒHigh-level view”…””}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj-h²hh³hÊh´KubhÌ)”}”(hŒ½OpenCAPI defines a Data Link Layer (DL) and Transaction Layer (TL), to be implemented on top of a physical link. Any processor or device implementing the DL and TL can start sharing memory.”h]”hŒ½OpenCAPI defines a Data Link Layer (DL) and Transaction Layer (TL), to be implemented on top of a physical link. Any processor or device implementing the DL and TL can start sharing memory.”…””}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Khj-h²hubhŒ literal_block”“”)”}”(hX+-----------+ +-------------+ | | | | | | | Accelerated | | Processor | | Function | | | +--------+ | Unit | +--------+ | |--| Memory | | (AFU) |--| Memory | | | +--------+ | | +--------+ +-----------+ +-------------+ | | +-----------+ +-------------+ | TL | | TLX | +-----------+ +-------------+ | | +-----------+ +-------------+ | DL | | DLX | +-----------+ +-------------+ | | | PHY | +---------------------------------------+”h]”hX+-----------+ +-------------+ | | | | | | | Accelerated | | Processor | | Function | | | +--------+ | Unit | +--------+ | |--| Memory | | (AFU) |--| Memory | | | +--------+ | | +--------+ +-----------+ +-------------+ | | +-----------+ +-------------+ | TL | | TLX | +-----------+ +-------------+ | | +-----------+ +-------------+ | DL | | DLX | +-----------+ +-------------+ | | | PHY | +---------------------------------------+”…””}”hjNsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1jLh³hÊh´K hj-h²hubeh}”(h]”Œhigh-level-view”ah ]”h"]”Œhigh-level view”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒDevice discovery”h]”hŒDevice discovery”…””}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjfh²hh³hÊh´K7ubhÌ)”}”(hŒ‰OpenCAPI relies on a PCI-like configuration space, implemented on the device. So the host can discover AFUs by querying the config space.”h]”hŒ‰OpenCAPI relies on a PCI-like configuration space, implemented on the device. So the host can discover AFUs by querying the config space.”…””}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K9hjfh²hubhÌ)”}”(hXiOpenCAPI devices in Linux are treated like PCI devices (with a few caveats). The firmware is expected to abstract the hardware as if it was a PCI link. A lot of the existing PCI infrastructure is reused: devices are scanned and BARs are assigned during the standard PCI enumeration. Commands like 'lspci' can therefore be used to see what devices are available.”h]”hXmOpenCAPI devices in Linux are treated like PCI devices (with a few caveats). The firmware is expected to abstract the hardware as if it was a PCI link. A lot of the existing PCI infrastructure is reused: devices are scanned and BARs are assigned during the standard PCI enumeration. Commands like ‘lspci’ can therefore be used to see what devices are available.”…””}”(hj…h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K..”h]”hŒaChar devices can be found in /dev/ocxl/ and are named as: /dev/ocxl/..”…””}”(hjbh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KhhjCh²hubhÌ)”}”(hXYwhere is a max 20-character long name, as found in the config space of the AFU. is added by the driver and can help distinguish devices when a system has more than one instance of the same OpenCAPI device. is also to help distinguish AFUs in the unlikely case where a device carries multiple copies of the same AFU.”h]”hXYwhere is a max 20-character long name, as found in the config space of the AFU. is added by the driver and can help distinguish devices when a system has more than one instance of the same OpenCAPI device. is also to help distinguish AFUs in the unlikely case where a device carries multiple copies of the same AFU.”…””}”(hjph²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KkhjCh²hubeh}”(h]”Œ char-devices”ah ]”h"]”Œ char devices”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kaubh¶)”}”(hhh]”(h»)”}”(hŒ Sysfs class”h]”hŒ Sysfs class”…””}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj†h²hh³hÊh´KuubhÌ)”}”(hŒ˜An ocxl class is added for the devices representing the AFUs. See /sys/class/ocxl. The layout is described in Documentation/ABI/testing/sysfs-class-ocxl”h]”hŒ˜An ocxl class is added for the devices representing the AFUs. See /sys/class/ocxl. The layout is described in Documentation/ABI/testing/sysfs-class-ocxl”…””}”(hj—h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kwhj†h²hubeh}”(h]”Œ sysfs-class”ah ]”h"]”Œ sysfs class”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kuubh¶)”}”(hhh]”(h»)”}”(hŒUser API”h]”hŒUser API”…””}”(hj°h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj­h²hh³hÊh´K~ubh¶)”}”(hhh]”(h»)”}”(hŒopen”h]”hŒopen”…””}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj¾h²hh³hÊh´KubhÌ)”}”(hŒÒBased on the AFU definition found in the config space, an AFU may support working with more than one memory context, in which case the associated char device may be opened multiple times by different processes.”h]”hŒÒBased on the AFU definition found in the config space, an AFU may support working with more than one memory context, in which case the associated char device may be opened multiple times by different processes.”…””}”(hjÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kƒhj¾h²hubeh}”(h]”Œopen”ah ]”h"]”Œopen”ah$]”h&]”uh1hµhj­h²hh³hÊh´Kubh¶)”}”(hhh]”(h»)”}”(hŒioctl”h]”hŒioctl”…””}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjåh²hh³hÊh´KŠubhÌ)”}”(hŒOCXL_IOCTL_ATTACH:”h]”hŒOCXL_IOCTL_ATTACH:”…””}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KŒhjåh²hubhŒ block_quote”“”)”}”(hŒcAttach the memory context of the calling process to the AFU so that the AFU can access its memory. ”h]”hÌ)”}”(hŒbAttach the memory context of the calling process to the AFU so that the AFU can access its memory.”h]”hŒbAttach the memory context of the calling process to the AFU so that the AFU can access its memory.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´KŽhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´KŽhjåh²hubhÌ)”}”(hŒOCXL_IOCTL_IRQ_ALLOC:”h]”hŒOCXL_IOCTL_IRQ_ALLOC:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K‘hjåh²hubj)”}”(hŒ4Allocate an AFU interrupt and return an identifier. ”h]”hÌ)”}”(hŒ3Allocate an AFU interrupt and return an identifier.”h]”hŒ3Allocate an AFU interrupt and return an identifier.”…””}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K“hj,ubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K“hjåh²hubhÌ)”}”(hŒOCXL_IOCTL_IRQ_FREE:”h]”hŒOCXL_IOCTL_IRQ_FREE:”…””}”(hjDh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K•hjåh²hubj)”}”(hŒ+Free a previously allocated AFU interrupt. ”h]”hÌ)”}”(hŒ*Free a previously allocated AFU interrupt.”h]”hŒ*Free a previously allocated AFU interrupt.”…””}”(hjVh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K—hjRubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K—hjåh²hubhÌ)”}”(hŒOCXL_IOCTL_IRQ_SET_FD:”h]”hŒOCXL_IOCTL_IRQ_SET_FD:”…””}”(hjjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K™hjåh²hubj)”}”(hŒtAssociate an event fd to an AFU interrupt so that the user process can be notified when the AFU sends an interrupt. ”h]”hÌ)”}”(hŒsAssociate an event fd to an AFU interrupt so that the user process can be notified when the AFU sends an interrupt.”h]”hŒsAssociate an event fd to an AFU interrupt so that the user process can be notified when the AFU sends an interrupt.”…””}”(hj|h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K›hjxubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K›hjåh²hubhÌ)”}”(hŒOCXL_IOCTL_GET_METADATA:”h]”hŒOCXL_IOCTL_GET_METADATA:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´Kžhjåh²hubj)”}”(hŒ‰Obtains configuration information from the card, such at the size of MMIO areas, the AFU version, and the PASID for the current context. ”h]”hÌ)”}”(hŒˆObtains configuration information from the card, such at the size of MMIO areas, the AFU version, and the PASID for the current context.”h]”hŒˆObtains configuration information from the card, such at the size of MMIO areas, the AFU version, and the PASID for the current context.”…””}”(hj¢h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K hjžubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K hjåh²hubhÌ)”}”(hŒOCXL_IOCTL_ENABLE_P9_WAIT:”h]”hŒOCXL_IOCTL_ENABLE_P9_WAIT:”…””}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K£hjåh²hubj)”}”(hŒ«Allows the AFU to wake a userspace thread executing 'wait'. Returns information to userspace to allow it to configure the AFU. Note that this is only available on POWER9. ”h]”hÌ)”}”(hŒªAllows the AFU to wake a userspace thread executing 'wait'. Returns information to userspace to allow it to configure the AFU. Note that this is only available on POWER9.”h]”hŒ®Allows the AFU to wake a userspace thread executing ‘wait’. Returns information to userspace to allow it to configure the AFU. Note that this is only available on POWER9.”…””}”(hjÈh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K¥hjÄubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K¥hjåh²hubhÌ)”}”(hŒOCXL_IOCTL_GET_FEATURES:”h]”hŒOCXL_IOCTL_GET_FEATURES:”…””}”(hjÜh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K©hjåh²hubj)”}”(hŒOReports on which CPU features that affect OpenCAPI are usable from userspace. ”h]”hÌ)”}”(hŒMReports on which CPU features that affect OpenCAPI are usable from userspace.”h]”hŒMReports on which CPU features that affect OpenCAPI are usable from userspace.”…””}”(hjîh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K«hjêubah}”(h]”h ]”h"]”h$]”h&]”uh1jh³hÊh´K«hjåh²hubeh}”(h]”Œioctl”ah ]”h"]”Œioctl”ah$]”h&]”uh1hµhj­h²hh³hÊh´KŠubh¶)”}”(hhh]”(h»)”}”(hŒmmap”h]”hŒmmap”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj h²hh³hÊh´K°ubhÌ)”}”(hŒKA process can mmap the per-process MMIO area for interactions with the AFU.”h]”hŒKA process can mmap the per-process MMIO area for interactions with the AFU.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hËh³hÊh´K²hj h²hubeh}”(h]”Œmmap”ah ]”h"]”Œmmap”ah$]”h&]”uh1hµhj­h²hh³hÊh´K°ubeh}”(h]”Œuser-api”ah ]”h"]”Œuser api”ah$]”h&]”uh1hµhh·h²hh³hÊh´K~ubeh}”(h]”Œ6opencapi-open-coherent-accelerator-processor-interface”ah ]”h"]”Œ8opencapi (open coherent accelerator processor interface)”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”jdŒ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;jhÿjcj`j¦j£j jj@j=jƒj€jªj§j6j3jâjßjjj.j+uŒ nametypes”}”(j>‰jˆjc‰j¦‰j ‰j@‰jƒ‰jª‰j6‰jâ‰j‰j.‰uh}”(j;h·hÿhùj`j-j£jfjj©j=jj€jCj§j†j3j­jßj¾jjåj+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”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.