debuggers.hg

view xen/include/asm-x86/time.h @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 2011 +0000 (2011-01-25)
parents 644c8d0d7aed
children
line source
2 #ifndef __X86_TIME_H__
3 #define __X86_TIME_H__
5 #include <asm/msr.h>
7 /*
8 * PV TSC emulation modes:
9 * 0 = guest rdtsc/p executed natively when monotonicity can be guaranteed
10 * and emulated otherwise (with frequency scaled if necessary)
11 * 1 = guest rdtsc/p always emulated at 1GHz (kernel and user)
12 * 2 = guest rdtsc always executed natively (no monotonicity/frequency
13 * guarantees); guest rdtscp emulated at native frequency if
14 * unsupported by h/w, else executed natively
15 * 3 = same as 2, except xen manages TSC_AUX register so guest can
16 * determine when a restore/migration has occurred and assumes
17 * guest obtains/uses pvclock-like mechanism to adjust for
18 * monotonicity and frequency changes
19 */
20 #define TSC_MODE_DEFAULT 0
21 #define TSC_MODE_ALWAYS_EMULATE 1
22 #define TSC_MODE_NEVER_EMULATE 2
23 #define TSC_MODE_PVRDTSCP 3
25 typedef u64 cycles_t;
27 static inline cycles_t get_cycles(void)
28 {
29 cycles_t c;
30 rdtscll(c);
31 return c;
32 }
34 unsigned long
35 mktime (unsigned int year, unsigned int mon,
36 unsigned int day, unsigned int hour,
37 unsigned int min, unsigned int sec);
39 int time_suspend(void);
40 int time_resume(void);
42 void init_percpu_time(void);
44 struct ioreq;
45 int dom0_pit_access(struct ioreq *ioreq);
47 int cpu_frequency_change(u64 freq);
49 struct tm;
50 struct tm wallclock_time(void);
52 void pit_broadcast_enter(void);
53 void pit_broadcast_exit(void);
54 int pit_broadcast_is_available(void);
56 uint64_t acpi_pm_tick_to_ns(uint64_t ticks);
57 uint64_t ns_to_acpi_pm_tick(uint64_t ns);
59 uint64_t tsc_ticks2ns(uint64_t ticks);
61 void pv_soft_rdtsc(struct vcpu *v, struct cpu_user_regs *regs, int rdtscp);
62 u64 gtime_to_gtsc(struct domain *d, u64 time);
63 u64 gtsc_to_gtime(struct domain *d, u64 tsc);
65 void tsc_set_info(struct domain *d, uint32_t tsc_mode, uint64_t elapsed_nsec,
66 uint32_t gtsc_khz, uint32_t incarnation);
68 void tsc_get_info(struct domain *d, uint32_t *tsc_mode, uint64_t *elapsed_nsec,
69 uint32_t *gtsc_khz, uint32_t *incarnation);
72 void force_update_vcpu_system_time(struct vcpu *v);
74 int host_tsc_is_safe(void);
75 void cpuid_time_leaf(uint32_t sub_idx, unsigned int *eax, unsigned int *ebx,
76 unsigned int *ecx, unsigned int *edx);
78 u64 stime2tsc(s_time_t stime);
80 #endif /* __X86_TIME_H__ */