• Home
  • Raw
  • Download

Lines Matching +full:fast +full:- +full:read

1 .. SPDX-License-Identifier: GPL-2.0
8 ---------------------
12 - kvm->lock is taken outside vcpu->mutex
14 - kvm->lock is taken outside kvm->slots_lock and kvm->irq_lock
16 - kvm->slots_lock is taken outside kvm->irq_lock, though acquiring
19 On x86, vcpu->mutex is taken outside kvm->arch.hyperv.hv_lock.
25 ------------
27 Fast page fault:
29 Fast page fault is the fast path which fixes the guest page fault out of
30 the mmu-lock on x86. Currently, the page fault can be fast in one of the
37 2. Write-Protection: The SPTE is present and the fault is
38 caused by write-protect. That means we just need to change the W bit of
44 - SPTE_HOST_WRITEABLE means the gfn is writable on host.
45 - SPTE_MMU_WRITEABLE means the gfn is writable on mmu. The bit is set when
46 the gfn is writable on guest mmu and it is not write-protected by shadow
47 page write-protection.
49 On fast page fault path, we will use cmpxchg to atomically set the spte W
62 +------------------------------------------------------------------------+
69 +------------------------------------------------------------------------+
70 | On fast page fault path: |
71 +------------------------------------+-----------------------------------+
73 +------------------------------------+-----------------------------------+
77 +------------------------------------+-----------------------------------+
82 | | pfn1 is re-alloced for gfn2. |
88 +------------------------------------+-----------------------------------+
92 | mark_page_dirty(vcpu->kvm, gfn1) |
94 +------------------------------------------------------------------------+
96 We dirty-log for gfn1, that means gfn2 is lost in dirty-bitmap.
99 to gfn. For indirect sp, we disabled fast page fault for simplicity.
104 - We have held the refcount of pfn that means the pfn can not be freed and
106 - The pfn is writable and therefore it cannot be shared between different gfns
113 In the origin code, the spte can be fast updated (non-atomically) if the
114 spte is read-only and the Accessed bit has already been set since the
117 But it is not true after fast page fault since the spte can be marked
120 +------------------------------------------------------------------------+
125 +------------------------------------+-----------------------------------+
127 +------------------------------------+-----------------------------------+
137 +------------------------------------+-----------------------------------+
138 | | on fast page fault path:: |
145 +------------------------------------+-----------------------------------+
155 +------------------------------------+-----------------------------------+
160 if it can be updated out of mmu-lock, see spte_has_volatile_bits(), it means,
166 otherwise rmap_write_protect will find a read-only spte, even though the
169 As mentioned before, the spte can be updated to writable out of mmu-lock on
170 fast page fault path, in order to easily audit the path, we see if TLBs need
172 function to update spte (present -> present).
174 Since the spte is "volatile" if it can be updated out of mmu-lock, we always
175 atomically update the spte, the race caused by fast page fault can be avoided,
182 page (via kvm_mmu_notifier_clear_flush_young), it marks the PTE as not-present
186 a fault is generated and the fast page fault mechanism described above is used
194 ------------
199 :Protects: - vm_list
204 :Protects: - hardware virtualization enable/disable
211 :Protects: - kvm_arch::{last_tsc_write,last_tsc_nsec,last_tsc_offset}
212 - tsc offset in vmcb
215 :Name: kvm->mmu_lock
218 :Protects: -shadow page/shadow tlb entry
221 :Name: kvm->srcu
224 :Protects: - kvm->memslots
225 - kvm->buses
226 :Comment: The srcu read lock must be held while accessing memslots (e.g.
227 when using gfn_to_* functions) and while accessing in-kernel
228 MMIO/PIO address->device structure mapping (kvm->buses).
229 The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu
236 :Comment: This is a per-CPU lock and it is used for VT-d posted-interrupts.
237 When VT-d posted-interrupts is supported and the VM has assigned
239 protected by blocked_vcpu_on_cpu_lock, when VT-d hardware issues