search for: vmi_no_input

Displaying 12 results from an estimated 12 matches for "vmi_no_input".

2007 Apr 18
0
[RFC, PATCH 13/24] i386 Vmi system header
...val) +{ + vmi_wrap_call( + SetCR4, "mov %0, %%cr4", + VMI_NO_OUTPUT, + 1, VMI_IREG1(val), + VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory")); +} + +static inline u32 read_cr0(void) +{ + u32 ret; + vmi_wrap_call( + GetCR0, "mov %%cr0, %%eax", + VMI_OREG1(ret), + 0, VMI_NO_INPUT, + VMI_CLOBBER(ONE_RETURN)); + return ret; +} + +static inline u32 read_cr2(void) +{ + u32 ret; + vmi_wrap_call( + GetCR2, "mov %%cr2, %%eax", + VMI_OREG1(ret), + 0, VMI_NO_INPUT, + VMI_CLOBBER(ONE_RETURN)); + return ret; +} + +static inline u32 read_cr3(void) +{ + u32 ret; + vmi_wra...
2007 Apr 18
0
[RFC, PATCH 13/24] i386 Vmi system header
...val) +{ + vmi_wrap_call( + SetCR4, "mov %0, %%cr4", + VMI_NO_OUTPUT, + 1, VMI_IREG1(val), + VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory")); +} + +static inline u32 read_cr0(void) +{ + u32 ret; + vmi_wrap_call( + GetCR0, "mov %%cr0, %%eax", + VMI_OREG1(ret), + 0, VMI_NO_INPUT, + VMI_CLOBBER(ONE_RETURN)); + return ret; +} + +static inline u32 read_cr2(void) +{ + u32 ret; + vmi_wrap_call( + GetCR2, "mov %%cr2, %%eax", + VMI_OREG1(ret), + 0, VMI_NO_INPUT, + VMI_CLOBBER(ONE_RETURN)); + return ret; +} + +static inline u32 read_cr3(void) +{ + u32 ret; + vmi_wra...
2007 Apr 18
3
[RFC, PATCH 10/24] i386 Vmi descriptor changes
...+ vmi_wrap_call(GetIDT, "sidt (%0)", + VMI_NO_OUTPUT, + 1, VMI_IREG1 (dtr), + VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory")); +} + +static inline VMI_SELECTOR vmi_get_ldt(void) +{ + VMI_SELECTOR ret; + vmi_wrap_call( + GetLDT, "sldt %%ax", + VMI_OREG1 (ret), + 0, VMI_NO_INPUT, + VMI_CLOBBER(ONE_RETURN)); + return ret; +} + +static inline VMI_SELECTOR vmi_get_tr(void) +{ + VMI_SELECTOR ret; + vmi_wrap_call( + GetTR, "str %%ax", + VMI_OREG1 (ret), + 0, VMI_NO_INPUT, + VMI_CLOBBER(ONE_RETURN)); + return ret; +} + +#define load_TR_desc() load_tr(GDT_ENTRY_TSS...
2007 Apr 18
3
[RFC, PATCH 10/24] i386 Vmi descriptor changes
...+ vmi_wrap_call(GetIDT, "sidt (%0)", + VMI_NO_OUTPUT, + 1, VMI_IREG1 (dtr), + VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory")); +} + +static inline VMI_SELECTOR vmi_get_ldt(void) +{ + VMI_SELECTOR ret; + vmi_wrap_call( + GetLDT, "sldt %%ax", + VMI_OREG1 (ret), + 0, VMI_NO_INPUT, + VMI_CLOBBER(ONE_RETURN)); + return ret; +} + +static inline VMI_SELECTOR vmi_get_tr(void) +{ + VMI_SELECTOR ret; + vmi_wrap_call( + GetTR, "str %%ax", + VMI_OREG1 (ret), + 0, VMI_NO_INPUT, + VMI_CLOBBER(ONE_RETURN)); + return ret; +} + +#define load_TR_desc() load_tr(GDT_ENTRY_TSS...
2007 Apr 18
2
[RFC, PATCH 17/24] i386 Vmi msr patch
...quot;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 rdtscl(low) \ +do { \ + u64 _val = vmi_rdtsc(); \ + low = (u32)_val; \ +} while (0) + +#define rdtscll(va...
2007 Apr 18
2
[RFC, PATCH 17/24] i386 Vmi msr patch
...quot;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 rdtscl(low) \ +do { \ + u64 _val = vmi_rdtsc(); \ + low = (u32)_val; \ +} while (0) + +#define rdtscll(va...
2007 Apr 18
0
[RFC, PATCH 23/24] i386 Vmi timer patch
...* + * All three views of time are accessible through the VMI cycle + * counters. + */ + +static inline VMI_CYCLES vmi_get_cycle_frequency(void) +{ + VMI_CYCLES ret; + vmi_wrap_call( + GetCycleFrequency, "xor %%eax, %%eax;" + "xor %%edx, %%edx;", + VMI_OREG64 (ret), + 0, VMI_NO_INPUT, + VMI_CLOBBER(TWO_RETURNS)); + return ret; +} + +static inline VMI_CYCLES vmi_get_real_cycles(void) +{ + VMI_CYCLES ret; + vmi_wrap_call( + GetCycleCounter, "rdtsc", + VMI_OREG64 (ret), + 1, VMI_IREG1(VMI_CYCLES_REAL), + VMI_CLOBBER(TWO_RETURNS)); + return ret; +} + +static inline V...
2007 Apr 18
0
[RFC, PATCH 23/24] i386 Vmi timer patch
...* + * All three views of time are accessible through the VMI cycle + * counters. + */ + +static inline VMI_CYCLES vmi_get_cycle_frequency(void) +{ + VMI_CYCLES ret; + vmi_wrap_call( + GetCycleFrequency, "xor %%eax, %%eax;" + "xor %%edx, %%edx;", + VMI_OREG64 (ret), + 0, VMI_NO_INPUT, + VMI_CLOBBER(TWO_RETURNS)); + return ret; +} + +static inline VMI_CYCLES vmi_get_real_cycles(void) +{ + VMI_CYCLES ret; + vmi_wrap_call( + GetCycleCounter, "rdtsc", + VMI_OREG64 (ret), + 1, VMI_IREG1(VMI_CYCLES_REAL), + VMI_CLOBBER(TWO_RETURNS)); + return ret; +} + +static inline V...
2007 Apr 18
1
[RFC, PATCH 16/24] i386 Vmi io header
...ng a write to a chipset scratch + * register. This is an efficient and easy way to slow down + * I/O regardless of processor speed, but useless in a virtual + * machine. + */ +static inline void vmi_iodelay(void) +{ + vmi_wrap_call( + IODelay, "outb %%al, $0x80", + VMI_NO_OUTPUT, + 0, VMI_NO_INPUT, + VMI_CLOBBER(ZERO_RETURNS)); +} + +#define __SLOW_DOWN_IO vmi_iodelay() + +#define __BUILDOUTINST(bwl,bw,value,port) \ + vmi_out##bwl(value, port) +#define __BUILDININST(bwl,bw,value,port) \ + do { value = vmi_in##bwl(port); } while (0) +#define __BUILDOUTSINST(bwl,addr,count,port) \ + vmi_outs#...
2007 Apr 18
1
[RFC, PATCH 16/24] i386 Vmi io header
...ng a write to a chipset scratch + * register. This is an efficient and easy way to slow down + * I/O regardless of processor speed, but useless in a virtual + * machine. + */ +static inline void vmi_iodelay(void) +{ + vmi_wrap_call( + IODelay, "outb %%al, $0x80", + VMI_NO_OUTPUT, + 0, VMI_NO_INPUT, + VMI_CLOBBER(ZERO_RETURNS)); +} + +#define __SLOW_DOWN_IO vmi_iodelay() + +#define __BUILDOUTINST(bwl,bw,value,port) \ + vmi_out##bwl(value, port) +#define __BUILDININST(bwl,bw,value,port) \ + do { value = vmi_in##bwl(port); } while (0) +#define __BUILDOUTSINST(bwl,addr,count,port) \ + vmi_outs#...
2007 Apr 18
3
[RFC, PATCH 4/24] i386 Vmi inline implementation
...XCSTR(vmi_nop_pad) "\n\t" \ + XCSTR(vmi_padded_finish) "\n\t" \ + \ + XCSTR(vmi_annotate(VMI_CALL_##call)) "\n\t" \ + \ + :: input ); \ + asm volatile ( "" : output :: clobber ); \ +} while (0) + +#define VMI_NO_INPUT +#define VMI_NO_OUTPUT + +struct vmi_annotation { + unsigned long vmi_call; + unsigned char *nativeEIP; + unsigned char *translationEIP; + unsigned char native_size; + unsigned char translation_size; + char nop_size; + unsigned char pad; +}; + +extern VMI_UINT8 hypervisor_found; +extern VMI_UINT8...
2007 Apr 18
3
[RFC, PATCH 4/24] i386 Vmi inline implementation
...XCSTR(vmi_nop_pad) "\n\t" \ + XCSTR(vmi_padded_finish) "\n\t" \ + \ + XCSTR(vmi_annotate(VMI_CALL_##call)) "\n\t" \ + \ + :: input ); \ + asm volatile ( "" : output :: clobber ); \ +} while (0) + +#define VMI_NO_INPUT +#define VMI_NO_OUTPUT + +struct vmi_annotation { + unsigned long vmi_call; + unsigned char *nativeEIP; + unsigned char *translationEIP; + unsigned char native_size; + unsigned char translation_size; + char nop_size; + unsigned char pad; +}; + +extern VMI_UINT8 hypervisor_found; +extern VMI_UINT8...