diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-07 08:05:35 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-01-30 06:50:13 -0500 |
commit | 4665ac8e28c30c2a015c617c55783c0bf3a49c05 (patch) | |
tree | 15992d7e693126be7f758e694c8a544306576dfd /drivers/lguest/lg.h | |
parent | 66686c2ab08feb721ca4d98285fba64acdf6017f (diff) |
lguest: makes special fields be per-vcpu
lguest struct have room for some fields, namely, cr2, ts, esp1
and ss1, that are not really guest-wide, but rather, vcpu-wide.
This patch puts it in the vcpu struct
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/lguest/lg.h')
-rw-r--r-- | drivers/lguest/lg.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/lguest/lg.h b/drivers/lguest/lg.h index e7123fa6127f..05637648a174 100644 --- a/drivers/lguest/lg.h +++ b/drivers/lguest/lg.h | |||
@@ -46,6 +46,11 @@ struct lg_cpu { | |||
46 | struct task_struct *tsk; | 46 | struct task_struct *tsk; |
47 | struct mm_struct *mm; /* == tsk->mm, but that becomes NULL on exit */ | 47 | struct mm_struct *mm; /* == tsk->mm, but that becomes NULL on exit */ |
48 | 48 | ||
49 | u32 cr2; | ||
50 | int ts; | ||
51 | u32 esp1; | ||
52 | u8 ss1; | ||
53 | |||
49 | /* At end of a page shared mapped over lguest_pages in guest. */ | 54 | /* At end of a page shared mapped over lguest_pages in guest. */ |
50 | unsigned long regs_page; | 55 | unsigned long regs_page; |
51 | struct lguest_regs *regs; | 56 | struct lguest_regs *regs; |
@@ -80,10 +85,6 @@ struct lguest | |||
80 | * memory in the Launcher. */ | 85 | * memory in the Launcher. */ |
81 | void __user *mem_base; | 86 | void __user *mem_base; |
82 | unsigned long kernel_address; | 87 | unsigned long kernel_address; |
83 | u32 cr2; | ||
84 | int ts; | ||
85 | u32 esp1; | ||
86 | u8 ss1; | ||
87 | 88 | ||
88 | /* Bitmap of what has changed: see CHANGED_* above. */ | 89 | /* Bitmap of what has changed: see CHANGED_* above. */ |
89 | int changed; | 90 | int changed; |
@@ -141,8 +142,8 @@ void maybe_do_interrupt(struct lg_cpu *cpu); | |||
141 | int deliver_trap(struct lg_cpu *cpu, unsigned int num); | 142 | int deliver_trap(struct lg_cpu *cpu, unsigned int num); |
142 | void load_guest_idt_entry(struct lg_cpu *cpu, unsigned int i, | 143 | void load_guest_idt_entry(struct lg_cpu *cpu, unsigned int i, |
143 | u32 low, u32 hi); | 144 | u32 low, u32 hi); |
144 | void guest_set_stack(struct lguest *lg, u32 seg, u32 esp, unsigned int pages); | 145 | void guest_set_stack(struct lg_cpu *cpu, u32 seg, u32 esp, unsigned int pages); |
145 | void pin_stack_pages(struct lguest *lg); | 146 | void pin_stack_pages(struct lg_cpu *cpu); |
146 | void setup_default_idt_entries(struct lguest_ro_state *state, | 147 | void setup_default_idt_entries(struct lguest_ro_state *state, |
147 | const unsigned long *def); | 148 | const unsigned long *def); |
148 | void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt, | 149 | void copy_traps(const struct lg_cpu *cpu, struct desc_struct *idt, |
@@ -164,9 +165,9 @@ void copy_gdt_tls(const struct lg_cpu *cpu, struct desc_struct *gdt); | |||
164 | /* page_tables.c: */ | 165 | /* page_tables.c: */ |
165 | int init_guest_pagetable(struct lguest *lg, unsigned long pgtable); | 166 | int init_guest_pagetable(struct lguest *lg, unsigned long pgtable); |
166 | void free_guest_pagetable(struct lguest *lg); | 167 | void free_guest_pagetable(struct lguest *lg); |
167 | void guest_new_pagetable(struct lguest *lg, unsigned long pgtable); | 168 | void guest_new_pagetable(struct lg_cpu *cpu, unsigned long pgtable); |
168 | void guest_set_pmd(struct lguest *lg, unsigned long gpgdir, u32 i); | 169 | void guest_set_pmd(struct lguest *lg, unsigned long gpgdir, u32 i); |
169 | void guest_pagetable_clear_all(struct lguest *lg); | 170 | void guest_pagetable_clear_all(struct lg_cpu *cpu); |
170 | void guest_pagetable_flush_user(struct lguest *lg); | 171 | void guest_pagetable_flush_user(struct lguest *lg); |
171 | void guest_set_pte(struct lguest *lg, unsigned long gpgdir, | 172 | void guest_set_pte(struct lguest *lg, unsigned long gpgdir, |
172 | unsigned long vaddr, pte_t val); | 173 | unsigned long vaddr, pte_t val); |