Re: [kvm-unit-tests PATCH 3/3] x86: Define wrtsc(tsc) as wrmsr(MSR_IA32_TSC, tsc)

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

 



On 1/27/22 22:55, Jim Mattson wrote:
Remove some inline assembly code duplication and opportunistically
replace the magic constant, "0x10," with "MSR_IA32_TSC."

Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx>
---
  lib/x86/processor.h | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/x86/processor.h b/lib/x86/processor.h
index fe5add548261..117032a4895c 100644
--- a/lib/x86/processor.h
+++ b/lib/x86/processor.h
@@ -592,9 +592,7 @@ static inline unsigned long long rdtscp(u32 *aux)
static inline void wrtsc(u64 tsc)
  {
-	unsigned a = tsc, d = tsc >> 32;
-
-	asm volatile("wrmsr" : : "a"(a), "d"(d), "c"(0x10));
+	wrmsr(MSR_IA32_TSC, tsc);
  }
static inline void irq_disable(void)

Queued all three, thanks.

Paolo




[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