Skip to contentSkip to conversation

kvm, mmu: fix incorrect return of spte

PATCH Applied Zhao Jin 3 participants 3 messages Sep 19, 2011

Subsystems (3)
lore
Share & tools
lore

Zhao Jin

author
#0 lore raw

PATCH 1/1 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.

---
 arch/x86/kvm/mmu.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/x86/kvm/mmu.c +2 -1
index 1c5b693..8e8da79 100644
@@ -400,7 +400,8 @@ static u64 __update_clear_spte_slow(u64 *sptep, u64 spte)
 
 	/* xchg acts as a barrier before the setting of the high bits */
 	orig.spte_low = xchg(&ssptep->spte_low, sspte.spte_low);
-	orig.spte_high = ssptep->spte_high = sspte.spte_high;
+	orig.spte_high = ssptep->spte_high;
+	ssptep->spte_high = sspte.spte_high;
 	count_spte_clear(sptep, spte);
 
 	return orig.spte;
Signature · 1 line
1.7.4.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Zhao Jin

__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.

Thanks for your fixing.

#2 lore raw
In reply to Zhao Jin
Quoted 8 lines · Zhao Jin

__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.

---
 arch/x86/kvm/mmu.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Applied, thanks.