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

[Xen-devel] [PATCH] xen/video: Set EFI framebuffer to WC by default



Set the EFI framebuffer to write-combining by default. This makes
booting somewhat faster, but more importantly avoids tripping the
watchdog. In particular, before on my test machine, each frame redraw
would take around 80ms, which can trip the 5s watchdog when constructing
dom0, since it outputs something like 60 lines without processing
pending softirqs.

Both Linux and FreeBSD map the EFI framebuffer as write-combining by
default, so I assume (hope) that this is a safe change to make.

Also add documentation for the vesa-mtrr parameter.

Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
---
 docs/misc/xen-command-line.markdown | 14 ++++++++++++++
 xen/drivers/video/vesa.c            | 12 +++++++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/docs/misc/xen-command-line.markdown 
b/docs/misc/xen-command-line.markdown
index aa684c0..e5e3bd6 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -1373,6 +1373,20 @@ cache-warming. 1ms (1000) has been measured as a good 
value.
 ### vesa-mtrr
 > `= <integer>`
 
+> Default: `3` when using the EFI framebuffer, `0` otherwise.
+
+Specify the access mode to the VGA framebuffer.
+
+`0` does not change the access mode.
+
+`1` uses uncached mappings.
+
+`2` uses write-back mappings.
+
+`3` uses write-combining mappings.
+
+`4` uses write-through mappings.
+
 ### vesa-ram
 > `= <integer>`
 
diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c
index 575db62..abab068 100644
--- a/xen/drivers/video/vesa.c
+++ b/xen/drivers/video/vesa.c
@@ -142,7 +142,13 @@ void __init vesa_init(void)
 #include <asm/mtrr.h>
 
 static unsigned int vesa_mtrr;
-integer_param("vesa-mtrr", vesa_mtrr);
+static __initdata bool_t vesa_mtrr_set;
+static void __init parse_vesa_mtrr(const char * s)
+{
+    vesa_mtrr = simple_strtoull(s, NULL, 0);
+    vesa_mtrr_set = 1;
+}
+custom_param("vesa-mtrr", parse_vesa_mtrr);
 
 void __init vesa_mtrr_init(void)
 {
@@ -152,6 +158,10 @@ void __init vesa_mtrr_init(void)
     unsigned int size_total;
     int rc, type;
 
+    /* Default to write-combining for the EFI framebuffer. */
+    if ( !vesa_mtrr_set && vga_console_info.video_type == XEN_VGATYPE_EFI_LFB )
+        vesa_mtrr = 3;
+
     if ( !lfb || (vesa_mtrr == 0) || (vesa_mtrr >= ARRAY_SIZE(mtrr_types)) )
         return;
 
-- 
2.1.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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