KVM: x86/mmu: Move restore_acc_track_spte() to spte.h
restore_acc_track_spte() is pure SPTE bit manipulation, making it a good fit for spte.h. And now that the WARN_ON_ONCE() calls have been removed, there isn't any good reason to not inline it. This move also prepares for a follow-up commit that will need to call restore_acc_track_spte() from spte.c No functional change intended. Reviewed-by: Ben Gardon <bgardon@google.com> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: David Matlack <dmatlack@google.com> Message-Id: <20220119230739.2234394-11-dmatlack@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
77c23c77f9
commit
315d86da89
@ -645,20 +645,6 @@ static u64 mmu_spte_get_lockless(u64 *sptep)
|
||||
return __get_spte_lockless(sptep);
|
||||
}
|
||||
|
||||
/* Restore an acc-track PTE back to a regular PTE */
|
||||
static u64 restore_acc_track_spte(u64 spte)
|
||||
{
|
||||
u64 saved_bits = (spte >> SHADOW_ACC_TRACK_SAVED_BITS_SHIFT)
|
||||
& SHADOW_ACC_TRACK_SAVED_BITS_MASK;
|
||||
|
||||
spte &= ~shadow_acc_track_mask;
|
||||
spte &= ~(SHADOW_ACC_TRACK_SAVED_BITS_MASK <<
|
||||
SHADOW_ACC_TRACK_SAVED_BITS_SHIFT);
|
||||
spte |= saved_bits;
|
||||
|
||||
return spte;
|
||||
}
|
||||
|
||||
/* Returns the Accessed status of the PTE and resets it at the same time. */
|
||||
static bool mmu_spte_age(u64 *sptep)
|
||||
{
|
||||
|
@ -418,6 +418,21 @@ bool make_spte(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp,
|
||||
u64 make_nonleaf_spte(u64 *child_pt, bool ad_disabled);
|
||||
u64 make_mmio_spte(struct kvm_vcpu *vcpu, u64 gfn, unsigned int access);
|
||||
u64 mark_spte_for_access_track(u64 spte);
|
||||
|
||||
/* Restore an acc-track PTE back to a regular PTE */
|
||||
static inline u64 restore_acc_track_spte(u64 spte)
|
||||
{
|
||||
u64 saved_bits = (spte >> SHADOW_ACC_TRACK_SAVED_BITS_SHIFT)
|
||||
& SHADOW_ACC_TRACK_SAVED_BITS_MASK;
|
||||
|
||||
spte &= ~shadow_acc_track_mask;
|
||||
spte &= ~(SHADOW_ACC_TRACK_SAVED_BITS_MASK <<
|
||||
SHADOW_ACC_TRACK_SAVED_BITS_SHIFT);
|
||||
spte |= saved_bits;
|
||||
|
||||
return spte;
|
||||
}
|
||||
|
||||
u64 kvm_mmu_changed_pte_notifier_make_spte(u64 old_spte, kvm_pfn_t new_pfn);
|
||||
|
||||
void kvm_mmu_reset_all_pte_masks(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user