Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80920
b: refs/heads/master
c: f34f8c5
h: refs/heads/master
v: v3
  • Loading branch information
Glauber de Oliveira Costa authored and Rusty Russell committed Jan 30, 2008
1 parent 9b2fe0d commit b75e303
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c40a9f4719d36841a2d7ff4fe866dce7bfb454b7
refs/heads/master: f34f8c5fea079065671163c37d98328cff31980b
3 changes: 2 additions & 1 deletion trunk/drivers/lguest/lg.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ struct lg_cpu {
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. */
Expand Down Expand Up @@ -92,7 +94,6 @@ struct lguest

/* Bitmap of what has changed: see CHANGED_* above. */
int changed;
struct lguest_pages *last_pages;

struct pgdir pgdirs[4];

Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/lguest/lguest_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long start_ip)
* 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;
}

Expand Down Expand Up @@ -192,10 +196,6 @@ static int initialize(struct file *file, const unsigned long __user *input)
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;

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/lguest/x86/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ static void copy_in_guest_info(struct lg_cpu *cpu, struct lguest_pages *pages)
* 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;
}

Expand Down

0 comments on commit b75e303

Please sign in to comment.