Commit 77c23c77 authored by David Matlack's avatar David Matlack Committed by Paolo Bonzini

KVM: x86/mmu: Drop new_spte local variable from restore_acc_track_spte()

The new_spte local variable is unnecessary. Deleting it can save a line
of code and simplify the remaining lines a bit.

No functional change intended.
Suggested-by: default avatarSean Christopherson <seanjc@google.com>
Signed-off-by: default avatarDavid Matlack <dmatlack@google.com>
Message-Id: <20220119230739.2234394-10-dmatlack@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 59940e76
...@@ -648,16 +648,15 @@ static u64 mmu_spte_get_lockless(u64 *sptep) ...@@ -648,16 +648,15 @@ static u64 mmu_spte_get_lockless(u64 *sptep)
/* Restore an acc-track PTE back to a regular PTE */ /* Restore an acc-track PTE back to a regular PTE */
static u64 restore_acc_track_spte(u64 spte) static u64 restore_acc_track_spte(u64 spte)
{ {
u64 new_spte = spte;
u64 saved_bits = (spte >> SHADOW_ACC_TRACK_SAVED_BITS_SHIFT) u64 saved_bits = (spte >> SHADOW_ACC_TRACK_SAVED_BITS_SHIFT)
& SHADOW_ACC_TRACK_SAVED_BITS_MASK; & SHADOW_ACC_TRACK_SAVED_BITS_MASK;
new_spte &= ~shadow_acc_track_mask; spte &= ~shadow_acc_track_mask;
new_spte &= ~(SHADOW_ACC_TRACK_SAVED_BITS_MASK << spte &= ~(SHADOW_ACC_TRACK_SAVED_BITS_MASK <<
SHADOW_ACC_TRACK_SAVED_BITS_SHIFT); SHADOW_ACC_TRACK_SAVED_BITS_SHIFT);
new_spte |= saved_bits; spte |= saved_bits;
return new_spte; return spte;
} }
/* Returns the Accessed status of the PTE and resets it at the same time. */ /* Returns the Accessed status of the PTE and resets it at the same time. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment