Merge master.kernel.org:/home/rmk/linux-2.6-arm
[safe/jmp/linux-2.6] / drivers / lguest / core.c
index cd058bc..8744d24 100644 (file)
@@ -67,12 +67,11 @@ static __init int map_switcher(void)
         * so we make sure they're zeroed.
         */
        for (i = 0; i < TOTAL_SWITCHER_PAGES; i++) {
-               unsigned long addr = get_zeroed_page(GFP_KERNEL);
-               if (!addr) {
+               switcher_page[i] = alloc_page(GFP_KERNEL|__GFP_ZERO);
+               if (!switcher_page[i]) {
                        err = -ENOMEM;
                        goto free_some_pages;
                }
-               switcher_page[i] = virt_to_page(addr);
        }
 
        /*
@@ -217,10 +216,15 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user)
 
                /*
                 * It's possible the Guest did a NOTIFY hypercall to the
-                * Launcher, in which case we return from the read() now.
+                * Launcher.
                 */
                if (cpu->pending_notify) {
+                       /*
+                        * Does it just needs to write to a registered
+                        * eventfd (ie. the appropriate virtqueue thread)?
+                        */
                        if (!send_notify_to_eventfd(cpu)) {
+                               /* OK, we tell the main Laucher. */
                                if (put_user(cpu->pending_notify, user))
                                        return -EFAULT;
                                return sizeof(cpu->pending_notify);