aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/lguest/x86
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-01-07 08:05:35 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-01-30 06:50:13 -0500
commit4665ac8e28c30c2a015c617c55783c0bf3a49c05 (patch)
tree15992d7e693126be7f758e694c8a544306576dfd /drivers/lguest/x86
parent66686c2ab08feb721ca4d98285fba64acdf6017f (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/x86')
-rw-r--r--drivers/lguest/x86/core.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
index e989b8358864..65f2e3809475 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -95,8 +95,8 @@ static void copy_in_guest_info(struct lg_cpu *cpu, struct lguest_pages *pages)
95 /* Set up the two "TSS" members which tell the CPU what stack to use 95 /* Set up the two "TSS" members which tell the CPU what stack to use
96 * for traps which do directly into the Guest (ie. traps at privilege 96 * for traps which do directly into the Guest (ie. traps at privilege
97 * level 1). */ 97 * level 1). */
98 pages->state.guest_tss.esp1 = lg->esp1; 98 pages->state.guest_tss.esp1 = cpu->esp1;
99 pages->state.guest_tss.ss1 = lg->ss1; 99 pages->state.guest_tss.ss1 = cpu->ss1;
100 100
101 /* Copy direct-to-Guest trap entries. */ 101 /* Copy direct-to-Guest trap entries. */
102 if (lg->changed & CHANGED_IDT) 102 if (lg->changed & CHANGED_IDT)
@@ -165,12 +165,10 @@ static void run_guest_once(struct lg_cpu *cpu, struct lguest_pages *pages)
165 * are disabled: we own the CPU. */ 165 * are disabled: we own the CPU. */
166void lguest_arch_run_guest(struct lg_cpu *cpu) 166void lguest_arch_run_guest(struct lg_cpu *cpu)
167{ 167{
168 struct lguest *lg = cpu->lg;
169
170 /* Remember the awfully-named TS bit? If the Guest has asked to set it 168 /* Remember the awfully-named TS bit? If the Guest has asked to set it
171 * we set it now, so we can trap and pass that trap to the Guest if it 169 * we set it now, so we can trap and pass that trap to the Guest if it
172 * uses the FPU. */ 170 * uses the FPU. */
173 if (lg->ts) 171 if (cpu->ts)
174 lguest_set_ts(); 172 lguest_set_ts();
175 173
176 /* SYSENTER is an optimized way of doing system calls. We can't allow 174 /* SYSENTER is an optimized way of doing system calls. We can't allow
@@ -325,7 +323,7 @@ void lguest_arch_handle_trap(struct lg_cpu *cpu)
325 /* If the Guest doesn't want to know, we already restored the 323 /* If the Guest doesn't want to know, we already restored the
326 * Floating Point Unit, so we just continue without telling 324 * Floating Point Unit, so we just continue without telling
327 * it. */ 325 * it. */
328 if (!lg->ts) 326 if (!cpu->ts)
329 return; 327 return;
330 break; 328 break;
331 case 32 ... 255: 329 case 32 ... 255: