[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 08 of 12] xenalyze: Add option to skip vga range in MMIO enumeration



Emulations to the VGA range during boot can be extremely numerous,
sometimes causing out-of-memory errors.  Add an option to
skip the VGA range (0xa0000-0xbffff) during enumeration, and
enable it by default.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>

diff -r c9f583c65e07 -r 3c6da152c844 xenalyze.c
--- a/xenalyze.c        Mon Nov 28 16:16:23 2011 +0000
+++ b/xenalyze.c        Mon Nov 28 16:16:23 2011 +0000
@@ -48,6 +48,15 @@ struct array_struct {
     int count;
 };
 
+#define warn_once(_x...)                          \
+    do {                                          \
+        static int _w=1;                          \
+        if ( _w ) {                               \
+            _w=0;                                 \
+            fprintf(warn, ##_x);                  \
+        }                                         \
+    } while(0)                                    \
+        
 /* -- Global variables -- */
 struct {
     int fd;
@@ -160,6 +169,7 @@ struct {
         with_mmio_enumeration:1,
         with_interrupt_eip_enumeration:1,
         show_default_domain_summary:1,
+        mmio_enumeration_skip_vga:1,
         progress:1,
         svm_mode:1,
         summary:1,
@@ -234,6 +244,7 @@ struct {
     .with_mmio_enumeration = 0,
     .with_interrupt_eip_enumeration = 0,
     .show_default_domain_summary = 0,
+    .mmio_enumeration_skip_vga = 1,
     .progress = 0,
     .svm_mode = 0,
     .summary = 0,
@@ -3692,10 +3703,21 @@ void hvm_vlapic_handler(struct hvm_data 
 }
 
 /* Also called by shadow_mmio_postprocess */
+#define MMIO_VGA_START (0xa0000)
+#define MMIO_VGA_END   (0xbffff)
 void enumerate_mmio(struct hvm_data *h)
 {
     struct mmio_info *m = &h->inflight.mmio;
 
+    /* Skip vga area */
+    if ( opt.mmio_enumeration_skip_vga
+         && m->gpa >= MMIO_VGA_START
+         && m->gpa <  MMIO_VGA_END)
+    {
+        warn_once("WARNING: Not enumerationg MMIO in VGA range.  Use 
--mmio-enumeration-skip-vga=0 to override.\n");
+        return;
+    }
+
     if ( m->data_valid )
         update_io_address(&h->summary.io.mmio, m->gpa, m->is_write, 
h->arc_cycles, m->va);
 }
@@ -9464,6 +9486,7 @@ enum {
     OPT_INTERVAL_DOMAIN_GRANT_MAPS,
     /* Summary info */
     OPT_SHOW_DEFAULT_DOMAIN_SUMMARY,
+    OPT_MMIO_ENUMERATION_SKIP_VGA,
     OPT_SAMPLE_SIZE,
     OPT_REPORT_PCPU,
     /* Guest info */
@@ -9649,6 +9672,14 @@ error_t cmd_parser(int key, char *arg, s
             argp_usage(state);
         break;
     }
+    case OPT_MMIO_ENUMERATION_SKIP_VGA:
+    {
+        char * inval;
+        opt.mmio_enumeration_skip_vga = (int)strtol(arg, &inval, 0);
+        if( inval == arg )
+            argp_usage(state);
+        break;
+    }
     case OPT_SCATTERPLOT_INTERRUPT_EIP:
     {
         char * inval;
@@ -10182,6 +10213,12 @@ const struct argp_option cmd_opts[] =  {
       .group = OPT_GROUP_SUMMARY,
       .doc = "Show default domain information on summary", },
 
+    { .name = "mmio-enumeration-skip-vga",
+      .key = OPT_MMIO_ENUMERATION_SKIP_VGA,
+      .arg = "[0|1]",
+      .group = OPT_GROUP_SUMMARY,
+      .doc = "Control whether we enumerate MMIO accesses to the VGA area, 
which can be extremly high during boot.  Default: 0", },
+
     { .name = "sample-size",
       .key = OPT_SAMPLE_SIZE,
       .arg = "size",

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.