Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


fix potential overflow condition in VMX assist
[palacios.git] / v3_config_v3vee.pl
index 6abadbc..8cf9235 100755 (executable)
@@ -15,7 +15,7 @@ at least the following:
   cd linux_usr
   make
   cd ..
-  ./v3_config.pl
+  ./v3_config_v3vee.pl
 
 
 This tool will create (or overwrite) the following for you:
@@ -85,15 +85,15 @@ $compmemblocksize = $memblocksize;
 
 $maxalloc = 4194304;
 
-print "What is your kernel's maximum contiguous page allocation size in bytes (typicaly (MAX_ORDER-1)*4096) [$maxalloc] : ";
+print "What is your kernel's maximum contiguous page allocation size in bytes (typically 2^(MAX_ORDER-1)*4096) [$maxalloc] : ";
 
 $maxalloc = get_user($maxalloc);
 
-$shadow = 'y';
+$gb4 = 'n';
 
-print "Do you need to run guests with shadow paging or for other reasons that require 4GB enforcement of page allocation? [$shadow] : ";
+print "Do you need to use features that require 4GB enforcement of page allocation? [$gb4] : ";
 
-$shadow = get_user($shadow);
+$gb4 = get_user($gb4);
 
 if ($hotremove eq "y") {
   print "Your kernel supports hot remove.  Do you want to use it? [$hotremove] : ";
@@ -110,6 +110,17 @@ if ($hotremove eq "n") {
      print "Desired memory block size? [$maxalloc or less, power of 2] : ";
      $memblocksize = get_user($maxalloc);
   } while ($memblocksize>$maxalloc && !powerof2($memblocksize));
+  do  { 
+     print "You are not using hot-remove, so we can adjust the allocation size\n";
+     print "Typically, you want this as large as possible (up to what your\n";
+     print "kernel allows, but for special purposes, for example cache\n";
+     print "partitioning, you want this to be as small as possible (just\n";
+     print "larger than the largest contiguous allocation your guests will need.)\n";
+     print "Desired allocation size? [$maxalloc or less, power of 2] : ";
+     $allocsize = get_user($maxalloc);
+  } while ($allocsize>$maxalloc && !powerof2($allocsize));
+} else {
+  $allocsize=$memblocksize;
 }
 
 $mem = 1024;
@@ -122,6 +133,27 @@ $devmem='y';
 print "Do you need userspace access to your VMs' physical memory? [$devmem] : ";
 $devmem = get_user($devmem);
 
+$qemu='n';
+$qemudir=$pdir."/linux_usr/qemu";
+
+$hostdev = get_palacios_core_feature($pdir,"V3_CONFIG_HOST_DEVICE");
+
+if ($hostdev eq "y") { 
+   print "Your Palacios configuration includes the host device interface.\n";
+   print "You can use it to interface with QEMU devices if you have a\n";
+   print "patched version of QEMU (see linux_usr/qemu for more info)\n\n";
+   print "Do you plan to use QEMU devices? [n] : ";
+   $qemu = get_user($qemu);
+   if ($qemu eq "y") {
+    while (1) { 
+        print "What is the path to your patched version of QEMU ? [$qemudir] : ";
+        $qemudir = get_user($qemudir);
+        last if -e "$qemudir/bin/qemu-system-x86_64";
+        print "$qemudir/bin/qemu-system-x86_64 cannot be found\n";
+      } 
+    }
+}
+
 print <<END2
 
 Parameters
@@ -130,11 +162,14 @@ Parameters
    Initial Palacios Memory (MB) $mem
    Can Hot Remove:              $canhotremove
    Will Hot Remove:             $hotremove
-   Enforce 4 GB Limit:          $shadow
+   Enforce 4 GB Limit:          $gb4
    Compiled Memory Block Size:  $compmemblocksize
    Override Memory Block Size:  $override_memblocksize
    Actual Memory Block Size:    $memblocksize
+   Allocation Block Size:       $allocsize
    Allow Devmem:                $devmem
+   Support QEMU devices:        $qemu
+   QEMU directory:              $qemudir
 
 END2
 ;
@@ -147,6 +182,9 @@ END2
 print "Writing ./ENV\n";
 open(ENV,">ENV");
 print ENV "export PALACIOS_DIR=$pdir\n";
+if ($qemu eq "y") { 
+  print ENV "export PALACIOS_QEMU_DIR=$qemudir\n";
+}
 print ENV "export PATH=$pdir/linux_usr:\$PATH\n";
 close(ENV);
 `chmod 644 ENV`;
@@ -193,7 +231,7 @@ if (defined($numa{numcores})) {
 
 
 
-$chunk = $memblocksize / (1024 * 1024) ;
+$chunk = $allocsize / (1024 * 1024) ;
 $numchunks = $mem / $chunk;
 $chunkspernode  = $numchunks / $numnodes;
 
@@ -203,7 +241,7 @@ print "  Memory block size:  $chunk MB\n";
 print "  Number of blocks:   $numchunks\n";
 print "  Number of nodes:    $numnodes\n";
 print "  Blocks/node:        $chunkspernode\n";
-print "  32 bit limit?       $shadow\n";
+print "  32 bit limit?       $gb4\n";
 print "  Hot-removed?        $hotremove\n";
 
 if ($numnodes*$chunkspernode*$chunk != $mem) { 
@@ -213,7 +251,7 @@ if ($numnodes*$chunkspernode*$chunk != $mem) {
 
 $cmd = "v3_mem -a";
 $cmd.= " -k " if $hotremove eq 'n';
-$cmd.= " -l " if $shadow eq 'y';
+$cmd.= " -l " if $gb4 eq 'y';
 
 for ($i=0;$i<$numnodes;$i++) {
   for ($j=0;$j<$chunkspernode;$j++) {