€•z@Œ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/virt/acrn/io-request”Œ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/virt/acrn/io-request”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/it_IT/virt/acrn/io-request”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/ja_JP/virt/acrn/io-request”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ(/translations/ko_KR/virt/acrn/io-request”Œ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/virt/acrn/io-request”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh£sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1h¡hhhžhhŸŒB/var/lib/git/docbuild/linux/Documentation/virt/acrn/io-request.rst”h KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒI/O request handling”h]”hŒI/O request handling”…””}”(hh»hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hh¶hžhhŸh³h KubhŒ paragraph”“”)”}”(hX An I/O request of a User VM, which is constructed by the hypervisor, is distributed by the ACRN Hypervisor Service Module to an I/O client corresponding to the address range of the I/O request. Details of I/O request handling are described in the following sections.”h]”hX An I/O request of a User VM, which is constructed by the hypervisor, is distributed by the ACRN Hypervisor Service Module to an I/O client corresponding to the address range of the I/O request. Details of I/O request handling are described in the following sections.”…””}”(hhËhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khh¶hžhubhµ)”}”(hhh]”(hº)”}”(hŒ1. I/O request”h]”hŒ1. I/O request”…””}”(hhÜhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hhÙhžhhŸh³h K ubhÊ)”}”(hXKFor each User VM, there is a shared 4-KByte memory region used for I/O requests communication between the hypervisor and Service VM. An I/O request is a 256-byte structure buffer, which is 'struct acrn_io_request', that is filled by an I/O handler of the hypervisor when a trapped I/O access happens in a User VM. ACRN userspace in the Service VM first allocates a 4-KByte page and passes the GPA (Guest Physical Address) of the buffer to the hypervisor. The buffer is used as an array of 16 I/O request slots with each I/O request slot being 256 bytes. This array is indexed by vCPU ID.”h]”hXOFor each User VM, there is a shared 4-KByte memory region used for I/O requests communication between the hypervisor and Service VM. An I/O request is a 256-byte structure buffer, which is ‘struct acrn_io_request’, that is filled by an I/O handler of the hypervisor when a trapped I/O access happens in a User VM. ACRN userspace in the Service VM first allocates a 4-KByte page and passes the GPA (Guest Physical Address) of the buffer to the hypervisor. The buffer is used as an array of 16 I/O request slots with each I/O request slot being 256 bytes. This array is indexed by vCPU ID.”…””}”(hhêhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KhhÙhžhubeh}”(h]”Œ i-o-request”ah ]”h"]”Œ1. i/o request”ah$]”h&]”uh1h´hh¶hžhhŸh³h K ubhµ)”}”(hhh]”(hº)”}”(hŒ2. I/O clients”h]”hŒ2. I/O clients”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjhžhhŸh³h KubhÊ)”}”(hX‹An I/O client is responsible for handling User VM I/O requests whose accessed GPA falls in a certain range. Multiple I/O clients can be associated with each User VM. There is a special client associated with each User VM, called the default client, that handles all I/O requests that do not fit into the range of any other clients. The ACRN userspace acts as the default client for each User VM.”h]”hX‹An I/O client is responsible for handling User VM I/O requests whose accessed GPA falls in a certain range. Multiple I/O clients can be associated with each User VM. There is a special client associated with each User VM, called the default client, that handles all I/O requests that do not fit into the range of any other clients. The ACRN userspace acts as the default client for each User VM.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KhjhžhubhÊ)”}”(hŒkBelow illustration shows the relationship between I/O requests shared buffer, I/O requests and I/O clients.”h]”hŒkBelow illustration shows the relationship between I/O requests shared buffer, I/O requests and I/O clients.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K!hjhžhubhŒ literal_block”“”)”}”(hX +------------------------------------------------------+ | Service VM | |+--------------------------------------------------+ | || +----------------------------------------+ | | || | shared page ACRN userspace | | | || | +-----------------+ +------------+ | | | || +----+->| acrn_io_request |<-+ default | | | | || | | | +-----------------+ | I/O client | | | | || | | | | ... | +------------+ | | | || | | | +-----------------+ | | | || | +-|--------------------------------------+ | | ||---|----|-----------------------------------------| | || | | kernel | | || | | +----------------------+ | | || | | | +-------------+ HSM | | | || | +--------------+ | | | | || | | | I/O clients | | | | || | | | | | | | || | | +-------------+ | | | || | +----------------------+ | | |+---|----------------------------------------------+ | +----|-------------------------------------------------+ | +----|-------------------------------------------------+ | +-+-----------+ | | | I/O handler | ACRN Hypervisor | | +-------------+ | +------------------------------------------------------+”h]”hX +------------------------------------------------------+ | Service VM | |+--------------------------------------------------+ | || +----------------------------------------+ | | || | shared page ACRN userspace | | | || | +-----------------+ +------------+ | | | || +----+->| acrn_io_request |<-+ default | | | | || | | | +-----------------+ | I/O client | | | | || | | | | ... | +------------+ | | | || | | | +-----------------+ | | | || | +-|--------------------------------------+ | | ||---|----|-----------------------------------------| | || | | kernel | | || | | +----------------------+ | | || | | | +-------------+ HSM | | | || | +--------------+ | | | | || | | | I/O clients | | | | || | | | | | | | || | | +-------------+ | | | || | +----------------------+ | | |+---|----------------------------------------------+ | +----|-------------------------------------------------+ | +----|-------------------------------------------------+ | +-+-----------+ | | | I/O handler | ACRN Hypervisor | | +-------------+ | +------------------------------------------------------+”…””}”hj/sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j-hŸh³h K&hjhžhubeh}”(h]”Œ i-o-clients”ah ]”h"]”Œ2. i/o clients”ah$]”h&]”uh1h´hh¶hžhhŸh³h Kubhµ)”}”(hhh]”(hº)”}”(hŒ3. I/O request state transition”h]”hŒ3. I/O request state transition”…””}”(hjHhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjEhžhhŸh³h KDubhÊ)”}”(hŒ PENDING -> PROCESSING -> COMPLETE -> FREE -> ...”h]”hŒ8FREE -> PENDING -> PROCESSING -> COMPLETE -> FREE -> ...”…””}”hjdsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j-hŸh³h KJhjEhžhubhŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒ$FREE: this I/O request slot is empty”h]”hÊ)”}”(hj{h]”hŒ$FREE: this I/O request slot is empty”…””}”(hj}hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KLhjyubah}”(h]”h ]”h"]”h$]”h&]”uh1jwhjthžhhŸh³h Nubjx)”}”(hŒ4PENDING: a valid I/O request is pending in this slot”h]”hÊ)”}”(hj’h]”hŒ4PENDING: a valid I/O request is pending in this slot”…””}”(hj”hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KMhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jwhjthžhhŸh³h Nubjx)”}”(hŒ.PROCESSING: the I/O request is being processed”h]”hÊ)”}”(hj©h]”hŒ.PROCESSING: the I/O request is being processed”…””}”(hj«hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KNhj§ubah}”(h]”h ]”h"]”h$]”h&]”uh1jwhjthžhhŸh³h Nubjx)”}”(hŒ-COMPLETE: the I/O request has been processed ”h]”hÊ)”}”(hŒ,COMPLETE: the I/O request has been processed”h]”hŒ,COMPLETE: the I/O request has been processed”…””}”(hjÂhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KOhj¾ubah}”(h]”h ]”h"]”h$]”h&]”uh1jwhjthžhhŸh³h Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1jrhŸh³h KLhjEhžhubhÊ)”}”(hŒƒAn I/O request in COMPLETE or FREE state is owned by the hypervisor. HSM and ACRN userspace are in charge of processing the others.”h]”hŒƒAn I/O request in COMPLETE or FREE state is owned by the hypervisor. HSM and ACRN userspace are in charge of processing the others.”…””}”(hjÞhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KQhjEhžhubeh}”(h]”Œi-o-request-state-transition”ah ]”h"]”Œ3. i/o request state transition”ah$]”h&]”uh1h´hh¶hžhhŸh³h KDubhµ)”}”(hhh]”(hº)”}”(hŒ"4. Processing flow of I/O requests”h]”hŒ"4. Processing flow of I/O requests”…””}”(hj÷hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjôhžhhŸh³h KUubhŒenumerated_list”“”)”}”(hhh]”(jx)”}”(hŒ}The I/O handler of the hypervisor will fill an I/O request with PENDING state when a trapped I/O access happens in a User VM.”h]”hÊ)”}”(hŒ}The I/O handler of the hypervisor will fill an I/O request with PENDING state when a trapped I/O access happens in a User VM.”h]”hŒ}The I/O handler of the hypervisor will fill an I/O request with PENDING state when a trapped I/O access happens in a User VM.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KWhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jwhjhžhhŸh³h Nubjx)”}”(hŒUThe hypervisor makes an upcall, which is a notification interrupt, to the Service VM.”h]”hÊ)”}”(hŒUThe hypervisor makes an upcall, which is a notification interrupt, to the Service VM.”h]”hŒUThe hypervisor makes an upcall, which is a notification interrupt, to the Service VM.”…””}”(hj&hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h KYhj"ubah}”(h]”h ]”h"]”h$]”h&]”uh1jwhjhžhhŸh³h Nubjx)”}”(hŒ?The upcall handler schedules a worker to dispatch I/O requests.”h]”hÊ)”}”(hj<h]”hŒ?The upcall handler schedules a worker to dispatch I/O requests.”…””}”(hj>hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K[hj:ubah}”(h]”h ]”h"]”h$]”h&]”uh1jwhjhžhhŸh³h Nubjx)”}”(hŒÙThe worker looks for the PENDING I/O requests, assigns them to different registered clients based on the address of the I/O accesses, updates their state to PROCESSING, and notifies the corresponding client to handle.”h]”hÊ)”}”(hŒÙThe worker looks for the PENDING I/O requests, assigns them to different registered clients based on the address of the I/O accesses, updates their state to PROCESSING, and notifies the corresponding client to handle.”h]”hŒÙThe worker looks for the PENDING I/O requests, assigns them to different registered clients based on the address of the I/O accesses, updates their state to PROCESSING, and notifies the corresponding client to handle.”…””}”(hjUhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K\hjQubah}”(h]”h ]”h"]”h$]”h&]”uh1jwhjhžhhŸh³h Nubjx)”}”(hŒ6The notified client handles the assigned I/O requests.”h]”hÊ)”}”(hjkh]”hŒ6The notified client handles the assigned I/O requests.”…””}”(hjmhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K_hjiubah}”(h]”h ]”h"]”h$]”h&]”uh1jwhjhžhhŸh³h Nubjx)”}”(hŒmThe HSM updates I/O requests states to COMPLETE and notifies the hypervisor of the completion via hypercalls.”h]”hÊ)”}”(hŒmThe HSM updates I/O requests states to COMPLETE and notifies the hypervisor of the completion via hypercalls.”h]”hŒmThe HSM updates I/O requests states to COMPLETE and notifies the hypervisor of the completion via hypercalls.”…””}”(hj„hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K`hj€ubah}”(h]”h ]”h"]”h$]”h&]”uh1jwhjhžhhŸh³h Nubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œ loweralpha”Œprefix”hŒsuffix”Œ.”uh1jhjôhžhhŸh³h KWubeh}”(h]”Œprocessing-flow-of-i-o-requests”ah ]”h"]”Œ"4. processing flow of i/o requests”ah$]”h&]”uh1h´hh¶hžhhŸh³h KUubeh}”(h]”Œi-o-request-handling”ah ]”h"]”Œi/o request handling”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”}”(j°j­hýhújBj?jñjîj¨j¥uŒ nametypes”}”(j°‰hý‰jB‰jñ‰j¨‰uh}”(j­h¶húhÙj?jjîjEj¥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.