aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/lguest/x86
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-01-07 08:05:37 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-01-30 06:50:14 -0500
commit1713608f280002d9ffc6de89d7de5cf367072d63 (patch)
tree332e7bdbe7ccccad408b309a4dd00b706b04082f /drivers/lguest/x86
parent5e232f4f428c4266ba5cdae9f23ba19a0913dcf9 (diff)
lguest: per-vcpu lguest pgdir management
this patch makes the pgdir management per-vcpu. The pgdirs pool is still guest-wide (although it'll probably need to grow when we are really executing more vcpus), but the pgdidx index is gone, since it makes no sense anymore. Instead, we use a per-vcpu index. Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/lguest/x86')
-rw-r--r--drivers/lguest/x86/core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
index 65f2e3809475..8c723555ffb3 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -145,7 +145,7 @@ static void run_guest_once(struct lg_cpu *cpu, struct lguest_pages *pages)
145 * 0-th argument above, ie "a"). %ebx contains the 145 * 0-th argument above, ie "a"). %ebx contains the
146 * physical address of the Guest's top-level page 146 * physical address of the Guest's top-level page
147 * directory. */ 147 * directory. */
148 : "0"(pages), "1"(__pa(lg->pgdirs[lg->pgdidx].pgdir)) 148 : "0"(pages), "1"(__pa(lg->pgdirs[cpu->cpu_pgd].pgdir))
149 /* We tell gcc that all these registers could change, 149 /* We tell gcc that all these registers could change,
150 * which means we don't have to save and restore them in 150 * which means we don't have to save and restore them in
151 * the Switcher. */ 151 * the Switcher. */
@@ -223,7 +223,7 @@ static int emulate_insn(struct lg_cpu *cpu)
223 unsigned int insnlen = 0, in = 0, shift = 0; 223 unsigned int insnlen = 0, in = 0, shift = 0;
224 /* The eip contains the *virtual* address of the Guest's instruction: 224 /* The eip contains the *virtual* address of the Guest's instruction:
225 * guest_pa just subtracts the Guest's page_offset. */ 225 * guest_pa just subtracts the Guest's page_offset. */
226 unsigned long physaddr = guest_pa(lg, cpu->regs->eip); 226 unsigned long physaddr = guest_pa(cpu, cpu->regs->eip);
227 227
228 /* This must be the Guest kernel trying to do something, not userspace! 228 /* This must be the Guest kernel trying to do something, not userspace!
229 * The bottom two bits of the CS segment register are the privilege 229 * The bottom two bits of the CS segment register are the privilege
@@ -305,7 +305,8 @@ void lguest_arch_handle_trap(struct lg_cpu *cpu)
305 * 305 *
306 * The errcode tells whether this was a read or a write, and 306 * The errcode tells whether this was a read or a write, and
307 * whether kernel or userspace code. */ 307 * whether kernel or userspace code. */
308 if (demand_page(lg,cpu->arch.last_pagefault,cpu->regs->errcode)) 308 if (demand_page(cpu, cpu->arch.last_pagefault,
309 cpu->regs->errcode))
309 return; 310 return;
310 311
311 /* OK, it's really not there (or not OK): the Guest needs to 312 /* OK, it's really not there (or not OK): the Guest needs to