Lines Matching refs:spte

201 static inline bool is_removed_spte(u64 spte)  in is_removed_spte()  argument
203 return spte == REMOVED_SPTE; in is_removed_spte()
222 static inline bool is_mmio_spte(u64 spte) in is_mmio_spte() argument
224 return (spte & shadow_mmio_mask) == shadow_mmio_value && in is_mmio_spte()
249 static inline bool spte_ad_enabled(u64 spte) in spte_ad_enabled() argument
251 MMU_WARN_ON(!is_shadow_present_pte(spte)); in spte_ad_enabled()
252 return (spte & SPTE_TDP_AD_MASK) != SPTE_TDP_AD_DISABLED_MASK; in spte_ad_enabled()
255 static inline bool spte_ad_need_write_protect(u64 spte) in spte_ad_need_write_protect() argument
257 MMU_WARN_ON(!is_shadow_present_pte(spte)); in spte_ad_need_write_protect()
263 return (spte & SPTE_TDP_AD_MASK) != SPTE_TDP_AD_ENABLED_MASK; in spte_ad_need_write_protect()
266 static inline u64 spte_shadow_accessed_mask(u64 spte) in spte_shadow_accessed_mask() argument
268 MMU_WARN_ON(!is_shadow_present_pte(spte)); in spte_shadow_accessed_mask()
269 return spte_ad_enabled(spte) ? shadow_accessed_mask : 0; in spte_shadow_accessed_mask()
272 static inline u64 spte_shadow_dirty_mask(u64 spte) in spte_shadow_dirty_mask() argument
274 MMU_WARN_ON(!is_shadow_present_pte(spte)); in spte_shadow_dirty_mask()
275 return spte_ad_enabled(spte) ? shadow_dirty_mask : 0; in spte_shadow_dirty_mask()
278 static inline bool is_access_track_spte(u64 spte) in is_access_track_spte() argument
280 return !spte_ad_enabled(spte) && (spte & shadow_acc_track_mask) == 0; in is_access_track_spte()
293 static inline bool is_executable_pte(u64 spte) in is_executable_pte() argument
295 return (spte & (shadow_x_mask | shadow_nx_mask)) == shadow_x_mask; in is_executable_pte()
303 static inline bool is_accessed_spte(u64 spte) in is_accessed_spte() argument
305 u64 accessed_mask = spte_shadow_accessed_mask(spte); in is_accessed_spte()
307 return accessed_mask ? spte & accessed_mask in is_accessed_spte()
308 : !is_access_track_spte(spte); in is_accessed_spte()
311 static inline bool is_dirty_spte(u64 spte) in is_dirty_spte() argument
313 u64 dirty_mask = spte_shadow_dirty_mask(spte); in is_dirty_spte()
315 return dirty_mask ? spte & dirty_mask : spte & PT_WRITABLE_MASK; in is_dirty_spte()
339 u64 spte, int level) in is_rsvd_spte() argument
341 return __is_bad_mt_xwr(rsvd_check, spte) || in is_rsvd_spte()
342 __is_rsvd_bits_set(rsvd_check, spte, level); in is_rsvd_spte()
417 static inline void check_spte_writable_invariants(u64 spte) in check_spte_writable_invariants() argument
419 if (spte & shadow_mmu_writable_mask) in check_spte_writable_invariants()
420 WARN_ONCE(!(spte & shadow_host_writable_mask), in check_spte_writable_invariants()
422 spte); in check_spte_writable_invariants()
424 WARN_ONCE(is_writable_pte(spte), in check_spte_writable_invariants()
425 "kvm: Writable SPTE is not MMU-writable: %llx", spte); in check_spte_writable_invariants()
428 static inline bool is_mmu_writable_spte(u64 spte) in is_mmu_writable_spte() argument
430 return spte & shadow_mmu_writable_mask; in is_mmu_writable_spte()
433 static inline u64 get_mmio_spte_generation(u64 spte) in get_mmio_spte_generation() argument
437 gen = (spte & MMIO_SPTE_GEN_LOW_MASK) >> MMIO_SPTE_GEN_LOW_SHIFT; in get_mmio_spte_generation()
438 gen |= (spte & MMIO_SPTE_GEN_HIGH_MASK) >> MMIO_SPTE_GEN_HIGH_SHIFT; in get_mmio_spte_generation()
442 bool spte_has_volatile_bits(u64 spte);
453 u64 mark_spte_for_access_track(u64 spte);
456 static inline u64 restore_acc_track_spte(u64 spte) in restore_acc_track_spte() argument
458 u64 saved_bits = (spte >> SHADOW_ACC_TRACK_SAVED_BITS_SHIFT) in restore_acc_track_spte()
461 spte &= ~shadow_acc_track_mask; in restore_acc_track_spte()
462 spte &= ~(SHADOW_ACC_TRACK_SAVED_BITS_MASK << in restore_acc_track_spte()
464 spte |= saved_bits; in restore_acc_track_spte()
466 return spte; in restore_acc_track_spte()