€•ïıŒ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/hyperv/coco”Œ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/hyperv/coco”Œ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/hyperv/coco”Œ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/hyperv/coco”Œ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/hyperv/coco”Œ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/virt/hyperv/coco”Œ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/hyperv/coco”Œ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³Œ>/var/lib/git/docbuild/linux/Documentation/virt/hyperv/coco.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒConfidential Computing VMs”h]”hŒConfidential Computing VMs”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ paragraph”“”)”}”(hX Hyper-V can create and run Linux guests that are Confidential Computing (CoCo) VMs. Such VMs cooperate with the physical processor to better protect the confidentiality and integrity of data in the VM's memory, even in the face of a hypervisor/VMM that has been compromised and may behave maliciously. CoCo VMs on Hyper-V share the generic CoCo VM threat model and security objectives described in Documentation/security/snp-tdx-threat-model.rst. Note that Hyper-V specific code in Linux refers to CoCo VMs as "isolated VMs" or "isolation VMs".”h]”hX*Hyper-V can create and run Linux guests that are Confidential Computing (CoCo) VMs. Such VMs cooperate with the physical processor to better protect the confidentiality and integrity of data in the VM’s memory, even in the face of a hypervisor/VMM that has been compromised and may behave maliciously. CoCo VMs on Hyper-V share the generic CoCo VM threat model and security objectives described in Documentation/security/snp-tdx-threat-model.rst. Note that Hyper-V specific code in Linux refers to CoCo VMs as “isolated VMs†or “isolation VMsâ€.”…””}”(hhßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´KhhÊh²hubhŞ)”}”(hŒUA Linux CoCo VM on Hyper-V requires the cooperation and interaction of the following:”h]”hŒUA Linux CoCo VM on Hyper-V requires the cooperation and interaction of the following:”…””}”(hhíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´KhhÊh²hubhŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒ:Physical hardware with a processor that supports CoCo VMs ”h]”hŞ)”}”(hŒ9Physical hardware with a processor that supports CoCo VMs”h]”hŒ9Physical hardware with a processor that supports CoCo VMs”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhhıh²hh³hÇh´Nubj)”}”(hŒIThe hardware runs a version of Windows/Hyper-V with support for CoCo VMs ”h]”hŞ)”}”(hŒHThe hardware runs a version of Windows/Hyper-V with support for CoCo VMs”h]”hŒHThe hardware runs a version of Windows/Hyper-V with support for CoCo VMs”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhhıh²hh³hÇh´Nubj)”}”(hŒ=The VM runs a version of Linux that supports being a CoCo VM ”h]”hŞ)”}”(hŒ is a physical one, might be with multiple virtual functions):”…””}”(hjùh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´Mhjyh²hubhŒ literal_block”“”)”}”(hX+---- GUEST ----+ +----- DEVICE ----+ +----- HOST -----+ | | | | | | | | | | | | | | | ========== | | | | | | | | | | | | | | | | | | | +----- C -------+ +-----------------+ +------- S ------+ || || || || +------||------------------ VMBus --------------------------||------+ | Interrupts, MMIO | +-------------------------------------------------------------------+”h]”hX+---- GUEST ----+ +----- DEVICE ----+ +----- HOST -----+ | | | | | | | | | | | | | | | ========== | | | | | | | | | | | | | | | | | | | +----- C -------+ +-----------------+ +------- S ------+ || || || || +------||------------------ VMBus --------------------------||------+ | Interrupts, MMIO | +-------------------------------------------------------------------+”…””}”hjAsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j?h³hÇh´Mhjyh²hubhŞ)”}”(hŒ'and the Confidential VMBus connection::”h]”hŒ&and the Confidential VMBus connection:”…””}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´M'hjyh²hubj@)”}”(hX=+---- GUEST --------------- VTL0 ------+ +-- DEVICE --+ | | | | | +- PARAVISOR --------- VTL2 -----+ | | | | | +-- VMBus Relay ------+ ====+================ | | | | Interrupts, MMIO | | | | | | | +-------- S ----------+ | | +------------+ | | || | | | +---------+ || | | | | Linux | || OpenHCL | | | | kernel | || | | | +---- C --+-----||---------------+ | | || || | +-------++------- C -------------------+ +------------+ || | HOST | || +---- S -----+ +-------||----------------- VMBus ---------------------------||-----+ | Interrupts, MMIO | +-------------------------------------------------------------------+”h]”hX=+---- GUEST --------------- VTL0 ------+ +-- DEVICE --+ | | | | | +- PARAVISOR --------- VTL2 -----+ | | | | | +-- VMBus Relay ------+ ====+================ | | | | Interrupts, MMIO | | | | | | | +-------- S ----------+ | | +------------+ | | || | | | +---------+ || | | | | Linux | || OpenHCL | | | | kernel | || | | | +---- C --+-----||---------------+ | | || || | +-------++------- C -------------------+ +------------+ || | HOST | || +---- S -----+ +-------||----------------- VMBus ---------------------------||-----+ | Interrupts, MMIO | +-------------------------------------------------------------------+”…””}”hj]sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j?h³hÇh´M)hjyh²hubhŞ)”}”(hŒ¨An implementation of the VMBus relay that offers the Confidential VMBus channels is available in the OpenVMM project as a part of the OpenHCL paravisor. Please refer to”h]”hŒ¨An implementation of the VMBus relay that offers the Confidential VMBus channels is available in the OpenVMM project as a part of the OpenHCL paravisor. Please refer to”…””}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´M<hjyh²hubhŒ block_quote”“”)”}”(hŒC* https://openvmm.dev/, and * https://github.com/microsoft/openvmm ”h]”hü)”}”(hhh]”(j)”}”(hŒhttps://openvmm.dev/, and”h]”hŞ)”}”(hj„h]”(j)”}”(hŒhttps://openvmm.dev/”h]”hŒhttps://openvmm.dev/”…””}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j‹uh1jhj†ubhŒ, and”…””}”(hj†h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´M@hj‚ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubj)”}”(hŒ%https://github.com/microsoft/openvmm ”h]”hŞ)”}”(hŒ$https://github.com/microsoft/openvmm”h]”j)”}”(hj®h]”hŒ$https://github.com/microsoft/openvmm”…””}”(hj°h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j®uh1jhj¬ubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´MAhj¨ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjubeh}”(h]”h ]”h"]”h$]”h&]”jPjQuh1hûh³hÇh´M@hj{ubah}”(h]”h ]”h"]”h$]”h&]”uh1jyh³hÇh´M@hjyh²hubhŞ)”}”(hŒ1for more information about the OpenHCL paravisor.”h]”hŒ1for more information about the OpenHCL paravisor.”…””}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´MChjyh²hubhŞ)”}”(hX?A guest that is running with a paravisor must determine at runtime if Confidential VMBus is supported by the current paravisor. The x86_64-specific approach relies on the CPUID Virtualization Stack leaf; the ARM64 implementation is expected to support the Confidential VMBus unconditionally when running ARM CCA guests.”h]”hX?A guest that is running with a paravisor must determine at runtime if Confidential VMBus is supported by the current paravisor. The x86_64-specific approach relies on the CPUID Virtualization Stack leaf; the ARM64 implementation is expected to support the Confidential VMBus unconditionally when running ARM CCA guests.”…””}”(hjäh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´MEhjyh²hubhŞ)”}”(hXConfidential VMBus is a characteristic of the VMBus connection as a whole, and of each VMBus channel that is created. When a Confidential VMBus connection is established, the paravisor provides the guest the message-passing path that is used for VMBus device creation and deletion, and it provides a per-CPU synthetic interrupt controller (SynIC) just like the SynIC that is offered by the Hyper-V host. Each VMBus device that is offered to the guest indicates the degree to which it participates in Confidential VMBus. The offer indicates if the device uses encrypted ring buffers, and if the device uses encrypted memory for DMA that is done outside the ring buffer. These settings may be different for different devices using the same Confidential VMBus connection.”h]”hXConfidential VMBus is a characteristic of the VMBus connection as a whole, and of each VMBus channel that is created. When a Confidential VMBus connection is established, the paravisor provides the guest the message-passing path that is used for VMBus device creation and deletion, and it provides a per-CPU synthetic interrupt controller (SynIC) just like the SynIC that is offered by the Hyper-V host. Each VMBus device that is offered to the guest indicates the degree to which it participates in Confidential VMBus. The offer indicates if the device uses encrypted ring buffers, and if the device uses encrypted memory for DMA that is done outside the ring buffer. These settings may be different for different devices using the same Confidential VMBus connection.”…””}”(hjòh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´MKhjyh²hubhŞ)”}”(hXšAlthough these settings are separate, in practice it'll always be encrypted ring buffer only, or both encrypted ring buffer and external data. If a channel is offered by the paravisor with confidential VMBus, the ring buffer can always be encrypted since it's strictly for communication between the VTL2 paravisor and the VTL0 guest. However, other memory regions are often used for e.g. DMA, so they need to be accessible by the underlying hardware, and must be unencrypted (unless the device supports encrypted memory). Currently, there are not any VSPs in OpenHCL that support encrypted external memory, but future versions are expected to enable this capability.”h]”hXAlthough these settings are separate, in practice it’ll always be encrypted ring buffer only, or both encrypted ring buffer and external data. If a channel is offered by the paravisor with confidential VMBus, the ring buffer can always be encrypted since it’s strictly for communication between the VTL2 paravisor and the VTL0 guest. However, other memory regions are often used for e.g. DMA, so they need to be accessible by the underlying hardware, and must be unencrypted (unless the device supports encrypted memory). Currently, there are not any VSPs in OpenHCL that support encrypted external memory, but future versions are expected to enable this capability.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´MWhjyh²hubhŞ)”}”(hXˆBecause some devices on a Confidential VMBus may require decrypted ring buffers and DMA transfers, the guest must interact with two SynICs -- the one provided by the paravisor and the one provided by the Hyper-V host when Confidential VMBus is not offered. Interrupts are always signaled by the paravisor SynIC, but the guest must check for messages and for channel interrupts on both SynICs.”h]”hXˆBecause some devices on a Confidential VMBus may require decrypted ring buffers and DMA transfers, the guest must interact with two SynICs -- the one provided by the paravisor and the one provided by the Hyper-V host when Confidential VMBus is not offered. Interrupts are always signaled by the paravisor SynIC, but the guest must check for messages and for channel interrupts on both SynICs.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´Mahjyh²hubhŞ)”}”(hXwIn the case of a confidential VMBus, regular SynIC access by the guest is intercepted by the paravisor (this includes various MSRs such as the SIMP and SIEFP, as well as hypercalls like HvPostMessage and HvSignalEvent). If the guest actually wants to communicate with the hypervisor, it has to use special mechanisms (GHCB page on SNP, or tdcall on TDX). Messages can be of either kind: with confidential VMBus, messages use the paravisor SynIC, and if the guest chose to communicate directly to the hypervisor, they use the hypervisor SynIC. For interrupt signaling, some channels may be running on the host (non-confidential, using the VMBus relay) and use the hypervisor SynIC, and some on the paravisor and use its SynIC. The RelIDs are coordinated by the OpenHCL VMBus server and are guaranteed to be unique regardless of whether the channel originated on the host or the paravisor.”h]”hXwIn the case of a confidential VMBus, regular SynIC access by the guest is intercepted by the paravisor (this includes various MSRs such as the SIMP and SIEFP, as well as hypercalls like HvPostMessage and HvSignalEvent). If the guest actually wants to communicate with the hypervisor, it has to use special mechanisms (GHCB page on SNP, or tdcall on TDX). Messages can be of either kind: with confidential VMBus, messages use the paravisor SynIC, and if the guest chose to communicate directly to the hypervisor, they use the hypervisor SynIC. For interrupt signaling, some channels may be running on the host (non-confidential, using the VMBus relay) and use the hypervisor SynIC, and some on the paravisor and use its SynIC. The RelIDs are coordinated by the OpenHCL VMBus server and are guaranteed to be unique regardless of whether the channel originated on the host or the paravisor.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´Mghjyh²hubeh}”(h]”Œconfidential-vmbus”ah ]”h"]”Œconfidential vmbus”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KìubhÉ)”}”(hhh]”(hÎ)”}”(hŒload_unaligned_zeropad()”h]”hŒload_unaligned_zeropad()”…””}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj2h²hh³hÇh´MuubhŞ)”}”(hXèWhen transitioning memory between encrypted and decrypted, the caller of set_memory_encrypted() or set_memory_decrypted() is responsible for ensuring the memory isn't in use and isn't referenced while the transition is in progress. The transition has multiple steps, and includes interaction with the Hyper-V host. The memory is in an inconsistent state until all steps are complete. A reference while the state is inconsistent could result in an exception that can't be cleanly fixed up.”h]”hXîWhen transitioning memory between encrypted and decrypted, the caller of set_memory_encrypted() or set_memory_decrypted() is responsible for ensuring the memory isn’t in use and isn’t referenced while the transition is in progress. The transition has multiple steps, and includes interaction with the Hyper-V host. The memory is in an inconsistent state until all steps are complete. A reference while the state is inconsistent could result in an exception that can’t be cleanly fixed up.”…””}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´Mvhj2h²hubhŞ)”}”(hX1However, the kernel load_unaligned_zeropad() mechanism may make stray references that can't be prevented by the caller of set_memory_encrypted() or set_memory_decrypted(), so there's specific code in the #VC or #VE exception handler to fixup this case. But a CoCo VM running on Hyper-V may be configured to run with a paravisor, with the #VC or #VE exception routed to the paravisor. There's no architectural way to forward the exceptions back to the guest kernel, and in such a case, the load_unaligned_zeropad() fixup code in the #VC/#VE handlers doesn't run.”h]”hX9However, the kernel load_unaligned_zeropad() mechanism may make stray references that can’t be prevented by the caller of set_memory_encrypted() or set_memory_decrypted(), so there’s specific code in the #VC or #VE exception handler to fixup this case. But a CoCo VM running on Hyper-V may be configured to run with a paravisor, with the #VC or #VE exception routed to the paravisor. There’s no architectural way to forward the exceptions back to the guest kernel, and in such a case, the load_unaligned_zeropad() fixup code in the #VC/#VE handlers doesn’t run.”…””}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´M~hj2h²hubhŞ)”}”(hXTo avoid this problem, the Hyper-V specific functions for notifying the hypervisor of the transition mark pages as "not present" while a transition is in progress. If load_unaligned_zeropad() causes a stray reference, a normal page fault is generated instead of #VC or #VE, and the page-fault- based handlers for load_unaligned_zeropad() fixup the reference. When the encrypted/decrypted transition is complete, the pages are marked as "present" again. See hv_vtom_clear_present() and hv_vtom_set_host_visibility().”h]”hX To avoid this problem, the Hyper-V specific functions for notifying the hypervisor of the transition mark pages as “not present†while a transition is in progress. If load_unaligned_zeropad() causes a stray reference, a normal page fault is generated instead of #VC or #VE, and the page-fault- based handlers for load_unaligned_zeropad() fixup the reference. When the encrypted/decrypted transition is complete, the pages are marked as “present†again. See hv_vtom_clear_present() and hv_vtom_set_host_visibility().”…””}”(hj_h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hİh³hÇh´M‡hj2h²hubeh}”(h]”Œload-unaligned-zeropad”ah ]”h"]”Œload_unaligned_zeropad()”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´Muubeh}”(h]”Œconfidential-computing-vms”ah ]”h"]”Œconfidential computing vms”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”}”Œcoconut project”]”jasŒrefids”}”Œnameids”}”(jzjwj«j¨j?j<jkjhj’jjvjsj/j,jrjouŒ nametypes”}”(jz‰j«‰j?ˆjk‰j’‰jv‰j/‰jr‰uh}”(jwhÊj¨j§j<j6jhj®jjnjsj•j,jyjoj2uŒ 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.