On Fri, Mar 09, 2007 at 08:10:03PM +0200, Avi Kivity wrote:
Joerg Roedel wrote:
From: Joerg Roedel <joerg.roedel@xxxxxxx>why not use the RDTSCP macro here?
This patch simplifies the get_cycles_sync() function by removing
the #ifdefs from it. Further it introduces an optimization for AMD
processors. There the RDTSCP instruction is used instead of CPUID;RDTSC
which is helpfull if the kernel runs as a KVM guest. Running as a guest
makes CPUID very expensive because it causes an intercept of the guest.
+#define RDTSCP ".byte 0x0f, 0x01, 0xf9"
+ alternative_io_two("cpuid\nrdtsc",
+ "rdtsc", X86_FEATURE_SYNC_RDTSC,
+ ".byte 0x0f, 0x01, 0xf9", X86_FEATURE_RDTSCP,
Does this macro exist? I couldn't found it in the current git tree. And
the rdtscp macros in msr.h use the plain opcode too.