Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f34f8c5fea079065671163c37d98328cff31980b
Commit:     f34f8c5fea079065671163c37d98328cff31980b
Parent:     c40a9f4719d36841a2d7ff4fe866dce7bfb454b7
Author:     Glauber de Oliveira Costa <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 17 19:13:26 2008 -0200
Committer:  Rusty Russell <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 22:50:16 2008 +1100

    lguest: move last_pages to lg_cpu
    
    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 <[EMAIL PROTECTED]>
    Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
---
 drivers/lguest/lg.h          |    3 ++-
 drivers/lguest/lguest_user.c |    8 ++++----
 drivers/lguest/x86/core.c    |    4 ++--
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/lguest/lg.h b/drivers/lguest/lg.h
index 94e518d..f1c4c33 100644
--- a/drivers/lguest/lg.h
+++ b/drivers/lguest/lg.h
@@ -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. */
@@ -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];
 
diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c
index f4f6df8..a87fca6 100644
--- a/drivers/lguest/lguest_user.c
+++ b/drivers/lguest/lguest_user.c
@@ -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;
 }
 
@@ -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;
 
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
index 10eab67..f8dfdc9 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -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;
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to