diff options
Diffstat (limited to 'drivers/lguest/lg.h')
-rw-r--r-- | drivers/lguest/lg.h | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/drivers/lguest/lg.h b/drivers/lguest/lg.h index af92a176697f..d4e8979735cb 100644 --- a/drivers/lguest/lg.h +++ b/drivers/lguest/lg.h | |||
@@ -49,7 +49,7 @@ struct lg_cpu { | |||
49 | u32 cr2; | 49 | u32 cr2; |
50 | int ts; | 50 | int ts; |
51 | u32 esp1; | 51 | u32 esp1; |
52 | u8 ss1; | 52 | u16 ss1; |
53 | 53 | ||
54 | /* Bitmap of what has changed: see CHANGED_* above. */ | 54 | /* Bitmap of what has changed: see CHANGED_* above. */ |
55 | int changed; | 55 | int changed; |
@@ -71,9 +71,7 @@ struct lg_cpu { | |||
71 | /* Virtual clock device */ | 71 | /* Virtual clock device */ |
72 | struct hrtimer hrt; | 72 | struct hrtimer hrt; |
73 | 73 | ||
74 | /* Do we need to stop what we're doing and return to userspace? */ | 74 | /* Did the Guest tell us to halt? */ |
75 | int break_out; | ||
76 | wait_queue_head_t break_wq; | ||
77 | int halted; | 75 | int halted; |
78 | 76 | ||
79 | /* Pending virtual interrupts */ | 77 | /* Pending virtual interrupts */ |
@@ -82,6 +80,16 @@ struct lg_cpu { | |||
82 | struct lg_cpu_arch arch; | 80 | struct lg_cpu_arch arch; |
83 | }; | 81 | }; |
84 | 82 | ||
83 | struct lg_eventfd { | ||
84 | unsigned long addr; | ||
85 | struct file *event; | ||
86 | }; | ||
87 | |||
88 | struct lg_eventfd_map { | ||
89 | unsigned int num; | ||
90 | struct lg_eventfd map[]; | ||
91 | }; | ||
92 | |||
85 | /* The private info the thread maintains about the guest. */ | 93 | /* The private info the thread maintains about the guest. */ |
86 | struct lguest | 94 | struct lguest |
87 | { | 95 | { |
@@ -102,6 +110,8 @@ struct lguest | |||
102 | unsigned int stack_pages; | 110 | unsigned int stack_pages; |
103 | u32 tsc_khz; | 111 | u32 tsc_khz; |
104 | 112 | ||
113 | struct lg_eventfd_map *eventfds; | ||
114 | |||
105 | /* Dead? */ | 115 | /* Dead? */ |
106 | const char *dead; | 116 | const char *dead; |
107 | }; | 117 | }; |
@@ -137,9 +147,13 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user); | |||
137 | * in the kernel. */ | 147 | * in the kernel. */ |
138 | #define pgd_flags(x) (pgd_val(x) & ~PAGE_MASK) | 148 | #define pgd_flags(x) (pgd_val(x) & ~PAGE_MASK) |
139 | #define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT) | 149 | #define pgd_pfn(x) (pgd_val(x) >> PAGE_SHIFT) |
150 | #define pmd_flags(x) (pmd_val(x) & ~PAGE_MASK) | ||
151 | #define pmd_pfn(x) (pmd_val(x) >> PAGE_SHIFT) | ||
140 | 152 | ||
141 | /* interrupts_and_traps.c: */ | 153 | /* interrupts_and_traps.c: */ |
142 | void maybe_do_interrupt(struct lg_cpu *cpu); | 154 | unsigned int interrupt_pending(struct lg_cpu *cpu, bool *more); |
155 | void try_deliver_interrupt(struct lg_cpu *cpu, unsigned int irq, bool more); | ||
156 | void set_interrupt(struct lg_cpu *cpu, unsigned int irq); | ||
143 | bool deliver_trap(struct lg_cpu *cpu, unsigned int num); | 157 | bool deliver_trap(struct lg_cpu *cpu, unsigned int num); |
144 | void load_guest_idt_entry(struct lg_cpu *cpu, unsigned int i, | 158 | void load_guest_idt_entry(struct lg_cpu *cpu, unsigned int i, |
145 | u32 low, u32 hi); | 159 | u32 low, u32 hi); |
@@ -150,6 +164,7 @@ void setup_default_idt_entries(struct lguest_ro_state *state, | |||
150 | void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt, | 164 | void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt, |
151 | const unsigned long *def); | 165 | const unsigned long *def); |
152 | void guest_set_clockevent(struct lg_cpu *cpu, unsigned long delta); | 166 | void guest_set_clockevent(struct lg_cpu *cpu, unsigned long delta); |
167 | bool send_notify_to_eventfd(struct lg_cpu *cpu); | ||
153 | void init_clockdev(struct lg_cpu *cpu); | 168 | void init_clockdev(struct lg_cpu *cpu); |
154 | bool check_syscall_vector(struct lguest *lg); | 169 | bool check_syscall_vector(struct lguest *lg); |
155 | int init_interrupts(void); | 170 | int init_interrupts(void); |
@@ -168,7 +183,10 @@ void copy_gdt_tls(const struct lg_cpu *cpu, struct desc_struct *gdt); | |||
168 | int init_guest_pagetable(struct lguest *lg); | 183 | int init_guest_pagetable(struct lguest *lg); |
169 | void free_guest_pagetable(struct lguest *lg); | 184 | void free_guest_pagetable(struct lguest *lg); |
170 | void guest_new_pagetable(struct lg_cpu *cpu, unsigned long pgtable); | 185 | void guest_new_pagetable(struct lg_cpu *cpu, unsigned long pgtable); |
186 | void guest_set_pgd(struct lguest *lg, unsigned long gpgdir, u32 i); | ||
187 | #ifdef CONFIG_X86_PAE | ||
171 | void guest_set_pmd(struct lguest *lg, unsigned long gpgdir, u32 i); | 188 | void guest_set_pmd(struct lguest *lg, unsigned long gpgdir, u32 i); |
189 | #endif | ||
172 | void guest_pagetable_clear_all(struct lg_cpu *cpu); | 190 | void guest_pagetable_clear_all(struct lg_cpu *cpu); |
173 | void guest_pagetable_flush_user(struct lg_cpu *cpu); | 191 | void guest_pagetable_flush_user(struct lg_cpu *cpu); |
174 | void guest_set_pte(struct lg_cpu *cpu, unsigned long gpgdir, | 192 | void guest_set_pte(struct lg_cpu *cpu, unsigned long gpgdir, |