€•ŸÛŒ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/kvm/locking”Œ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/kvm/locking”Œ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/kvm/locking”Œ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/kvm/locking”Œ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/kvm/locking”Œ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/kvm/locking”Œ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/kvm/locking”Œ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/kvm/locking.rst”h´KubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒKVM Lock Overview”h]”hŒKVM Lock Overview”…”�”}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ1. Acquisition Orders”h]”hŒ1. Acquisition Orders”…”�”}”(hhàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÝh²hh³hÇh´KubhŒ paragraph”“”)�”}”(hŒ2The acquisition orders for mutexes are as follows:”h]”hŒ2The acquisition orders for mutexes are as follows:”…”�”}”(hhðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K hhÝh²hubhŒ bullet_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hŒ+cpus_read_lock() is taken outside kvm_lock ”h]”hï)�”}”(hŒ*cpus_read_lock() is taken outside kvm_lock”h]”hŒ*cpus_read_lock() is taken outside kvm_lock”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjh²hh³hÇh´Nubj)�”}”(hŒ1kvm_usage_lock is taken outside cpus_read_lock() ”h]”hï)�”}”(hŒ0kvm_usage_lock is taken outside cpus_read_lock()”h]”hŒ0kvm_usage_lock is taken outside cpus_read_lock()”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjh²hh³hÇh´Nubj)�”}”(hŒ'kvm->lock is taken outside vcpu->mutex ”h]”hï)�”}”(hŒ&kvm->lock is taken outside vcpu->mutex”h]”hŒ&kvm->lock is taken outside vcpu->mutex”…”�”}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Khj5ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjh²hh³hÇh´Nubj)�”}”(hŒ=kvm->lock is taken outside kvm->slots_lock and kvm->irq_lock ”h]”hï)�”}”(hŒlock is taken outside kvm->slots_lock and kvm->irq_lock”h]”hŒlock is taken outside kvm->slots_lock and kvm->irq_lock”…”�”}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KhjMubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjh²hh³hÇh´Nubj)�”}”(hŒFvcpu->mutex is taken outside kvm->slots_lock and kvm->slots_arch_lock ”h]”hï)�”}”(hŒEvcpu->mutex is taken outside kvm->slots_lock and kvm->slots_arch_lock”h]”hŒEvcpu->mutex is taken outside kvm->slots_lock and kvm->slots_arch_lock”…”�”}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Khjeubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjh²hh³hÇh´Nubj)�”}”(hŒ^kvm->slots_lock is taken outside kvm->irq_lock, though acquiring them together is quite rare. ”h]”hï)�”}”(hŒ]kvm->slots_lock is taken outside kvm->irq_lock, though acquiring them together is quite rare.”h]”hŒ]kvm->slots_lock is taken outside kvm->irq_lock, though acquiring them together is quite rare.”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Khj}ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjh²hh³hÇh´Nubj)�”}”(hXAkvm->mn_active_invalidate_count ensures that pairs of invalidate_range_start() and invalidate_range_end() callbacks use the same memslots array. kvm->slots_lock and kvm->slots_arch_lock are taken on the waiting side when modifying memslots, so MMU notifiers must not take either kvm->slots_lock or kvm->slots_arch_lock. ”h]”hï)�”}”(hX@kvm->mn_active_invalidate_count ensures that pairs of invalidate_range_start() and invalidate_range_end() callbacks use the same memslots array. kvm->slots_lock and kvm->slots_arch_lock are taken on the waiting side when modifying memslots, so MMU notifiers must not take either kvm->slots_lock or kvm->slots_arch_lock.”h]”hX@kvm->mn_active_invalidate_count ensures that pairs of invalidate_range_start() and invalidate_range_end() callbacks use the same memslots array. kvm->slots_lock and kvm->slots_arch_lock are taken on the waiting side when modifying memslots, so MMU notifiers must not take either kvm->slots_lock or kvm->slots_arch_lock.”…”�”}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Khj•ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1hþh³hÇh´K hhÝh²hubhï)�”}”(hŒcpus_read_lock() vs kvm_lock:”h]”hŒcpus_read_lock() vs kvm_lock:”…”�”}”(hjµh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KhhÝh²hubhÿ)�”}”(hhh]”j)�”}”(hX Taking cpus_read_lock() outside of kvm_lock is problematic, despite that being the official ordering, as it is quite easy to unknowingly trigger cpus_read_lock() while holding kvm_lock. Use caution when walking vm_list, e.g. avoid complex operations when possible. ”h]”hï)�”}”(hX Taking cpus_read_lock() outside of kvm_lock is problematic, despite that being the official ordering, as it is quite easy to unknowingly trigger cpus_read_lock() while holding kvm_lock. Use caution when walking vm_list, e.g. avoid complex operations when possible.”h]”hX Taking cpus_read_lock() outside of kvm_lock is problematic, despite that being the official ordering, as it is quite easy to unknowingly trigger cpus_read_lock() while holding kvm_lock. Use caution when walking vm_list, e.g. avoid complex operations when possible.”…”�”}”(hjÊh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K!hjÆubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÃh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j³j´uh1hþh³hÇh´K!hhÝh²hubhï)�”}”(hŒ For SRCU:”h]”hŒ For SRCU:”…”�”}”(hjäh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K&hhÝh²hubhÿ)�”}”(hhh]”(j)�”}”(hX(``synchronize_srcu(&kvm->srcu)`` is called inside critical sections for kvm->lock, vcpu->mutex and kvm->slots_lock. These locks _cannot_ be taken inside a kvm->srcu read-side critical section; that is, the following is broken:: srcu_read_lock(&kvm->srcu); mutex_lock(&kvm->slots_lock); ”h]”(hï)�”}”(hŒä``synchronize_srcu(&kvm->srcu)`` is called inside critical sections for kvm->lock, vcpu->mutex and kvm->slots_lock. These locks _cannot_ be taken inside a kvm->srcu read-side critical section; that is, the following is broken::”h]”(hŒliteral”“”)�”}”(hŒ ``synchronize_srcu(&kvm->srcu)``”h]”hŒsynchronize_srcu(&kvm->srcu)”…”�”}”(hjÿh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhjùubhŒÃ is called inside critical sections for kvm->lock, vcpu->mutex and kvm->slots_lock. These locks _cannot_ be taken inside a kvm->srcu read-side critical section; that is, the following is broken:”…”�”}”(hjùh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K(hjõubhŒ literal_block”“”)�”}”(hŒ9srcu_read_lock(&kvm->srcu); mutex_lock(&kvm->slots_lock);”h]”hŒ9srcu_read_lock(&kvm->srcu); mutex_lock(&kvm->slots_lock);”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´K-hjõubeh}”(h]”h ]”h"]”h$]”h&]”uh1jhjòh²hh³hÇh´Nubj)�”}”(hŒÇkvm->slots_arch_lock instead is released before the call to ``synchronize_srcu()``. It _can_ therefore be taken inside a kvm->srcu read-side critical section, for example while processing a vmexit. ”h]”hï)�”}”(hŒÆkvm->slots_arch_lock instead is released before the call to ``synchronize_srcu()``. It _can_ therefore be taken inside a kvm->srcu read-side critical section, for example while processing a vmexit.”h]”(hŒslots_arch_lock instead is released before the call to ”…”�”}”(hj1h²hh³Nh´Nubjþ)�”}”(hŒ``synchronize_srcu()``”h]”hŒsynchronize_srcu()”…”�”}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhj1ubhŒt. It _can_ therefore be taken inside a kvm->srcu read-side critical section, for example while processing a vmexit.”…”�”}”(hj1h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K0hj-ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjòh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”j³j´uh1hþh³hÇh´K(hhÝh²hubhï)�”}”(hŒOn x86:”h]”hŒOn x86:”…”�”}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K5hhÝh²hubhÿ)�”}”(hhh]”(j)�”}”(hŒQvcpu->mutex is taken outside kvm->arch.hyperv.hv_lock and kvm->arch.xen.xen_lock ”h]”hï)�”}”(hŒPvcpu->mutex is taken outside kvm->arch.hyperv.hv_lock and kvm->arch.xen.xen_lock”h]”hŒPvcpu->mutex is taken outside kvm->arch.hyperv.hv_lock and kvm->arch.xen.xen_lock”…”�”}”(hjrh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K7hjnubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjkh²hh³hÇh´Nubj)�”}”(hŒškvm->arch.mmu_lock is an rwlock; critical sections for kvm->arch.tdp_mmu_pages_lock and kvm->arch.mmu_unsync_pages_lock must also take kvm->arch.mmu_lock ”h]”hï)�”}”(hŒ™kvm->arch.mmu_lock is an rwlock; critical sections for kvm->arch.tdp_mmu_pages_lock and kvm->arch.mmu_unsync_pages_lock must also take kvm->arch.mmu_lock”h]”hŒ™kvm->arch.mmu_lock is an rwlock; critical sections for kvm->arch.tdp_mmu_pages_lock and kvm->arch.mmu_unsync_pages_lock must also take kvm->arch.mmu_lock”…”�”}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K9hj†ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjkh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”j³j´uh1hþh³hÇh´K7hhÝh²hubhï)�”}”(hŒOEverything else is a leaf: no other lock is taken inside the critical sections.”h]”hŒOEverything else is a leaf: no other lock is taken inside the critical sections.”…”�”}”(hj¤h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K=hhÝh²hubeh}”(h]”Œacquisition-orders”ah ]”h"]”Œ1. acquisition orders”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ 2. Exception”h]”hŒ 2. Exception”…”�”}”(hj½h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjºh²hh³hÇh´KAubhï)�”}”(hŒFast page fault:”h]”hŒFast page fault:”…”�”}”(hjËh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KChjºh²hubhï)�”}”(hŒ¦Fast page fault is the fast path which fixes the guest page fault out of the mmu-lock on x86. Currently, the page fault can be fast in one of the following two cases:”h]”hŒ¦Fast page fault is the fast path which fixes the guest page fault out of the mmu-lock on x86. Currently, the page fault can be fast in one of the following two cases:”…”�”}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KEhjºh²hubhŒenumerated_list”“”)�”}”(hhh]”(j)�”}”(hŒ°Access Tracking: The SPTE is not present, but it is marked for access tracking. That means we need to restore the saved R/X bits. This is described in more detail later below. ”h]”hï)�”}”(hŒ¯Access Tracking: The SPTE is not present, but it is marked for access tracking. That means we need to restore the saved R/X bits. This is described in more detail later below.”h]”hŒ¯Access Tracking: The SPTE is not present, but it is marked for access tracking. That means we need to restore the saved R/X bits. This is described in more detail later below.”…”�”}”(hjðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KIhjìubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjéh²hh³hÇh´Nubj)�”}”(hŒ‰Write-Protection: The SPTE is present and the fault is caused by write-protect. That means we just need to change the W bit of the spte. ”h]”hï)�”}”(hŒˆWrite-Protection: The SPTE is present and the fault is caused by write-protect. That means we just need to change the W bit of the spte.”h]”hŒˆWrite-Protection: The SPTE is present and the fault is caused by write-protect. That means we just need to change the W bit of the spte.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KMhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjéh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ.”uh1jçhjºh²hh³hÇh´KIubhï)�”}”(hŒ]What we use to avoid all the races is the Host-writable bit and MMU-writable bit on the spte:”h]”hŒ]What we use to avoid all the races is the Host-writable bit and MMU-writable bit on the spte:”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KPhjºh²hubhÿ)�”}”(hhh]”(j)�”}”(hŒ^Host-writable means the gfn is writable in the host kernel page tables and in its KVM memslot.”h]”hï)�”}”(hŒ^Host-writable means the gfn is writable in the host kernel page tables and in its KVM memslot.”h]”hŒ^Host-writable means the gfn is writable in the host kernel page tables and in its KVM memslot.”…”�”}”(hj<h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KShj8ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj5h²hh³hÇh´Nubj)�”}”(hŒyMMU-writable means the gfn is writable in the guest's mmu and it is not write-protected by shadow page write-protection. ”h]”hï)�”}”(hŒxMMU-writable means the gfn is writable in the guest's mmu and it is not write-protected by shadow page write-protection.”h]”hŒzMMU-writable means the gfn is writable in the guest’s mmu and it is not write-protected by shadow page write-protection.”…”�”}”(hjTh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KUhjPubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj5h²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”j³j´uh1hþh³hÇh´KShjºh²hubhï)�”}”(hXOn fast page fault path, we will use cmpxchg to atomically set the spte W bit if spte.HOST_WRITEABLE = 1 and spte.WRITE_PROTECT = 1, to restore the saved R/X bits if for an access-traced spte, or both. This is safe because whenever changing these bits can be detected by cmpxchg.”h]”hXOn fast page fault path, we will use cmpxchg to atomically set the spte W bit if spte.HOST_WRITEABLE = 1 and spte.WRITE_PROTECT = 1, to restore the saved R/X bits if for an access-traced spte, or both. This is safe because whenever changing these bits can be detected by cmpxchg.”…”�”}”(hjnh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KXhjºh²hubhï)�”}”(hŒ(But we need carefully check these cases:”h]”hŒ(But we need carefully check these cases:”…”�”}”(hj|h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K]hjºh²hubjè)�”}”(hhh]”j)�”}”(hŒThe mapping from gfn to pfn ”h]”hï)�”}”(hŒThe mapping from gfn to pfn”h]”hŒThe mapping from gfn to pfn”…”�”}”(hj‘h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K_hj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjŠh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j"j#j$hj%Œ)”uh1jçhjºh²hh³hÇh´K_ubhï)�”}”(hŒ¦The mapping from gfn to pfn may be changed since we can only ensure the pfn is not changed during cmpxchg. This is a ABA problem, for example, below case will happen:”h]”hŒ¦The mapping from gfn to pfn may be changed since we can only ensure the pfn is not changed during cmpxchg. This is a ABA problem, for example, below case will happen:”…”�”}”(hj¬h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kahjºh²hubhŒtable”“”)�”}”(hhh]”hŒtgroup”“”)�”}”(hhh]”(hŒcolspec”“”)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K$uh1jÄhjÁubjÅ)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K#uh1jÄhjÁubhŒtbody”“”)�”}”(hhh]”(hŒrow”“”)�”}”(hhh]”hŒentry”“”)�”}”(hhh]”(hï)�”}”(hŒAt the beginning::”h]”hŒAt the beginning:”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kfhjæubj)�”}”(hŒvgpte = gfn1 gfn1 is mapped to pfn1 on host spte is the shadow page table entry corresponding with gpte and spte = pfn1”h]”hŒvgpte = gfn1 gfn1 is mapped to pfn1 on host spte is the shadow page table entry corresponding with gpte and spte = pfn1”…”�”}”hj÷sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´Khhjæubeh}”(h]”h ]”h"]”h$]”h&]”Œmorecols”Kuh1jähjáubah}”(h]”h ]”h"]”h$]”h&]”uh1jßhjÜubjà)�”}”(hhh]”jå)�”}”(hhh]”hï)�”}”(hŒOn fast page fault path:”h]”hŒOn fast page fault path:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kmhjubah}”(h]”h ]”h"]”h$]”h&]”Œmorecols”Kuh1jähjubah}”(h]”h ]”h"]”h$]”h&]”uh1jßhjÜubjà)�”}”(hhh]”(jå)�”}”(hhh]”hï)�”}”(hŒCPU 0:”h]”hŒCPU 0:”…”�”}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kohj6ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähj3ubjå)�”}”(hhh]”hï)�”}”(hŒCPU 1:”h]”hŒCPU 1:”…”�”}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KohjMubah}”(h]”h ]”h"]”h$]”h&]”uh1jähj3ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jßhjÜubjà)�”}”(hhh]”(jå)�”}”(hhh]”j)�”}”(hŒold_spte = *spte;”h]”hŒold_spte = *spte;”…”�”}”hjpsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´Kshjmubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjjubjå)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”uh1jähjjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jßhjÜubjà)�”}”(hhh]”(jå)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”uh1jähj“ubjå)�”}”(hhh]”(hï)�”}”(hŒpfn1 is swapped out::”h]”hŒpfn1 is swapped out:”…”�”}”(hj¢h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KuhjŸubj)�”}”(hŒ spte = 0;”h]”hŒ spte = 0;”…”�”}”hj°sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´KwhjŸubhï)�”}”(hŒpfn1 is re-alloced for gfn2.”h]”hŒpfn1 is re-alloced for gfn2.”…”�”}”(hj¾h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KyhjŸubhï)�”}”(hŒ/gpte is changed to point to gfn2 by the guest::”h]”hŒ.gpte is changed to point to gfn2 by the guest:”…”�”}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K{hjŸubj)�”}”(hŒ spte = pfn1;”h]”hŒ spte = pfn1;”…”�”}”hjÚsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´K~hjŸubeh}”(h]”h ]”h"]”h$]”h&]”uh1jähj“ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jßhjÜubjà)�”}”(hhh]”jå)�”}”(hhh]”j)�”}”(hŒ]if (cmpxchg(spte, old_spte, old_spte+W) mark_page_dirty(vcpu->kvm, gfn1) OOPS!!!”h]”hŒ]if (cmpxchg(spte, old_spte, old_spte+W) mark_page_dirty(vcpu->kvm, gfn1) OOPS!!!”…”�”}”hjúsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´K‚hj÷ubah}”(h]”h ]”h"]”h$]”h&]”Œmorecols”Kuh1jähjôubah}”(h]”h ]”h"]”h$]”h&]”uh1jßhjÜubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÚhjÁubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1j¿hj¼ubah}”(h]”h ]”h"]”h$]”h&]”uh1jºhjºh²hh³hÇh´Nubhï)�”}”(hŒ?We dirty-log for gfn1, that means gfn2 is lost in dirty-bitmap.”h]”hŒ?We dirty-log for gfn1, that means gfn2 is lost in dirty-bitmap.”…”�”}”(hj(h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K‡hjºh²hubhï)�”}”(hŒ�For direct sp, we can easily avoid it since the spte of direct sp is fixed to gfn. For indirect sp, we disabled fast page fault for simplicity.”h]”hŒ�For direct sp, we can easily avoid it since the spte of direct sp is fixed to gfn. For indirect sp, we disabled fast page fault for simplicity.”…”�”}”(hj6h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K‰hjºh²hubhï)�”}”(hŒZA solution for indirect sp could be to pin the gfn before the cmpxchg. After the pinning:”h]”hŒZA solution for indirect sp could be to pin the gfn before the cmpxchg. After the pinning:”…”�”}”(hjDh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KŒhjºh²hubhÿ)�”}”(hhh]”(j)�”}”(hŒdWe have held the refcount of pfn; that means the pfn can not be freed and be reused for another gfn.”h]”hï)�”}”(hŒdWe have held the refcount of pfn; that means the pfn can not be freed and be reused for another gfn.”h]”hŒdWe have held the refcount of pfn; that means the pfn can not be freed and be reused for another gfn.”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K�hjUubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjRh²hh³hÇh´Nubj)�”}”(hŒUThe pfn is writable and therefore it cannot be shared between different gfns by KSM. ”h]”hï)�”}”(hŒTThe pfn is writable and therefore it cannot be shared between different gfns by KSM.”h]”hŒTThe pfn is writable and therefore it cannot be shared between different gfns by KSM.”…”�”}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K‘hjmubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjRh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”j³j´uh1hþh³hÇh´K�hjºh²hubhï)�”}”(hŒAThen, we can ensure the dirty bitmaps is correctly set for a gfn.”h]”hŒAThen, we can ensure the dirty bitmaps is correctly set for a gfn.”…”�”}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K”hjºh²hubjè)�”}”(hhh]”j)�”}”(hŒDirty bit tracking ”h]”hï)�”}”(hŒDirty bit tracking”h]”hŒDirty bit tracking”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K–hjœubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj™h²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j"j#j$hj%j«Œstart”Kuh1jçhjºh²hh³hÇh´K–ubhï)�”}”(hŒ¼In the original code, the spte can be fast updated (non-atomically) if the spte is read-only and the Accessed bit has already been set since the Accessed bit and Dirty bit can not be lost.”h]”hŒ¼In the original code, the spte can be fast updated (non-atomically) if the spte is read-only and the Accessed bit has already been set since the Accessed bit and Dirty bit can not be lost.”…”�”}”(hj»h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K˜hjºh²hubhï)�”}”(hŒ‡But it is not true after fast page fault since the spte can be marked writable between reading spte and updating spte. Like below case:”h]”hŒ‡But it is not true after fast page fault since the spte can be marked writable between reading spte and updating spte. Like below case:”…”�”}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kœhjºh²hubj»)�”}”(hhh]”jÀ)�”}”(hhh]”(jÅ)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K%uh1jÄhjÚubjÅ)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”Œcolwidth”K#uh1jÄhjÚubjÛ)�”}”(hhh]”(jà)�”}”(hhh]”jå)�”}”(hhh]”(hï)�”}”(hŒAt the beginning::”h]”hŒAt the beginning:”…”�”}”(hjúh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K hj÷ubj)�”}”(hŒspte.W = 0 spte.Accessed = 1”h]”hŒspte.W = 0 spte.Accessed = 1”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´K¢hj÷ubeh}”(h]”h ]”h"]”h$]”h&]”Œmorecols”Kuh1jähjôubah}”(h]”h ]”h"]”h$]”h&]”uh1jßhjñubjà)�”}”(hhh]”(jå)�”}”(hhh]”hï)�”}”(hŒCPU 0:”h]”hŒCPU 0:”…”�”}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K¥hj&ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähj#ubjå)�”}”(hhh]”hï)�”}”(hŒCPU 1:”h]”hŒCPU 1:”…”�”}”(hj@h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K¥hj=ubah}”(h]”h ]”h"]”h$]”h&]”uh1jähj#ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jßhjñubjà)�”}”(hhh]”(jå)�”}”(hhh]”(hï)�”}”(hŒIn mmu_spte_update()::”h]”hŒIn mmu_spte_update():”…”�”}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K§hj]ubj)�”}”(hŒ~old_spte = *spte; /* 'if' condition is satisfied. */ if (old_spte.Accessed == 1 && old_spte.W == 0) spte = new_spte;”h]”hŒ~old_spte = *spte; /* 'if' condition is satisfied. */ if (old_spte.Accessed == 1 && old_spte.W == 0) spte = new_spte;”…”�”}”hjnsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´K©hj]ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jähjZubjå)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”uh1jähjZubeh}”(h]”h ]”h"]”h$]”h&]”uh1jßhjñubjà)�”}”(hhh]”(jå)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”uh1jähj‘ubjå)�”}”(hhh]”(hï)�”}”(hŒon fast page fault path::”h]”hŒon fast page fault path:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K±hj�ubj)�”}”(hŒ spte.W = 1”h]”hŒ spte.W = 1”…”�”}”hj®sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´K³hj�ubhï)�”}”(hŒmemory write on the spte::”h]”hŒmemory write on the spte:”…”�”}”(hj¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kµhj�ubj)�”}”(hŒspte.Dirty = 1”h]”hŒspte.Dirty = 1”…”�”}”hjÊsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´K·hj�ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jähj‘ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jßhjñubjà)�”}”(hhh]”(jå)�”}”(hhh]”j)�”}”(hŒ­else old_spte = xchg(spte, new_spte); if (old_spte.Accessed && !new_spte.Accessed) flush = true; if (old_spte.Dirty && !new_spte.Dirty) flush = true; OOPS!!!”h]”hŒ­else old_spte = xchg(spte, new_spte); if (old_spte.Accessed && !new_spte.Accessed) flush = true; if (old_spte.Dirty && !new_spte.Dirty) flush = true; OOPS!!!”…”�”}”hjêsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1jh³hÇh´K»hjçubah}”(h]”h ]”h"]”h$]”h&]”uh1jähjäubjå)�”}”(hhh]”h}”(h]”h ]”h"]”h$]”h&]”uh1jähjäubeh}”(h]”h ]”h"]”h$]”h&]”uh1jßhjñubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÚhjÚubeh}”(h]”h ]”h"]”h$]”h&]”Œcols”Kuh1j¿hj×ubah}”(h]”h ]”h"]”h$]”h&]”uh1jºhjºh²hh³hÇh´Nubhï)�”}”(hŒ#The Dirty bit is lost in this case.”h]”hŒ#The Dirty bit is lost in this case.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÆhjºh²hubhï)�”}”(hŒÐIn order to avoid this kind of issue, we always treat the spte as "volatile" if it can be updated out of mmu-lock [see spte_needs_atomic_update()]; it means the spte is always atomically updated in this case.”h]”hŒÔIn order to avoid this kind of issue, we always treat the spte as “volatileâ€� if it can be updated out of mmu-lock [see spte_needs_atomic_update()]; it means the spte is always atomically updated in this case.”…”�”}”(hj.h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÈhjºh²hubjè)�”}”(hhh]”j)�”}”(hŒflush tlbs due to spte updated ”h]”hï)�”}”(hŒflush tlbs due to spte updated”h]”hŒflush tlbs due to spte updated”…”�”}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÌhj?ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj<h²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j"j#j$hj%j«jºKuh1jçhjºh²hh³hÇh´KÌubhï)�”}”(hŒÃIf the spte is updated from writable to read-only, we should flush all TLBs, otherwise rmap_write_protect will find a read-only spte, even though the writable spte might be cached on a CPU's TLB.”h]”hŒÅIf the spte is updated from writable to read-only, we should flush all TLBs, otherwise rmap_write_protect will find a read-only spte, even though the writable spte might be cached on a CPU’s TLB.”…”�”}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÎhjºh²hubhï)�”}”(hXAs mentioned before, the spte can be updated to writable out of mmu-lock on fast page fault path. In order to easily audit the path, we see if TLBs needing to be flushed caused this reason in mmu_spte_update() since this is a common function to update spte (present -> present).”h]”hXAs mentioned before, the spte can be updated to writable out of mmu-lock on fast page fault path. In order to easily audit the path, we see if TLBs needing to be flushed caused this reason in mmu_spte_update() since this is a common function to update spte (present -> present).”…”�”}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÒhjºh²hubhï)�”}”(hŒäSince the spte is "volatile" if it can be updated out of mmu-lock, we always atomically update the spte and the race caused by fast page fault can be avoided. See the comments in spte_needs_atomic_update() and mmu_spte_update().”h]”hŒèSince the spte is “volatileâ€� if it can be updated out of mmu-lock, we always atomically update the spte and the race caused by fast page fault can be avoided. See the comments in spte_needs_atomic_update() and mmu_spte_update().”…”�”}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K×hjºh²hubhï)�”}”(hŒLockless Access Tracking:”h]”hŒLockless Access Tracking:”…”�”}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÛhjºh²hubhï)�”}”(hX”This is used for Intel CPUs that are using EPT but do not support the EPT A/D bits. In this case, PTEs are tagged as A/D disabled (using ignored bits), and when the KVM MMU notifier is called to track accesses to a page (via kvm_mmu_notifier_clear_flush_young), it marks the PTE not-present in hardware by clearing the RWX bits in the PTE and storing the original R & X bits in more unused/ignored bits. When the VM tries to access the page later on, a fault is generated and the fast page fault mechanism described above is used to atomically restore the PTE to a Present state. The W bit is not saved when the PTE is marked for access tracking and during restoration to the Present state, the W bit is set depending on whether or not it was a write access. If it wasn't, then the W bit will remain clear until a write access happens, at which time it will be set using the Dirty tracking mechanism described above.”h]”hX–This is used for Intel CPUs that are using EPT but do not support the EPT A/D bits. In this case, PTEs are tagged as A/D disabled (using ignored bits), and when the KVM MMU notifier is called to track accesses to a page (via kvm_mmu_notifier_clear_flush_young), it marks the PTE not-present in hardware by clearing the RWX bits in the PTE and storing the original R & X bits in more unused/ignored bits. When the VM tries to access the page later on, a fault is generated and the fast page fault mechanism described above is used to atomically restore the PTE to a Present state. The W bit is not saved when the PTE is marked for access tracking and during restoration to the Present state, the W bit is set depending on whether or not it was a write access. If it wasn’t, then the W bit will remain clear until a write access happens, at which time it will be set using the Dirty tracking mechanism described above.”…”�”}”(hj•h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KÝhjºh²hubeh}”(h]”Œ exception”ah ]”h"]”Œ 2. exception”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KAubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ 3. Reference”h]”hŒ 3. Reference”…”�”}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj«h²hh³hÇh´KëubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ ``kvm_lock``”h]”jþ)�”}”(hjÁh]”hŒkvm_lock”…”�”}”(hjÃh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhj¿ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj¼h²hh³hÇh´KîubhŒ field_list”“”)�”}”(hhh]”(hŒfield”“”)�”}”(hhh]”(hŒ field_name”“”)�”}”(hŒType”h]”hŒType”…”�”}”(hjâh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjÝh³hÇh´KubhŒ field_body”“”)�”}”(hŒmutex”h]”hï)�”}”(hjôh]”hŒmutex”…”�”}”(hjöh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kðhjòubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjÝubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´KðhjØh²hubjÜ)�”}”(hhh]”(já)�”}”(hŒArch”h]”hŒArch”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjh³hÇh´Kubjñ)�”}”(hŒany”h]”hï)�”}”(hj"h]”hŒany”…”�”}”(hj$h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kñhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´KñhjØh²hubjÜ)�”}”(hhh]”(já)�”}”(hŒProtects”h]”hŒProtects”…”�”}”(hj@h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhj=h³hÇh´Kubjñ)�”}”(hŒ - vm_list ”h]”hÿ)�”}”(hhh]”j)�”}”(hŒvm_list ”h]”hï)�”}”(hŒvm_list”h]”hŒvm_list”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KòhjUubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjRubah}”(h]”h ]”h"]”h$]”h&]”j³j´uh1hþh³hÇh´KòhjNubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhj=ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´KòhjØh²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÖhj¼h²hh³hÇh´Kðubeh}”(h]”Œkvm-lock”ah ]”h"]”Œkvm_lock”ah$]”h&]”uh1hÈhj«h²hh³hÇh´KîubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ``kvm_usage_lock``”h]”jþ)�”}”(hj’h]”hŒkvm_usage_lock”…”�”}”(hj”h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj�h²hh³hÇh´Kõubj×)�”}”(hhh]”(jÜ)�”}”(hhh]”(já)�”}”(hŒType”h]”hŒType”…”�”}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjªh³hÇh´Kubjñ)�”}”(hŒmutex”h]”hï)�”}”(hj½h]”hŒmutex”…”�”}”(hj¿h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K÷hj»ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjªubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´K÷hj§h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒArch”h]”hŒArch”…”�”}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjØh³hÇh´Kubjñ)�”}”(hŒany”h]”hï)�”}”(hjëh]”hŒany”…”�”}”(hjíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Køhjéubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjØubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´Køhj§h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒProtects”h]”hŒProtects”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhj h³hÇh´Kubjñ)�”}”(hŒ:- kvm_usage_count - hardware virtualization enable/disable”h]”hÿ)�”}”(hhh]”(j)�”}”(hŒkvm_usage_count”h]”hï)�”}”(hj h]”hŒkvm_usage_count”…”�”}”(hj" h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kùhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubj)�”}”(hŒ&hardware virtualization enable/disable”h]”hï)�”}”(hj7 h]”hŒ&hardware virtualization enable/disable”…”�”}”(hj9 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kúhj5 ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubeh}”(h]”h ]”h"]”h$]”h&]”j³j´uh1hþh³hÇh´Kùhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´Kùhj§h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒComment”h]”hŒComment”…”�”}”(hja h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhj^ h³hÇh´Kubjñ)�”}”(hŒ€Exists to allow taking cpus_read_lock() while kvm_usage_count is protected, which simplifies the virtualization enabling logic. ”h]”hï)�”}”(hŒExists to allow taking cpus_read_lock() while kvm_usage_count is protected, which simplifies the virtualization enabling logic.”h]”hŒExists to allow taking cpus_read_lock() while kvm_usage_count is protected, which simplifies the virtualization enabling logic.”…”�”}”(hjs h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kûhjo ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhj^ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´Kûhj§h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÖhj�h²hh³hÇh´K÷ubeh}”(h]”Œkvm-usage-lock”ah ]”h"]”Œkvm_usage_lock”ah$]”h&]”uh1hÈhj«h²hh³hÇh´KõubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ``kvm->mn_invalidate_lock``”h]”jþ)�”}”(hj  h]”hŒkvm->mn_invalidate_lock”…”�”}”(hj¢ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhjž ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj› h²hh³hÇh´Kÿubj×)�”}”(hhh]”(jÜ)�”}”(hhh]”(já)�”}”(hŒType”h]”hŒType”…”�”}”(hj» h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhj¸ h³hÇh´Kubjñ)�”}”(hŒ spinlock_t”h]”hï)�”}”(hjË h]”hŒ spinlock_t”…”�”}”(hjÍ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´MhjÉ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhj¸ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´Mhjµ h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒArch”h]”hŒArch”…”�”}”(hjé h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjæ h³hÇh´Kubjñ)�”}”(hŒany”h]”hï)�”}”(hjù h]”hŒany”…”�”}”(hjû h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhj÷ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjæ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´Mhjµ h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒProtects”h]”hŒProtects”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhj h³hÇh´Kubjñ)�”}”(hŒ7mn_active_invalidate_count, mn_memslots_update_rcuwait ”h]”hï)�”}”(hŒ6mn_active_invalidate_count, mn_memslots_update_rcuwait”h]”hŒ6mn_active_invalidate_count, mn_memslots_update_rcuwait”…”�”}”(hj) h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhj% ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´Mhjµ h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÖhj› h²hh³hÇh´Mubeh}”(h]”Œkvm-mn-invalidate-lock”ah ]”h"]”Œkvm->mn_invalidate_lock”ah$]”h&]”uh1hÈhj«h²hh³hÇh´KÿubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ``kvm_arch::tsc_write_lock``”h]”jþ)�”}”(hjV h]”hŒkvm_arch::tsc_write_lock”…”�”}”(hjX h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhjT ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjQ h²hh³hÇh´Mubj×)�”}”(hhh]”(jÜ)�”}”(hhh]”(já)�”}”(hŒType”h]”hŒType”…”�”}”(hjq h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjn h³hÇh´Kubjñ)�”}”(hŒraw_spinlock_t”h]”hï)�”}”(hj� h]”hŒraw_spinlock_t”…”�”}”(hjƒ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjn ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´Mhjk h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒArch”h]”hŒArch”…”�”}”(hjŸ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjœ h³hÇh´Kubjñ)�”}”(hŒx86”h]”hï)�”}”(hj¯ h]”hŒx86”…”�”}”(hj± h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M hj­ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjœ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´M hjk h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒProtects”h]”hŒProtects”…”�”}”(hjÍ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjÊ h³hÇh´Kubjñ)�”}”(hŒO- kvm_arch::{last_tsc_write,last_tsc_nsec,last_tsc_offset} - tsc offset in vmcb”h]”hÿ)�”}”(hhh]”(j)�”}”(hŒ8kvm_arch::{last_tsc_write,last_tsc_nsec,last_tsc_offset}”h]”hï)�”}”(hjä h]”hŒ8kvm_arch::{last_tsc_write,last_tsc_nsec,last_tsc_offset}”…”�”}”(hjæ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M hjâ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjß ubj)�”}”(hŒtsc offset in vmcb”h]”hï)�”}”(hjû h]”hŒtsc offset in vmcb”…”�”}”(hjý h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M hjù ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjß ubeh}”(h]”h ]”h"]”h$]”h&]”j³j´uh1hþh³hÇh´M hjÛ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjÊ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´M hjk h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒComment”h]”hŒComment”…”�”}”(hj% h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhj" h³hÇh´Kubjñ)�”}”(hŒ>'raw' because updating the tsc offsets must not be preempted. ”h]”hï)�”}”(hŒ='raw' because updating the tsc offsets must not be preempted.”h]”hŒA‘raw’ because updating the tsc offsets must not be preempted.”…”�”}”(hj7 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M hj3 ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhj" ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´M hjk h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÖhjQ h²hh³hÇh´Mubeh}”(h]”Œkvm-arch-tsc-write-lock”ah ]”h"]”Œkvm_arch::tsc_write_lock”ah$]”h&]”uh1hÈhj«h²hh³hÇh´MubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ``kvm->mmu_lock``”h]”jþ)�”}”(hjd h]”hŒ kvm->mmu_lock”…”�”}”(hjf h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhjb ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj_ h²hh³hÇh´Mubj×)�”}”(hhh]”(jÜ)�”}”(hhh]”(já)�”}”(hŒType”h]”hŒType”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhj| h³hÇh´Kubjñ)�”}”(hŒspinlock_t or rwlock_t”h]”hï)�”}”(hj� h]”hŒspinlock_t or rwlock_t”…”�”}”(hj‘ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhj� ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhj| ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´Mhjy h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒArch”h]”hŒArch”…”�”}”(hj­ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjª h³hÇh´Kubjñ)�”}”(hŒany”h]”hï)�”}”(hj½ h]”hŒany”…”�”}”(hj¿ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhj» ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjª ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´Mhjy h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒProtects”h]”hŒProtects”…”�”}”(hjÛ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjØ h³hÇh´Kubjñ)�”}”(hŒ-shadow page/shadow tlb entry”h]”hï)�”}”(hjë h]”hŒ-shadow page/shadow tlb entry”…”�”}”(hjí h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhjé ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjØ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´Mhjy h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒComment”h]”hŒComment”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhj h³hÇh´Kubjñ)�”}”(hŒ3it is a spinlock since it is used in mmu notifier. ”h]”hï)�”}”(hŒ2it is a spinlock since it is used in mmu notifier.”h]”hŒ2it is a spinlock since it is used in mmu notifier.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´Mhjy h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÖhj_ h²hh³hÇh´Mubeh}”(h]”Œ kvm-mmu-lock”ah ]”h"]”Œ kvm->mmu_lock”ah$]”h&]”uh1hÈhj«h²hh³hÇh´MubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ ``kvm->srcu``”h]”jþ)�”}”(hjH h]”hŒ kvm->srcu”…”�”}”(hjJ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhjF ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjC h²hh³hÇh´Mubj×)�”}”(hhh]”(jÜ)�”}”(hhh]”(já)�”}”(hŒType”h]”hŒType”…”�”}”(hjc h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhj` h³hÇh´Kubjñ)�”}”(hŒ srcu lock”h]”hï)�”}”(hjs h]”hŒ srcu lock”…”�”}”(hju h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhjq ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhj` ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´Mhj] h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒArch”h]”hŒArch”…”�”}”(hj‘ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjŽ h³hÇh´Kubjñ)�”}”(hŒany”h]”hï)�”}”(hj¡ h]”hŒany”…”�”}”(hj£ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´MhjŸ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjŽ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´Mhj] h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒProtects”h]”hŒProtects”…”�”}”(hj¿ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhj¼ h³hÇh´Kubjñ)�”}”(hŒ- kvm->memslots - kvm->buses”h]”hÿ)�”}”(hhh]”(j)�”}”(hŒ kvm->memslots”h]”hï)�”}”(hjÖ h]”hŒ kvm->memslots”…”�”}”(hjØ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´MhjÔ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÑ ubj)�”}”(hŒ kvm->buses”h]”hï)�”}”(hjí h]”hŒ kvm->buses”…”�”}”(hjï h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhjë ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjÑ ubeh}”(h]”h ]”h"]”h$]”h&]”j³j´uh1hþh³hÇh´MhjÍ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhj¼ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´Mhj] h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒComment”h]”hŒComment”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhj h³hÇh´Kubjñ)�”}”(hXThe srcu read lock must be held while accessing memslots (e.g. when using gfn_to_* functions) and while accessing in-kernel MMIO/PIO address->device structure mapping (kvm->buses). The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu if it is needed by multiple functions. ”h]”hï)�”}”(hXThe srcu read lock must be held while accessing memslots (e.g. when using gfn_to_* functions) and while accessing in-kernel MMIO/PIO address->device structure mapping (kvm->buses). The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu if it is needed by multiple functions.”h]”hXThe srcu read lock must be held while accessing memslots (e.g. when using gfn_to_* functions) and while accessing in-kernel MMIO/PIO address->device structure mapping (kvm->buses). The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu if it is needed by multiple functions.”…”�”}”(hj) h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Mhj% ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´Mhj] h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÖhjC h²hh³hÇh´Mubeh}”(h]”Œkvm-srcu”ah ]”h"]”Œ kvm->srcu”ah$]”h&]”uh1hÈhj«h²hh³hÇh´MubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ``kvm->slots_arch_lock``”h]”jþ)�”}”(hjV h]”hŒkvm->slots_arch_lock”…”�”}”(hjX h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhjT ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjQ h²hh³hÇh´M"ubj×)�”}”(hhh]”(jÜ)�”}”(hhh]”(já)�”}”(hŒType”h]”hŒType”…”�”}”(hjq h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjn h³hÇh´Kubjñ)�”}”(hŒmutex”h]”hï)�”}”(hj� h]”hŒmutex”…”�”}”(hjƒ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M#hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjn ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´M#hjk h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒArch”h]”hŒArch”…”�”}”(hjŸ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjœ h³hÇh´Kubjñ)�”}”(hŒany (only needed on x86 though)”h]”hï)�”}”(hj¯ h]”hŒany (only needed on x86 though)”…”�”}”(hj± h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M$hj­ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjœ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´M$hjk h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒProtects”h]”hŒProtects”…”�”}”(hjÍ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjÊ h³hÇh´Kubjñ)�”}”(hŒlany arch-specific fields of memslots that have to be modified in a ``kvm->srcu`` read-side critical section.”h]”hï)�”}”(hŒlany arch-specific fields of memslots that have to be modified in a ``kvm->srcu`` read-side critical section.”h]”(hŒCany arch-specific fields of memslots that have to be modified in a ”…”�”}”(hjß h²hh³Nh´Nubjþ)�”}”(hŒ ``kvm->srcu``”h]”hŒ kvm->srcu”…”�”}”(hjç h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhjß ubhŒ read-side critical section.”…”�”}”(hjß h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M%hjÛ ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjÊ ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´M%hjk h²hubjÜ)�”}”(hhh]”(já)�”}”(hŒComment”h]”hŒComment”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhj h³hÇh´Kubjñ)�”}”(hŒvmust be held before reading the pointer to the current memslots, until after all changes to the memslots are complete ”h]”hï)�”}”(hŒumust be held before reading the pointer to the current memslots, until after all changes to the memslots are complete”h]”hŒumust be held before reading the pointer to the current memslots, until after all changes to the memslots are complete”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M'hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´M'hjk h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÖhjQ h²hh³hÇh´M#ubeh}”(h]”Œkvm-slots-arch-lock”ah ]”h"]”Œkvm->slots_arch_lock”ah$]”h&]”uh1hÈhj«h²hh³hÇh´M"ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ``wakeup_vcpus_on_cpu_lock``”h]”jþ)�”}”(hjMh]”hŒwakeup_vcpus_on_cpu_lock”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhjKubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjHh²hh³hÇh´M+ubj×)�”}”(hhh]”(jÜ)�”}”(hhh]”(já)�”}”(hŒType”h]”hŒType”…”�”}”(hjhh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjeh³hÇh´Kubjñ)�”}”(hŒ spinlock_t”h]”hï)�”}”(hjxh]”hŒ spinlock_t”…”�”}”(hjzh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M,hjvubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjeubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´M,hjbh²hubjÜ)�”}”(hhh]”(já)�”}”(hŒArch”h]”hŒArch”…”�”}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhj“h³hÇh´Kubjñ)�”}”(hŒx86”h]”hï)�”}”(hj¦h]”hŒx86”…”�”}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M-hj¤ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhj“ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´M-hjbh²hubjÜ)�”}”(hhh]”(já)�”}”(hŒProtects”h]”hŒProtects”…”�”}”(hjÄh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjÁh³hÇh´Kubjñ)�”}”(hŒwakeup_vcpus_on_cpu”h]”hï)�”}”(hjÔh]”hŒwakeup_vcpus_on_cpu”…”�”}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M.hjÒubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjÁubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´M.hjbh²hubjÜ)�”}”(hhh]”(já)�”}”(hŒComment”h]”hŒComment”…”�”}”(hjòh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjïh³hÇh´Kubjñ)�”}”(hXŠThis is a per-CPU lock and it is used for VT-d posted-interrupts. When VT-d posted-interrupts are supported and the VM has assigned devices, we put the blocked vCPU on the list blocked_vcpu_on_cpu protected by blocked_vcpu_on_cpu_lock. When VT-d hardware issues wakeup notification event since external interrupts from the assigned devices happens, we will find the vCPU on the list to wakeup. ”h]”hï)�”}”(hX‰This is a per-CPU lock and it is used for VT-d posted-interrupts. When VT-d posted-interrupts are supported and the VM has assigned devices, we put the blocked vCPU on the list blocked_vcpu_on_cpu protected by blocked_vcpu_on_cpu_lock. When VT-d hardware issues wakeup notification event since external interrupts from the assigned devices happens, we will find the vCPU on the list to wakeup.”h]”hX‰This is a per-CPU lock and it is used for VT-d posted-interrupts. When VT-d posted-interrupts are supported and the VM has assigned devices, we put the blocked vCPU on the list blocked_vcpu_on_cpu protected by blocked_vcpu_on_cpu_lock. When VT-d hardware issues wakeup notification event since external interrupts from the assigned devices happens, we will find the vCPU on the list to wakeup.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M/hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjïubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´M/hjbh²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÖhjHh²hh³hÇh´M,ubeh}”(h]”Œwakeup-vcpus-on-cpu-lock”ah ]”h"]”Œwakeup_vcpus_on_cpu_lock”ah$]”h&]”uh1hÈhj«h²hh³hÇh´M+ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ``vendor_module_lock``”h]”jþ)�”}”(hj1h]”hŒvendor_module_lock”…”�”}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jýhj/ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj,h²hh³hÇh´M8ubj×)�”}”(hhh]”(jÜ)�”}”(hhh]”(já)�”}”(hŒType”h]”hŒType”…”�”}”(hjLh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjIh³hÇh´Kubjñ)�”}”(hŒmutex”h]”hï)�”}”(hj\h]”hŒmutex”…”�”}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M9hjZubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjIubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´M9hjFh²hubjÜ)�”}”(hhh]”(já)�”}”(hŒArch”h]”hŒArch”…”�”}”(hjzh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjwh³hÇh´Kubjñ)�”}”(hŒx86”h]”hï)�”}”(hjŠh]”hŒx86”…”�”}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M:hjˆubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjwubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´M:hjFh²hubjÜ)�”}”(hhh]”(já)�”}”(hŒProtects”h]”hŒProtects”…”�”}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhj¥h³hÇh´Kubjñ)�”}”(hŒ.loading a vendor module (kvm_amd or kvm_intel)”h]”hï)�”}”(hj¸h]”hŒ.loading a vendor module (kvm_amd or kvm_intel)”…”�”}”(hjºh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M;hj¶ubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhj¥ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´M;hjFh²hubjÜ)�”}”(hhh]”(já)�”}”(hŒComment”h]”hŒComment”…”�”}”(hjÖh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jàhjÓh³hÇh´Kubjñ)�”}”(hX>Exists because using kvm_lock leads to deadlock. kvm_lock is taken in notifiers, e.g. __kvmclock_cpufreq_notifier(), that may be invoked while cpu_hotplug_lock is held, e.g. from cpufreq_boost_trigger_state(), and many operations need to take cpu_hotplug_lock when loading a vendor module, e.g. updating static calls.”h]”hï)�”}”(hX>Exists because using kvm_lock leads to deadlock. kvm_lock is taken in notifiers, e.g. __kvmclock_cpufreq_notifier(), that may be invoked while cpu_hotplug_lock is held, e.g. from cpufreq_boost_trigger_state(), and many operations need to take cpu_hotplug_lock when loading a vendor module, e.g. updating static calls.”h]”hX>Exists because using kvm_lock leads to deadlock. kvm_lock is taken in notifiers, e.g. __kvmclock_cpufreq_notifier(), that may be invoked while cpu_hotplug_lock is held, e.g. from cpufreq_boost_trigger_state(), and many operations need to take cpu_hotplug_lock when loading a vendor module, e.g. updating static calls.”…”�”}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´M<hjäubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhjÓubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÛh³hÇh´M<hjFh²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÖhj,h²hh³hÇh´M9ubeh}”(h]”Œvendor-module-lock”ah ]”h"]”Œvendor_module_lock”ah$]”h&]”uh1hÈhj«h²hh³hÇh´M8ubeh}”(h]”Œ reference”ah ]”h"]”Œ 3. reference”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´Këubeh}”(h]”Œkvm-lock-overview”ah ]”h"]”Œkvm lock overview”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”jäŒ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”jBŒ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”}”(jjj·j´j¨j¥jjjŠj‡j˜ j• jN jK j\ jY j@ j= jN jK jEjBj)j&j j uŒ nametypes”}”(j‰j·‰j¨‰j‰jЉj˜ ‰jN ‰j\ ‰j@ ‰jN ‰jE‰j)‰j ‰uh}”(jhÊj´hÝj¥jºjj«j‡j¼j• j�jK j› jY jQ j= j_ jK jC jBjQ j&jHj 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”]”(hŒsystem_message”“”)�”}”(hhh]”hï)�”}”(hŒ:Enumerated list start value not ordinal-1: "2" (ordinal 2)”h]”hŒ>Enumerated list start value not ordinal-1: “2â€� (ordinal 2)”…”�”}”(hj©h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîhj¦ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”hÇŒline”Kuh1j¤hjºh²hh³hÇh´K–ubj¥)�”}”(hhh]”hï)�”}”(hŒ:Enumerated list start value not ordinal-1: "3" (ordinal 3)”h]”hŒ>Enumerated list start value not ordinal-1: “3â€� (ordinal 3)”…”�”}”(hjÅh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîhjÂubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”j¿Œsource”hÇŒline”Kuh1j¤hjºh²hh³hÇh´KÌubeŒtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.