Commit | Line | Data |
---|---|---|
2e04ef76 RR |
1 | /* |
2 | * Things the lguest guest needs to know. Note: like all lguest interfaces, | |
3 | * this is subject to wild and random change between versions. | |
4 | */ | |
c37ae93d JS |
5 | #ifndef _LINUX_LGUEST_H |
6 | #define _LINUX_LGUEST_H | |
07ad157f | 7 | |
07ad157f | 8 | #ifndef __ASSEMBLY__ |
47aee45a | 9 | #include <linux/time.h> |
07ad157f | 10 | #include <asm/irq.h> |
c37ae93d | 11 | #include <asm/lguest_hcall.h> |
07ad157f | 12 | |
d7e28ffe RR |
13 | #define LG_CLOCK_MIN_DELTA 100UL |
14 | #define LG_CLOCK_MAX_DELTA ULONG_MAX | |
15 | ||
2e04ef76 RR |
16 | /*G:031 |
17 | * The second method of communicating with the Host is to via "struct | |
e1e72965 | 18 | * lguest_data". Once the Guest's initialization hypercall tells the Host where |
2e04ef76 RR |
19 | * this is, the Guest and Host both publish information in it. |
20 | :*/ | |
1842f23c | 21 | struct lguest_data { |
2e04ef76 RR |
22 | /* |
23 | * 512 == enabled (same as eflags in normal hardware). The Guest | |
24 | * changes interrupts so often that a hypercall is too slow. | |
25 | */ | |
07ad157f | 26 | unsigned int irq_enabled; |
b2b47c21 | 27 | /* Fine-grained interrupt disabling by the Guest */ |
07ad157f RR |
28 | DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS); |
29 | ||
2e04ef76 RR |
30 | /* |
31 | * The Host writes the virtual address of the last page fault here, | |
b2b47c21 | 32 | * which saves the Guest a hypercall. CR2 is the native register where |
2e04ef76 RR |
33 | * this address would normally be found. |
34 | */ | |
07ad157f RR |
35 | unsigned long cr2; |
36 | ||
6c8dca5d RR |
37 | /* Wallclock time set by the Host. */ |
38 | struct timespec time; | |
39 | ||
2e04ef76 RR |
40 | /* |
41 | * Interrupt pending set by the Host. The Guest should do a hypercall | |
42 | * if it re-enables interrupts and sees this set (to X86_EFLAGS_IF). | |
43 | */ | |
a32a8813 RR |
44 | int irq_pending; |
45 | ||
2e04ef76 RR |
46 | /* |
47 | * Async hypercall ring. Instead of directly making hypercalls, we can | |
b2b47c21 | 48 | * place them in here for processing the next time the Host wants. |
2e04ef76 RR |
49 | * This batching can be quite efficient. |
50 | */ | |
b2b47c21 RR |
51 | |
52 | /* 0xFF == done (set by Host), 0 == pending (set by Guest). */ | |
07ad157f | 53 | u8 hcall_status[LHCALL_RING_SIZE]; |
b2b47c21 | 54 | /* The actual registers for the hypercalls. */ |
b410e7b1 | 55 | struct hcall_args hcalls[LHCALL_RING_SIZE]; |
07ad157f | 56 | |
b2b47c21 | 57 | /* Fields initialized by the Host at boot: */ |
07ad157f RR |
58 | /* Memory not to try to access */ |
59 | unsigned long reserve_mem; | |
d7e28ffe RR |
60 | /* KHz for the TSC clock. */ |
61 | u32 tsc_khz; | |
07ad157f | 62 | |
b2b47c21 | 63 | /* Fields initialized by the Guest at boot: */ |
2f921b5b RR |
64 | /* Instruction to suppress interrupts even if enabled */ |
65 | unsigned long noirq_iret; | |
47436aa4 RR |
66 | /* Address above which page tables are all identical. */ |
67 | unsigned long kernel_address; | |
c18acd73 RR |
68 | /* The vector to try to use for system calls (0x40 or 0x80). */ |
69 | unsigned int syscall_vec; | |
07ad157f RR |
70 | }; |
71 | extern struct lguest_data lguest_data; | |
72 | #endif /* __ASSEMBLY__ */ | |
c37ae93d | 73 | #endif /* _LINUX_LGUEST_H */ |