Displaying 6 results from an estimated 6 matches for "vmi_rdtsc".
2007 Apr 18
2
[RFC, PATCH 17/24] i386 Vmi msr patch
...atic inline void wrmsr(const u32 msr, const u32 valLo, const u32 valHi)
+{
+ vmi_wrap_call(
+ WRMSR, "wrmsr",
+ VMI_NO_OUTPUT,
+ 3, XCONC("a"(valLo), "d"(valHi), "c"(msr)),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory"));
+}
+
+static inline u64 vmi_rdtsc(void)
+{
+ u64 ret;
+ vmi_wrap_call(
+ RDTSC, "rdtsc",
+ VMI_OREG64 (ret),
+ 0, VMI_NO_INPUT,
+ VMI_CLOBBER(TWO_RETURNS));
+ return ret;
+}
+
+#define rdtsc(low,high) \
+do { \
+ u64 _val = vmi_rdtsc(); \
+ low = (u32)_val; \
+ high = (u32)(_val >> 32); \
+} while (0)
+
+#define...
2007 Apr 18
2
[RFC, PATCH 17/24] i386 Vmi msr patch
...atic inline void wrmsr(const u32 msr, const u32 valLo, const u32 valHi)
+{
+ vmi_wrap_call(
+ WRMSR, "wrmsr",
+ VMI_NO_OUTPUT,
+ 3, XCONC("a"(valLo), "d"(valHi), "c"(msr)),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory"));
+}
+
+static inline u64 vmi_rdtsc(void)
+{
+ u64 ret;
+ vmi_wrap_call(
+ RDTSC, "rdtsc",
+ VMI_OREG64 (ret),
+ 0, VMI_NO_INPUT,
+ VMI_CLOBBER(TWO_RETURNS));
+ return ret;
+}
+
+#define rdtsc(low,high) \
+do { \
+ u64 _val = vmi_rdtsc(); \
+ low = (u32)_val; \
+ high = (u32)(_val >> 32); \
+} while (0)
+
+#define...
2007 Apr 18
1
[RFC, PATCH 21/24] i386 Vmi proc node
...latile("rdtsc" : "=&A" (tsc));
+ return tsc;
+}
+
+static unsigned long long hypercall_cycles = 0xffffffffULL;
+static void time_hypercall(void)
+{
+ unsigned long long tsc_start, tsc_end, cycles;
+ int i;
+ for (i = 0; i < 1000; i++) {
+ tsc_start = get_tsc();
+ vmi_rdtsc();
+ tsc_end = get_tsc();
+ cycles = tsc_end - tsc_start;
+ if (cycles < hypercall_cycles)
+ hypercall_cycles = cycles;
+ }
+}
+
+static unsigned long long page_fault_cycles = 0xffffffffULL;
+static void time_page_fault(void)
+{
+ unsigned long long tsc_start, tsc_end, cycles;
+ int i;
+ fo...
2007 Apr 18
1
[RFC, PATCH 21/24] i386 Vmi proc node
...latile("rdtsc" : "=&A" (tsc));
+ return tsc;
+}
+
+static unsigned long long hypercall_cycles = 0xffffffffULL;
+static void time_hypercall(void)
+{
+ unsigned long long tsc_start, tsc_end, cycles;
+ int i;
+ for (i = 0; i < 1000; i++) {
+ tsc_start = get_tsc();
+ vmi_rdtsc();
+ tsc_end = get_tsc();
+ cycles = tsc_end - tsc_start;
+ if (cycles < hypercall_cycles)
+ hypercall_cycles = cycles;
+ }
+}
+
+static unsigned long long page_fault_cycles = 0xffffffffULL;
+static void time_page_fault(void)
+{
+ unsigned long long tsc_start, tsc_end, cycles;
+ int i;
+ fo...
2007 Apr 18
4
[RFC, PATCH 1/24] i386 Vmi documentation
...er
+ ECX = sub-level query (nonstandard)
+ Outputs: EAX = CPUID dword 0
+ EBX = CPUID dword 1
+ ECX = CPUID dword 2
+ EDX = CPUID dword 3
+ Clobbers: Flags only
+ Segments: Standard
+
+ VMI_RDTSC
+
+ VMICALL VMI_UINT64 VMI_RDTSC(void);
+
+ The RDTSC instruction provides a cycles counter which may be made
+ visible to userspace. For better or worse, many applications have made
+ use of this feature to implement userspace timers, database indices, or
+ for micro...
2007 Apr 18
4
[RFC, PATCH 1/24] i386 Vmi documentation
...er
+ ECX = sub-level query (nonstandard)
+ Outputs: EAX = CPUID dword 0
+ EBX = CPUID dword 1
+ ECX = CPUID dword 2
+ EDX = CPUID dword 3
+ Clobbers: Flags only
+ Segments: Standard
+
+ VMI_RDTSC
+
+ VMICALL VMI_UINT64 VMI_RDTSC(void);
+
+ The RDTSC instruction provides a cycles counter which may be made
+ visible to userspace. For better or worse, many applications have made
+ use of this feature to implement userspace timers, database indices, or
+ for micro...