[kvm-unit-test PATCH] kvmclock: serialize RDTSC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Serialize RDTSC so its executed inside kvmclock_read 
section.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=922285

Signed-off-by: Marcelo Tosatti <mtosatti@xxxxxxxxxx>

diff --git a/x86/kvmclock.c b/x86/kvmclock.c
index 0624da3..5b831c5 100644
--- a/x86/kvmclock.c
+++ b/x86/kvmclock.c
@@ -177,10 +177,10 @@ cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src)
 
 	do {
 		version = pvclock_get_time_values(&shadow, src);
-		barrier();
+		mb();
 		offset = pvclock_get_nsec_offset(&shadow);
 		ret = shadow.system_timestamp + offset;
-		barrier();
+		mb();
 	} while (version != src->version);
 
 	if ((valid_flags & PVCLOCK_RAW_CYCLE_BIT) ||
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux