in our new model, pages are assigned to a virtual cpu, not to a guest.
We move it to the lg_cpu structure.
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
unsigned long regs_page;
struct lguest_regs *regs;
+ struct lguest_pages *last_pages;
+
int cpu_pgd; /* which pgd this cpu is currently using */
/* If a hypercall was asked for, this points to the arguments. */
/* Bitmap of what has changed: see CHANGED_* above. */
int changed;
- struct lguest_pages *last_pages;
struct pgdir pgdirs[4];
* reference, it is destroyed before close() is called. */
cpu->mm = get_task_mm(cpu->tsk);
+ /* We remember which CPU's pages this Guest used last, for optimization
+ * when the same Guest runs on the same CPU twice. */
+ cpu->last_pages = NULL;
+
return 0;
}
if (err)
goto free_regs;
- /* We remember which CPU's pages this Guest used last, for optimization
- * when the same Guest runs on the same CPU twice. */
- lg->last_pages = NULL;
-
/* We keep our "struct lguest" in the file's private_data. */
file->private_data = lg;
* same Guest we ran last time (and that Guest hasn't run anywhere else
* meanwhile). If that's not the case, we pretend everything in the
* Guest has changed. */
- if (__get_cpu_var(last_cpu) != cpu || lg->last_pages != pages) {
+ if (__get_cpu_var(last_cpu) != cpu || cpu->last_pages != pages) {
__get_cpu_var(last_cpu) = cpu;
- lg->last_pages = pages;
+ cpu->last_pages = pages;
lg->changed = CHANGED_ALL;
}