Skip to content

Commit 41bc318

Browse files
Zhao Jinavikivity
authored andcommitted
KVM: MMU: fix incorrect return of spte
__update_clear_spte_slow should return original spte while the current code returns low half of original spte combined with high half of new spte. Signed-off-by: Zhao Jin <cronozhj@gmail.com> Reviewed-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
1 parent b172e38 commit 41bc318

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎arch/x86/kvm/mmu.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,8 @@ static u64 __update_clear_spte_slow(u64 *sptep, u64 spte)
400400

401401
/* xchg acts as a barrier before the setting of the high bits */
402402
orig.spte_low = xchg(&ssptep->spte_low, sspte.spte_low);
403-
orig.spte_high = ssptep->spte_high = sspte.spte_high;
403+
orig.spte_high = ssptep->spte_high;
404+
ssptep->spte_high = sspte.spte_high;
404405
count_spte_clear(sptep, spte);
405406

406407
return orig.spte;

0 commit comments

Comments
 (0)