Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4dcc53da49c2387078fe8ceb7a420d125e027fc6
Commit:     4dcc53da49c2387078fe8ceb7a420d125e027fc6
Parent:     e3283fa0cc5c4f9bde52339a40da89297e51b481
Author:     Glauber de Oliveira Costa <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 7 11:05:24 2008 -0200
Committer:  Rusty Russell <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 22:50:06 2008 +1100

    lguest: initialize vcpu
    
    this patch initializes the first vcpu in the initialize() routing,
    which is responsible for starting the process of putting the guest up.
    right now, as much of the fields are still not per-vcpu, it does not
    do much.
    
    Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]>
    Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
---
 drivers/lguest/lguest_user.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/lguest/lguest_user.c b/drivers/lguest/lguest_user.c
index 3b92a61..c4bfe5a 100644
--- a/drivers/lguest/lguest_user.c
+++ b/drivers/lguest/lguest_user.c
@@ -88,6 +88,18 @@ static ssize_t read(struct file *file, char __user *user, 
size_t size,loff_t*o)
        return run_guest(lg, (unsigned long __user *)user);
 }
 
+static int lg_cpu_start(struct lg_cpu *cpu, unsigned id, unsigned long 
start_ip)
+{
+       if (id >= NR_CPUS)
+               return -EINVAL;
+
+       cpu->id = id;
+       cpu->lg = container_of((cpu - id), struct lguest, cpus[0]);
+       cpu->lg->nr_cpus++;
+
+       return 0;
+}
+
 /*L:020 The initialization write supplies 4 pointer sized (32 or 64 bit)
  * values (in addition to the LHREQ_INITIALIZE value).  These are:
  *
@@ -134,6 +146,11 @@ static int initialize(struct file *file, const unsigned 
long __user *input)
        lg->mem_base = (void __user *)(long)args[0];
        lg->pfn_limit = args[1];
 
+       /* This is the first cpu */
+       err = cpu_start(&lg->cpus[0], 0, args[3]);
+       if (err)
+               goto release_guest;
+
        /* We need a complete page for the Guest registers: they are accessible
         * to the Guest and we can only grant it access to whole pages. */
        lg->regs_page = get_zeroed_page(GFP_KERNEL);
-
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