sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget+/translations/zh_CN/virt/kvm/x86/hypercallsmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget+/translations/zh_TW/virt/kvm/x86/hypercallsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget+/translations/it_IT/virt/kvm/x86/hypercallsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget+/translations/ja_JP/virt/kvm/x86/hypercallsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget+/translations/ko_KR/virt/kvm/x86/hypercallsmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget+/translations/sp_SP/virt/kvm/x86/hypercallsmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhE/var/lib/git/docbuild/linux/Documentation/virt/kvm/x86/hypercalls.rsthKubhsection)}(hhh](htitle)}(hLinux KVM Hypercallh]hLinux KVM Hypercall}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubhdefinition_list)}(hhh](hdefinition_list_item)}(hXX86: KVM Hypercalls have a three-byte sequence of either the vmcall or the vmmcall instruction. The hypervisor can replace it with instructions that are guaranteed to be supported. Up to four arguments may be passed in rbx, rcx, rdx, and rsi respectively. The hypercall number should be placed in rax and the return value will be placed in rax. No other registers will be clobbered unless explicitly stated by the particular hypercall. h](hterm)}(hX86:h]hX86:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubh definition)}(hhh](h paragraph)}(hKVM Hypercalls have a three-byte sequence of either the vmcall or the vmmcall instruction. The hypervisor can replace it with instructions that are guaranteed to be supported.h]hKVM Hypercalls have a three-byte sequence of either the vmcall or the vmmcall instruction. The hypervisor can replace it with instructions that are guaranteed to be supported.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhubh)}(hUp to four arguments may be passed in rbx, rcx, rdx, and rsi respectively. The hypercall number should be placed in rax and the return value will be placed in rax. No other registers will be clobbered unless explicitly stated by the particular hypercall.h]hUp to four arguments may be passed in rbx, rcx, rdx, and rsi respectively. The hypercall number should be placed in rax and the return value will be placed in rax. No other registers will be clobbered unless explicitly stated by the particular hypercall.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhubeh}(h]h ]h"]h$]h&]uh1hhhubeh}(h]h ]h"]h$]h&]uh1hhhhKhhubh)}(hXNS390: R2-R7 are used for parameters 1-6. In addition, R1 is used for hypercall number. The return value is written to R2. S390 uses diagnose instruction as hypercall (0x500) along with hypercall number in R1. For further information on the S390 diagnose call as supported by KVM, refer to Documentation/virt/kvm/s390/s390-diag.rst. h](h)}(hS390:h]hS390:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hhh](h)}(hsR2-R7 are used for parameters 1-6. In addition, R1 is used for hypercall number. The return value is written to R2.h]hsR2-R7 are used for parameters 1-6. In addition, R1 is used for hypercall number. The return value is written to R2.}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj%ubh)}(hVS390 uses diagnose instruction as hypercall (0x500) along with hypercall number in R1.h]hVS390 uses diagnose instruction as hypercall (0x500) along with hypercall number in R1.}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj%ubh)}(hzFor further information on the S390 diagnose call as supported by KVM, refer to Documentation/virt/kvm/s390/s390-diag.rst.h]hzFor further information on the S390 diagnose call as supported by KVM, refer to Documentation/virt/kvm/s390/s390-diag.rst.}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj%ubeh}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hX?PowerPC: It uses R3-R10 and hypercall number in R11. R4-R11 are used as output registers. Return value is placed in R3. KVM hypercalls uses 4 byte opcode, that are patched with 'hypercall-instructions' property inside the device tree's /hypervisor node. For more information refer to Documentation/virt/kvm/ppc-pv.rst h](h)}(hPowerPC:h]hPowerPC:}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hj^ubh)}(hhh](h)}(hnIt uses R3-R10 and hypercall number in R11. R4-R11 are used as output registers. Return value is placed in R3.h]hnIt uses R3-R10 and hypercall number in R11. R4-R11 are used as output registers. Return value is placed in R3.}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjpubh)}(hKVM hypercalls uses 4 byte opcode, that are patched with 'hypercall-instructions' property inside the device tree's /hypervisor node. For more information refer to Documentation/virt/kvm/ppc-pv.rsth]hKVM hypercalls uses 4 byte opcode, that are patched with ‘hypercall-instructions’ property inside the device tree’s /hypervisor node. For more information refer to Documentation/virt/kvm/ppc-pv.rst}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjpubeh}(h]h ]h"]h$]h&]uh1hhj^ubeh}(h]h ]h"]h$]h&]uh1hhhhK!hhhhubh)}(hMIPS: KVM hypercalls use the HYPCALL instruction with code 0 and the hypercall number in $2 (v0). Up to four arguments may be placed in $4-$7 (a0-a3) and the return value is placed in $2 (v0). h](h)}(hMIPS:h]hMIPS:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hjubh)}(hhh]h)}(hKVM hypercalls use the HYPCALL instruction with code 0 and the hypercall number in $2 (v0). Up to four arguments may be placed in $4-$7 (a0-a3) and the return value is placed in $2 (v0).h]hKVM hypercalls use the HYPCALL instruction with code 0 and the hypercall number in $2 (v0). Up to four arguments may be placed in $4-$7 (a0-a3) and the return value is placed in $2 (v0).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK$hjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhK&hhhhubeh}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hhh](h)}(hKVM Hypercalls Documentationh]hKVM Hypercalls Documentation}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK)ubh)}(h}The template for each hypercall is: 1. Hypercall name. 2. Architecture(s) 3. Status (deprecated, obsolete, active) 4. Purposeh]h}The template for each hypercall is: 1. Hypercall name. 2. Architecture(s) 3. Status (deprecated, obsolete, active) 4. Purpose}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hjhhubh)}(hhh](h)}(h1. KVM_HC_VAPIC_POLL_IRQh]h1. KVM_HC_VAPIC_POLL_IRQ}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK2ubh field_list)}(hhh](hfield)}(hhh](h field_name)}(h Architectureh]h Architecture}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hjhhhKubh field_body)}(hx86h]h)}(hjh]hx86}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK4hjhhubj)}(hhh](j )}(hStatush]hStatus}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj9hhhKubj)}(hactiveh]h)}(hjLh]hactive}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK5hjJubah}(h]h ]h"]h$]h&]uh1jhj9ubeh}(h]h ]h"]h$]h&]uh1jhhhK5hjhhubj)}(hhh](j )}(hPurposeh]hPurpose}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjghhhKubj)}(hQTrigger guest exit so that the host can check for pending interrupts on reentry. h]h)}(hPTrigger guest exit so that the host can check for pending interrupts on reentry.h]hPTrigger guest exit so that the host can check for pending interrupts on reentry.}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjxubah}(h]h ]h"]h$]h&]uh1jhjgubeh}(h]h ]h"]h$]h&]uh1jhhhK6hjhhubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhK4ubeh}(h]kvm-hc-vapic-poll-irqah ]h"]1. kvm_hc_vapic_poll_irqah$]h&]uh1hhjhhhhhK2ubh)}(hhh](h)}(h2. KVM_HC_MMU_OPh]h2. KVM_HC_MMU_OP}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK:ubj)}(hhh](j)}(hhh](j )}(h Architectureh]h Architecture}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j hjhhhKubj)}(hx86h]h)}(hjh]hx86}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj%ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhK>hjhhubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhKRequest KVM to map a GPA range with the specified attributes. h]h)}(h=Request KVM to map a GPA range with the specified attributes.h]h=Request KVM to map a GPA range with the specified attributes.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhKhj_ hhubeh}(h]h ]h"]h$]h&]uh1jhjN hhhhhKubh)}(ha0: the guest physical address of the start page a1: the number of (4kb) pages (must be contiguous in GPA space) a2: attributesh]ha0: the guest physical address of the start page a1: the number of (4kb) pages (must be contiguous in GPA space) a2: attributes}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjN hhubjV)}(hWhere 'attributes' : * bits 3:0 - preferred page size encoding 0 = 4kb, 1 = 2mb, 2 = 1gb, etc... * bit 4 - plaintext = 0, encrypted = 1 * bits 63:5 - reserved (must be zero) h]h)}(hhh]h)}(hWhere 'attributes' : * bits 3:0 - preferred page size encoding 0 = 4kb, 1 = 2mb, 2 = 1gb, etc... * bit 4 - plaintext = 0, encrypted = 1 * bits 63:5 - reserved (must be zero) h](h)}(hWhere 'attributes' :h]hWhere ‘attributes’ :}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubh)}(hhh]j)}(hhh](j)}(hJbits 3:0 - preferred page size encoding 0 = 4kb, 1 = 2mb, 2 = 1gb, etc...h]h)}(hj" h]hJbits 3:0 - preferred page size encoding 0 = 4kb, 1 = 2mb, 2 = 1gb, etc...}(hj$ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(h(bit 4 - plaintext = 0, encrypted = 1h]h)}(hj9 h]h(bit 4 - plaintext = 0, encrypted = 1}(hj; hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj7 ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(h$bits 63:5 - reserved (must be zero) h]h)}(h#bits 63:5 - reserved (must be zero)h]h#bits 63:5 - reserved (must be zero)}(hjR hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjN ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]jjuh1jhhhKhj ubah}(h]h ]h"]h$]h&]uh1hhj ubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1jUhhhKhjN hhubh)}(hXt**Implementation note**: this hypercall is implemented in userspace via the KVM_CAP_EXIT_HYPERCALL capability. Userspace must enable that capability before advertising KVM_FEATURE_HC_MAP_GPA_RANGE in the guest CPUID. In addition, if the guest supports KVM_FEATURE_MIGRATION_CONTROL, userspace must also set up an MSR filter to process writes to MSR_KVM_MIGRATION_CONTROL.h](hstrong)}(h**Implementation note**h]hImplementation note}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1j hj ubhX]: this hypercall is implemented in userspace via the KVM_CAP_EXIT_HYPERCALL capability. Userspace must enable that capability before advertising KVM_FEATURE_HC_MAP_GPA_RANGE in the guest CPUID. In addition, if the guest supports KVM_FEATURE_MIGRATION_CONTROL, userspace must also set up an MSR filter to process writes to MSR_KVM_MIGRATION_CONTROL.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjN hhubeh}(h]kvm-hc-map-gpa-rangeah ]h"]8. kvm_hc_map_gpa_rangeah$]h&]uh1hhjhhhhhKubeh}(h]kvm-hypercalls-documentationah ]h"]kvm hypercalls documentationah$]h&]uh1hhhhhhhhK)ubeh}(h]linux-kvm-hypercallah ]h"]linux kvm hypercallah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(j j j j jjjNjKjjjjjjj(j%jXjUjK jH j j u nametypes}(j j jjNjjjj(jXjK j uh}(j hj jjjjKjjjQjjjjj%jjUj+jH j[j jN u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.