Lines Matching refs:spte

16 #include "spte.h"
74 u64 spte = generation_mmio_spte_mask(gen);
80 spte |= shadow_mmio_value | access;
81 spte |= gpa | shadow_nonpresent_or_rsvd_mask;
82 spte |= (gpa & shadow_nonpresent_or_rsvd_mask)
85 return spte;
114 bool spte_has_volatile_bits(u64 spte)
117 * Always atomically update spte if it can be updated
122 if (!is_writable_pte(spte) && is_mmu_writable_spte(spte))
125 if (is_access_track_spte(spte))
128 if (spte_ad_enabled(spte)) {
129 if (!(spte & shadow_accessed_mask) ||
130 (is_writable_pte(spte) && !(spte & shadow_dirty_mask)))
144 u64 spte = SPTE_MMU_PRESENT_MASK;
150 spte |= SPTE_TDP_AD_DISABLED;
152 spte |= SPTE_TDP_AD_WRPROT_ONLY;
160 spte |= shadow_present_mask;
162 spte |= spte_shadow_accessed_mask(spte);
182 spte |= shadow_x_mask;
184 spte |= shadow_nx_mask;
187 spte |= shadow_user_mask;
190 spte |= PT_PAGE_SIZE_MASK;
193 spte |= static_call(kvm_x86_get_mt_mask)(vcpu, gfn,
196 spte |= shadow_host_writable_mask;
201 spte |= shadow_me_value;
203 spte |= (u64)pfn << PAGE_SHIFT;
206 spte |= PT_WRITABLE_MASK | shadow_mmu_writable_mask;
209 * Optimization: for pte sync, if spte was writable the hash
226 spte &= ~(PT_WRITABLE_MASK | shadow_mmu_writable_mask);
231 spte |= spte_shadow_dirty_mask(spte);
235 spte = mark_spte_for_access_track(spte);
237 WARN_ONCE(is_rsvd_spte(&vcpu->arch.mmu->shadow_zero_check, spte, level),
238 "spte = 0x%llx, level = %d, rsvd bits = 0x%llx", spte, level,
239 get_rsvd_bits(&vcpu->arch.mmu->shadow_zero_check, spte, level));
241 if ((spte & PT_WRITABLE_MASK) && kvm_slot_dirty_track_enabled(slot)) {
247 *new_spte = spte;
251 static u64 make_spte_executable(u64 spte)
253 bool is_access_track = is_access_track_spte(spte);
256 spte = restore_acc_track_spte(spte);
258 spte &= ~shadow_nx_mask;
259 spte |= shadow_x_mask;
262 spte = mark_spte_for_access_track(spte);
264 return spte;
312 u64 spte = SPTE_MMU_PRESENT_MASK;
314 spte |= __pa(child_pt) | shadow_present_mask | PT_WRITABLE_MASK |
318 spte |= SPTE_TDP_AD_DISABLED;
320 spte |= shadow_accessed_mask;
322 return spte;
341 u64 mark_spte_for_access_track(u64 spte)
343 if (spte_ad_enabled(spte))
344 return spte & ~shadow_accessed_mask;
346 if (is_access_track_spte(spte))
347 return spte;
349 check_spte_writable_invariants(spte);
351 WARN_ONCE(spte & (SHADOW_ACC_TRACK_SAVED_BITS_MASK <<
355 spte |= (spte & SHADOW_ACC_TRACK_SAVED_BITS_MASK) <<
357 spte &= ~shadow_acc_track_mask;
359 return spte;