VMM: Add command switches to control the 2LS
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 29 Apr 2016 18:49:10 +0000 (14:49 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 2 May 2016 21:11:15 +0000 (17:11 -0400)
-g: greedy - never yield your vcores
-s: scp - run as an SCP

Be sure to put the -s switches *before* the vm image.  That's why we
shouldn't roll our own arg parser.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
tests/vmm/vmrunkernel.c

index a53f22b..e340d36 100644 (file)
@@ -486,6 +486,12 @@ int main(int argc, char **argv)
                case 'c':
                        argc--, argv++;
                        cmdline_extra = argv[0];
+               case 'g':       /* greedy */
+                       parlib_never_yield = TRUE;
+                       break;
+               case 's':       /* scp */
+                       parlib_wants_to_be_mcp = FALSE;
+                       break;
                default:
                        fprintf(stderr, "BMAFR\n");
                        break;
@@ -661,10 +667,6 @@ int main(int argc, char **argv)
        bp->e820_map[e820i].size = 0x10000000;
        bp->e820_map[e820i++].type = E820_RESERVED;
 
-
-       /* Set parlib vars to control the 2LS. */
-       parlib_wants_to_be_mcp = TRUE;  /* default */
-       parlib_never_yield = FALSE;             /* default */
        vm->nr_gpcs = 1;
        vm->gpcis = &gpci;
        ret = vmm_init(vm, vmmflags);