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.


Simple tools for analyzing palacios serial output file
Peter Dinda [Tue, 20 Sep 2011 23:02:19 +0000 (18:02 -0500)]
   - scan for unhandled ports
   - scan for guest rips and translate to guest function names

utils/output_analysis/bad_ports.pl [new file with mode: 0755]
utils/output_analysis/guest_kernel_calls.pl [new file with mode: 0755]

diff --git a/utils/output_analysis/bad_ports.pl b/utils/output_analysis/bad_ports.pl
new file mode 100755 (executable)
index 0000000..468e698
--- /dev/null
@@ -0,0 +1,31 @@
+#!/usr/bin/perl -w
+
+$#ARGV==0 or die "Finds all unique unhandled I/O ports in a palacios output file\nusage: bad_ports.pl serial.out\n";
+
+open(K,shift);
+
+while (<K>) { 
+  if (/: (\S+) operation on unhooked IO port 0x(\S+)/) {
+    $dir=$1;
+    $port=$2;
+
+    $p{$port} |= ($dir eq 'IN' ? 1 : 2);
+    $n{$port}++;
+  }
+}
+
+close(K);
+
+@list = sort keys %p;
+
+foreach $port (@list) { 
+  print $port,"\t",$n{$port};
+  if ($p{$port} & 1) { 
+    print "\tIN";
+  }
+  if ($p{$port} & 2) { 
+    print "\tOUT";
+  }
+  print "\n";
+}
+    
diff --git a/utils/output_analysis/guest_kernel_calls.pl b/utils/output_analysis/guest_kernel_calls.pl
new file mode 100755 (executable)
index 0000000..07a710b
--- /dev/null
@@ -0,0 +1,65 @@
+#!/usr/bin/perl -w
+
+$#ARGV==0 or die "Decodes guest RIP addresses against a guest kernel dissassembly file\nThis tells you which functions in the guest kernel are being used\nusage: guest_kernel_calls.pl disassmfile < RIPS\n";
+
+open(K,shift);
+
+@k = <K>;
+
+close(K);
+
+while (<STDIN>) { 
+  if (/RIP Linear: (\S+)/) { 
+    $addr=$1;
+    chomp($addr);
+    print join("\t",$addr,findit($addr)),"\n";
+  }
+}
+
+
+sub findit {
+  my $addr=shift;
+  my $i;
+  my $line=-1;
+  my $funcline=-1;
+  my $funcaddr;
+  my $funcname;
+
+  if (substr($addr,0,1) eq "0") { 
+    return "USER";
+  } else {
+    # search forward
+    for ($i=0;$i<=$#k;$i++) { 
+      if ($k[$i] =~ /^(\S+):/) {
+       $x=$1;
+       if ($x eq $addr) { 
+         $line=$i;
+         last;
+       }
+      }
+    }
+    if ($line<0) {
+      return "CANNOT FIND IN DISASSEMBLY";
+    } else {
+      # search backward
+      for ($i=$line;$i>=0;$i--) { 
+       if ($k[$i] =~ /^(\S+)\s\<(\S+)\>:/) {
+         $funcline=$i;
+         $funcname=$2; 
+         $funcaddr=$1;
+         last;
+       }
+      } 
+      if ($funcline<0) { 
+       return "CANNOT FIND FUNCTION IN DISASSEMBLY";
+      } else {
+       return $funcname." at ".$funcaddr;
+      }
+    }
+  }
+}
+      
+         
+    
+  
+