vmm: Increase the vmthread stack size
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 31 Jan 2017 15:04:00 +0000 (10:04 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 31 Jan 2017 15:04:00 +0000 (10:04 -0500)
I think the bypass codepaths (virtio->nat->bypass->iplib->nettrans)
consumed too much stack, and a thread went off the bottom of the page.  I
had a user PF at RIP = 8 and RSP right at the top of a page.  Increasing
the stack size removed the symptom.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
user/vmm/include/vmm/sched.h
user/vmm/nat.c

index 567a77e..9e79422 100644 (file)
@@ -20,7 +20,7 @@ __BEGIN_DECLS
 #define VMM_THREAD_CTLR                        2
 #define VMM_THREAD_TASK                        3
 
-#define VMM_THR_STACKSIZE              8192
+#define VMM_THR_STACKSIZE              (4 * PGSIZE)
 
 struct guest_thread;
 struct ctlr_thread;
index b05f592..01116d7 100644 (file)
@@ -335,8 +335,8 @@ static struct ip_nat_map *create_map(uint8_t protocol, uint16_t guest_port,
 
        bypass_fd = bypass9(dialstring, conv_dir, 0);
        if (bypass_fd < 0) {
-               fprintf(stderr, "Failed to clone a conv for %s:%s (%r), won't bypass!",
-                       proto_str, host_port);
+               fprintf(stderr, "Failed to clone a conv for %s:%d (%r), won't bypass!\n",
+                       proto_str, guest_port);
                free(map);
                return NULL;
        }