Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a48a622 authored by Wanpeng Li's avatar Wanpeng Li Committed by Radim Krčmář
Browse files

x86/kvm: virt_xxx memory barriers instead of mandatory barriers



virt_xxx memory barriers are implemented trivially using the low-level
__smp_xxx macros, __smp_xxx is equal to a compiler barrier for strong
TSO memory model, however, mandatory barriers will unconditional add
memory barriers, this patch replaces the rmb() in kvm_steal_clock() by
virt_rmb().

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
parent bd8fab39
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -396,9 +396,9 @@ static u64 kvm_steal_clock(int cpu)
	src = &per_cpu(steal_time, cpu);
	src = &per_cpu(steal_time, cpu);
	do {
	do {
		version = src->version;
		version = src->version;
		rmb();
		virt_rmb();
		steal = src->steal;
		steal = src->steal;
		rmb();
		virt_rmb();
	} while ((version & 1) || (version != src->version));
	} while ((version & 1) || (version != src->version));


	return steal;
	return steal;