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

[Xen-devel] [PATCH for-xen-4.5 v3 13/16] x86: Move video data to boot_info



Move video data to boot_info.

This commit reveals a bug which probably was introduced between commit
3e2331d271cc0882e4013c8f20398c46c35f90a1 (VT-d: suppress UR signaling for
further desktop chipsets) and 61fdda7acf3de11f3d50d50e5b4f4ecfac7e0d04
(x86/HVM: properly bound x2APIC MSR range). Xen crashes at video_endboot()
because earlier scrub process wipes vga_console_info data (sic!). So,
it means that at least page containing this structure was freed mistakenly
somewhere. Interestingly this issue appears on legacy BIOS machines only.
EFI platforms work as usual. It is possible to workaround this bug by
passing no-bootscrub to xen.gz.

I was not able to spot anything obvious just looking briefly at commit history.
I am going to narrow down and fix this issue in next release.

Signed-off-by: Daniel Kiper <daniel.kiper@xxxxxxxxxx>
---
 xen/arch/x86/boot_info.c          |   78 ++++++++++++++++++++++++++++++
 xen/arch/x86/efi/efi-boot.h       |   74 ++++++++++++++---------------
 xen/arch/x86/platform_hypercall.c |    9 ++--
 xen/arch/x86/setup.c              |   94 +++++--------------------------------
 xen/common/efi/runtime.c          |    6 +++
 xen/drivers/video/vesa.c          |    7 +--
 xen/drivers/video/vga.c           |   18 ++++---
 xen/include/asm-x86/boot_info.h   |    8 ++++
 xen/include/asm-x86/config.h      |    2 -
 xen/include/xen/vga.h             |   18 -------
 10 files changed, 157 insertions(+), 157 deletions(-)
 delete mode 100644 xen/include/xen/vga.h

diff --git a/xen/arch/x86/boot_info.c b/xen/arch/x86/boot_info.c
index 8b49036..48d5274 100644
--- a/xen/arch/x86/boot_info.c
+++ b/xen/arch/x86/boot_info.c
@@ -31,11 +31,46 @@
 #include <asm/mbd.h>
 #include <asm/page.h>
 
+struct boot_video_info {
+    u8  orig_x;             /* 0x00 */
+    u8  orig_y;             /* 0x01 */
+    u8  orig_video_mode;    /* 0x02 */
+    u8  orig_video_cols;    /* 0x03 */
+    u8  orig_video_lines;   /* 0x04 */
+    u8  orig_video_isVGA;   /* 0x05 */
+    u16 orig_video_points;  /* 0x06 */
+
+    /* VESA graphic mode -- linear frame buffer */
+    u32 capabilities;       /* 0x08 */
+    u16 lfb_linelength;     /* 0x0c */
+    u16 lfb_width;          /* 0x0e */
+    u16 lfb_height;         /* 0x10 */
+    u16 lfb_depth;          /* 0x12 */
+    u32 lfb_base;           /* 0x14 */
+    u32 lfb_size;           /* 0x18 */
+    u8  red_size;           /* 0x1c */
+    u8  red_pos;            /* 0x1d */
+    u8  green_size;         /* 0x1e */
+    u8  green_pos;          /* 0x1f */
+    u8  blue_size;          /* 0x20 */
+    u8  blue_pos;           /* 0x21 */
+    u8  rsvd_size;          /* 0x22 */
+    u8  rsvd_pos;           /* 0x23 */
+    u16 vesapm_seg;         /* 0x24 */
+    u16 vesapm_off;         /* 0x26 */
+    u16 vesa_attrib;        /* 0x28 */
+};
+
 /* These symbols live in the boot trampoline. Access via bootsym(). */
 extern struct e820entry e820map[];
 extern unsigned int e820nr;
 extern unsigned int lowmem_kb, highmem_kb;
 
+extern struct boot_video_info boot_vid_info;
+
+extern unsigned short boot_edid_caps;
+extern unsigned char boot_edid_info[128];
+
 static boot_info_t __read_mostly boot_info_mb = {
     .boot_loader_name = "UNKNOWN",
     .cmdline = NULL,
@@ -50,6 +85,9 @@ static boot_info_t __read_mostly boot_info_mb = {
     .acpi = EFI_INVALID_TABLE_ADDR,
     .acpi20 = EFI_INVALID_TABLE_ADDR,
     .smbios = EFI_INVALID_TABLE_ADDR,
+    .vga_console_info = {},
+    .edid_caps = 0,
+    .edid_info = NULL,
     .mods_nr = 0,
     .mods = NULL,
     .warn_msg = NULL,
@@ -138,6 +176,44 @@ static void __init init_mmap(boot_info_t *boot_info, mbd_t 
*mbd)
     boot_info->e820map = e820_raw;
 }
 
+static void __init init_video_info(boot_info_t *boot_info)
+{
+    struct boot_video_info *bvi = &bootsym(boot_vid_info);
+
+    if ( (bvi->orig_video_isVGA == 1) && (bvi->orig_video_mode == 3) )
+    {
+        boot_info->vga_console_info.video_type = XEN_VGATYPE_TEXT_MODE_3;
+        boot_info->vga_console_info.u.text_mode_3.font_height = 
bvi->orig_video_points;
+        boot_info->vga_console_info.u.text_mode_3.cursor_x = bvi->orig_x;
+        boot_info->vga_console_info.u.text_mode_3.cursor_y = bvi->orig_y;
+        boot_info->vga_console_info.u.text_mode_3.rows = bvi->orig_video_lines;
+        boot_info->vga_console_info.u.text_mode_3.columns = 
bvi->orig_video_cols;
+    }
+    else if ( bvi->orig_video_isVGA == 0x23 )
+    {
+        boot_info->vga_console_info.video_type = XEN_VGATYPE_VESA_LFB;
+        boot_info->vga_console_info.u.vesa_lfb.width = bvi->lfb_width;
+        boot_info->vga_console_info.u.vesa_lfb.height = bvi->lfb_height;
+        boot_info->vga_console_info.u.vesa_lfb.bytes_per_line = 
bvi->lfb_linelength;
+        boot_info->vga_console_info.u.vesa_lfb.bits_per_pixel = bvi->lfb_depth;
+        boot_info->vga_console_info.u.vesa_lfb.lfb_base = bvi->lfb_base;
+        boot_info->vga_console_info.u.vesa_lfb.lfb_size = bvi->lfb_size;
+        boot_info->vga_console_info.u.vesa_lfb.red_pos = bvi->red_pos;
+        boot_info->vga_console_info.u.vesa_lfb.red_size = bvi->red_size;
+        boot_info->vga_console_info.u.vesa_lfb.green_pos = bvi->green_pos;
+        boot_info->vga_console_info.u.vesa_lfb.green_size = bvi->green_size;
+        boot_info->vga_console_info.u.vesa_lfb.blue_pos = bvi->blue_pos;
+        boot_info->vga_console_info.u.vesa_lfb.blue_size = bvi->blue_size;
+        boot_info->vga_console_info.u.vesa_lfb.rsvd_pos = bvi->rsvd_pos;
+        boot_info->vga_console_info.u.vesa_lfb.rsvd_size = bvi->rsvd_size;
+        boot_info->vga_console_info.u.vesa_lfb.gbl_caps = bvi->capabilities;
+        boot_info->vga_console_info.u.vesa_lfb.mode_attrs = bvi->vesa_attrib;
+    }
+
+    boot_info->edid_caps = bootsym(boot_edid_caps);
+    boot_info->edid_info = bootsym(boot_edid_info);
+}
+
 paddr_t __init __init_boot_info(u32 mbd_pa)
 {
     mbd_t *mbd = __va(mbd_pa);
@@ -155,6 +231,8 @@ paddr_t __init __init_boot_info(u32 mbd_pa)
     if ( boot_info_mb.err_msg )
         goto err;
 
+    init_video_info(&boot_info_mb);
+
     boot_info_mb.mods_nr = mbd->mods_nr;
     boot_info_mb.mods = __va(mbd->mods);
 
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 3a6e7ec..ee5b54b 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -3,7 +3,7 @@
  * is intended to be included by common/efi/boot.c _only_, and
  * therefore can define arch specific global variables.
  */
-#include <xen/vga.h>
+#include <xen/video.h>
 #include <asm/e820.h>
 #include <asm/edd.h>
 #include <asm/msr.h>
@@ -454,10 +454,10 @@ static void __init efi_arch_edd(void)
 
 static void __init efi_arch_console_init(UINTN cols, UINTN rows)
 {
-    vga_console_info.video_type = XEN_VGATYPE_TEXT_MODE_3;
-    vga_console_info.u.text_mode_3.columns = cols;
-    vga_console_info.u.text_mode_3.rows = rows;
-    vga_console_info.u.text_mode_3.font_height = 16;
+    boot_info_efi.vga_console_info.video_type = XEN_VGATYPE_TEXT_MODE_3;
+    boot_info_efi.vga_console_info.u.text_mode_3.columns = cols;
+    boot_info_efi.vga_console_info.u.text_mode_3.rows = rows;
+    boot_info_efi.vga_console_info.u.text_mode_3.font_height = 16;
 }
 
 static void __init efi_arch_video_init(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop,
@@ -469,40 +469,40 @@ static void __init 
efi_arch_video_init(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop,
     switch ( mode_info->PixelFormat )
     {
     case PixelRedGreenBlueReserved8BitPerColor:
-        vga_console_info.u.vesa_lfb.red_pos = 0;
-        vga_console_info.u.vesa_lfb.red_size = 8;
-        vga_console_info.u.vesa_lfb.green_pos = 8;
-        vga_console_info.u.vesa_lfb.green_size = 8;
-        vga_console_info.u.vesa_lfb.blue_pos = 16;
-        vga_console_info.u.vesa_lfb.blue_size = 8;
-        vga_console_info.u.vesa_lfb.rsvd_pos = 24;
-        vga_console_info.u.vesa_lfb.rsvd_size = 8;
+        boot_info_efi.vga_console_info.u.vesa_lfb.red_pos = 0;
+        boot_info_efi.vga_console_info.u.vesa_lfb.red_size = 8;
+        boot_info_efi.vga_console_info.u.vesa_lfb.green_pos = 8;
+        boot_info_efi.vga_console_info.u.vesa_lfb.green_size = 8;
+        boot_info_efi.vga_console_info.u.vesa_lfb.blue_pos = 16;
+        boot_info_efi.vga_console_info.u.vesa_lfb.blue_size = 8;
+        boot_info_efi.vga_console_info.u.vesa_lfb.rsvd_pos = 24;
+        boot_info_efi.vga_console_info.u.vesa_lfb.rsvd_size = 8;
         bpp = 32;
         break;
     case PixelBlueGreenRedReserved8BitPerColor:
-        vga_console_info.u.vesa_lfb.red_pos = 16;
-        vga_console_info.u.vesa_lfb.red_size = 8;
-        vga_console_info.u.vesa_lfb.green_pos = 8;
-        vga_console_info.u.vesa_lfb.green_size = 8;
-        vga_console_info.u.vesa_lfb.blue_pos = 0;
-        vga_console_info.u.vesa_lfb.blue_size = 8;
-        vga_console_info.u.vesa_lfb.rsvd_pos = 24;
-        vga_console_info.u.vesa_lfb.rsvd_size = 8;
+        boot_info_efi.vga_console_info.u.vesa_lfb.red_pos = 16;
+        boot_info_efi.vga_console_info.u.vesa_lfb.red_size = 8;
+        boot_info_efi.vga_console_info.u.vesa_lfb.green_pos = 8;
+        boot_info_efi.vga_console_info.u.vesa_lfb.green_size = 8;
+        boot_info_efi.vga_console_info.u.vesa_lfb.blue_pos = 0;
+        boot_info_efi.vga_console_info.u.vesa_lfb.blue_size = 8;
+        boot_info_efi.vga_console_info.u.vesa_lfb.rsvd_pos = 24;
+        boot_info_efi.vga_console_info.u.vesa_lfb.rsvd_size = 8;
         bpp = 32;
         break;
     case PixelBitMask:
         bpp = set_color(mode_info->PixelInformation.RedMask, bpp,
-                        &vga_console_info.u.vesa_lfb.red_pos,
-                        &vga_console_info.u.vesa_lfb.red_size);
+                        &boot_info_efi.vga_console_info.u.vesa_lfb.red_pos,
+                        &boot_info_efi.vga_console_info.u.vesa_lfb.red_size);
         bpp = set_color(mode_info->PixelInformation.GreenMask, bpp,
-                        &vga_console_info.u.vesa_lfb.green_pos,
-                        &vga_console_info.u.vesa_lfb.green_size);
+                        &boot_info_efi.vga_console_info.u.vesa_lfb.green_pos,
+                        &boot_info_efi.vga_console_info.u.vesa_lfb.green_size);
         bpp = set_color(mode_info->PixelInformation.BlueMask, bpp,
-                        &vga_console_info.u.vesa_lfb.blue_pos,
-                        &vga_console_info.u.vesa_lfb.blue_size);
+                        &boot_info_efi.vga_console_info.u.vesa_lfb.blue_pos,
+                        &boot_info_efi.vga_console_info.u.vesa_lfb.blue_size);
         bpp = set_color(mode_info->PixelInformation.ReservedMask, bpp,
-                        &vga_console_info.u.vesa_lfb.rsvd_pos,
-                        &vga_console_info.u.vesa_lfb.rsvd_size);
+                        &boot_info_efi.vga_console_info.u.vesa_lfb.rsvd_pos,
+                        &boot_info_efi.vga_console_info.u.vesa_lfb.rsvd_size);
         if ( bpp > 0 )
             break;
         /* fall through */
@@ -513,16 +513,16 @@ static void __init 
efi_arch_video_init(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop,
     }
     if ( bpp > 0 )
     {
-        vga_console_info.video_type = XEN_VGATYPE_EFI_LFB;
-        vga_console_info.u.vesa_lfb.gbl_caps = 2; /* possibly non-VGA */
-        vga_console_info.u.vesa_lfb.width =
+        boot_info_efi.vga_console_info.video_type = XEN_VGATYPE_EFI_LFB;
+        boot_info_efi.vga_console_info.u.vesa_lfb.gbl_caps = 2; /* possibly 
non-VGA */
+        boot_info_efi.vga_console_info.u.vesa_lfb.width =
             mode_info->HorizontalResolution;
-        vga_console_info.u.vesa_lfb.height = mode_info->VerticalResolution;
-        vga_console_info.u.vesa_lfb.bits_per_pixel = bpp;
-        vga_console_info.u.vesa_lfb.bytes_per_line =
+        boot_info_efi.vga_console_info.u.vesa_lfb.height = 
mode_info->VerticalResolution;
+        boot_info_efi.vga_console_info.u.vesa_lfb.bits_per_pixel = bpp;
+        boot_info_efi.vga_console_info.u.vesa_lfb.bytes_per_line =
             (mode_info->PixelsPerScanLine * bpp + 7) >> 3;
-        vga_console_info.u.vesa_lfb.lfb_base = gop->Mode->FrameBufferBase;
-        vga_console_info.u.vesa_lfb.lfb_size =
+        boot_info_efi.vga_console_info.u.vesa_lfb.lfb_base = 
gop->Mode->FrameBufferBase;
+        boot_info_efi.vga_console_info.u.vesa_lfb.lfb_size =
             (gop->Mode->FrameBufferSize + 0xffff) >> 16;
     }
 }
diff --git a/xen/arch/x86/platform_hypercall.c 
b/xen/arch/x86/platform_hypercall.c
index 32f39b2..7687dd1 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -30,6 +30,7 @@
 #include <asm/mtrr.h>
 #include <asm/io_apic.h>
 #include <asm/setup.h>
+#include <asm/boot_info.h>
 #include "cpu/mtrr/mtrr.h"
 #include <xsm/xsm.h>
 
@@ -357,13 +358,13 @@ ret_t 
do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
             ret = -ESRCH;
             if ( op->u.firmware_info.index != 0 )
                 break;
-            if ( *(u32 *)bootsym(boot_edid_info) == 0x13131313 )
+            if ( *(u32 *)boot_info->edid_info == 0x13131313 )
                 break;
 
             op->u.firmware_info.u.vbeddc_info.capabilities =
-                bootsym(boot_edid_caps);
+                boot_info->edid_caps;
             op->u.firmware_info.u.vbeddc_info.edid_transfer_time =
-                bootsym(boot_edid_caps) >> 8;
+                boot_info->edid_caps >> 8;
 
             ret = 0;
             if ( __copy_field_to_guest(u_xenpf_op, op, u.firmware_info.
@@ -371,7 +372,7 @@ ret_t 
do_platform_op(XEN_GUEST_HANDLE_PARAM(xen_platform_op_t) u_xenpf_op)
                  __copy_field_to_guest(u_xenpf_op, op, u.firmware_info.
                                        u.vbeddc_info.edid_transfer_time) ||
                  copy_to_compat(op->u.firmware_info.u.vbeddc_info.edid,
-                                bootsym(boot_edid_info), 128) )
+                                boot_info->edid_info, 128) )
                 ret = -EFAULT;
             break;
         case XEN_FW_EFI_INFO:
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 0e48726..9b41172 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -20,7 +20,7 @@
 #include <xen/keyhandler.h>
 #include <xen/numa.h>
 #include <xen/rcupdate.h>
-#include <xen/vga.h>
+#include <xen/video.h>
 #include <xen/dmi.h>
 #include <xen/pfn.h>
 #include <xen/nodemask.h>
@@ -397,76 +397,6 @@ static void __init setup_max_pdx(unsigned long top_page)
 /* A temporary copy of the e820 map that we can mess with during bootstrap. */
 static struct e820map __initdata boot_e820;
 
-struct boot_video_info {
-    u8  orig_x;             /* 0x00 */
-    u8  orig_y;             /* 0x01 */
-    u8  orig_video_mode;    /* 0x02 */
-    u8  orig_video_cols;    /* 0x03 */
-    u8  orig_video_lines;   /* 0x04 */
-    u8  orig_video_isVGA;   /* 0x05 */
-    u16 orig_video_points;  /* 0x06 */
-
-    /* VESA graphic mode -- linear frame buffer */
-    u32 capabilities;       /* 0x08 */
-    u16 lfb_linelength;     /* 0x0c */
-    u16 lfb_width;          /* 0x0e */
-    u16 lfb_height;         /* 0x10 */
-    u16 lfb_depth;          /* 0x12 */
-    u32 lfb_base;           /* 0x14 */
-    u32 lfb_size;           /* 0x18 */
-    u8  red_size;           /* 0x1c */
-    u8  red_pos;            /* 0x1d */
-    u8  green_size;         /* 0x1e */
-    u8  green_pos;          /* 0x1f */
-    u8  blue_size;          /* 0x20 */
-    u8  blue_pos;           /* 0x21 */
-    u8  rsvd_size;          /* 0x22 */
-    u8  rsvd_pos;           /* 0x23 */
-    u16 vesapm_seg;         /* 0x24 */
-    u16 vesapm_off;         /* 0x26 */
-    u16 vesa_attrib;        /* 0x28 */
-};
-extern struct boot_video_info boot_vid_info;
-
-static void __init parse_video_info(void)
-{
-    struct boot_video_info *bvi = &bootsym(boot_vid_info);
-
-    /* The EFI loader fills vga_console_info directly. */
-    if ( efi_enabled )
-        return;
-
-    if ( (bvi->orig_video_isVGA == 1) && (bvi->orig_video_mode == 3) )
-    {
-        vga_console_info.video_type = XEN_VGATYPE_TEXT_MODE_3;
-        vga_console_info.u.text_mode_3.font_height = bvi->orig_video_points;
-        vga_console_info.u.text_mode_3.cursor_x = bvi->orig_x;
-        vga_console_info.u.text_mode_3.cursor_y = bvi->orig_y;
-        vga_console_info.u.text_mode_3.rows = bvi->orig_video_lines;
-        vga_console_info.u.text_mode_3.columns = bvi->orig_video_cols;
-    }
-    else if ( bvi->orig_video_isVGA == 0x23 )
-    {
-        vga_console_info.video_type = XEN_VGATYPE_VESA_LFB;
-        vga_console_info.u.vesa_lfb.width = bvi->lfb_width;
-        vga_console_info.u.vesa_lfb.height = bvi->lfb_height;
-        vga_console_info.u.vesa_lfb.bytes_per_line = bvi->lfb_linelength;
-        vga_console_info.u.vesa_lfb.bits_per_pixel = bvi->lfb_depth;
-        vga_console_info.u.vesa_lfb.lfb_base = bvi->lfb_base;
-        vga_console_info.u.vesa_lfb.lfb_size = bvi->lfb_size;
-        vga_console_info.u.vesa_lfb.red_pos = bvi->red_pos;
-        vga_console_info.u.vesa_lfb.red_size = bvi->red_size;
-        vga_console_info.u.vesa_lfb.green_pos = bvi->green_pos;
-        vga_console_info.u.vesa_lfb.green_size = bvi->green_size;
-        vga_console_info.u.vesa_lfb.blue_pos = bvi->blue_pos;
-        vga_console_info.u.vesa_lfb.blue_size = bvi->blue_size;
-        vga_console_info.u.vesa_lfb.rsvd_pos = bvi->rsvd_pos;
-        vga_console_info.u.vesa_lfb.rsvd_size = bvi->rsvd_size;
-        vga_console_info.u.vesa_lfb.gbl_caps = bvi->capabilities;
-        vga_console_info.u.vesa_lfb.mode_attrs = bvi->vesa_attrib;
-    }
-}
-
 static void __init kexec_reserve_area(struct e820map *e820)
 {
     unsigned long kdump_start = kexec_crash_area.start;
@@ -593,8 +523,6 @@ void __init noreturn __start_xen(paddr_t boot_info_pa)
      * allocing any xenheap structures wanted in lower memory. */
     kexec_early_calculations();
 
-    parse_video_info();
-
     if ( cpu_has_efer )
         rdmsrl(MSR_EFER, this_cpu(efer));
     asm volatile ( "mov %%cr4,%0" : "=r" (this_cpu(cr4)) );
@@ -622,20 +550,20 @@ void __init noreturn __start_xen(paddr_t boot_info_pa)
     printk("Video information:\n");
 
     /* Print VGA display mode information. */
-    switch ( vga_console_info.video_type )
+    switch ( boot_info->vga_console_info.video_type )
     {
     case XEN_VGATYPE_TEXT_MODE_3:
         printk(" VGA is text mode %dx%d, font 8x%d\n",
-               vga_console_info.u.text_mode_3.columns,
-               vga_console_info.u.text_mode_3.rows,
-               vga_console_info.u.text_mode_3.font_height);
+               boot_info->vga_console_info.u.text_mode_3.columns,
+               boot_info->vga_console_info.u.text_mode_3.rows,
+               boot_info->vga_console_info.u.text_mode_3.font_height);
         break;
     case XEN_VGATYPE_VESA_LFB:
     case XEN_VGATYPE_EFI_LFB:
         printk(" VGA is graphics mode %dx%d, %d bpp\n",
-               vga_console_info.u.vesa_lfb.width,
-               vga_console_info.u.vesa_lfb.height,
-               vga_console_info.u.vesa_lfb.bits_per_pixel);
+               boot_info->vga_console_info.u.vesa_lfb.width,
+               boot_info->vga_console_info.u.vesa_lfb.height,
+               boot_info->vga_console_info.u.vesa_lfb.bits_per_pixel);
         break;
     default:
         printk(" No VGA detected\n");
@@ -643,15 +571,15 @@ void __init noreturn __start_xen(paddr_t boot_info_pa)
     }
 
     /* Print VBE/DDC EDID information. */
-    if ( bootsym(boot_edid_caps) != 0x1313 )
+    if ( boot_info->edid_caps != 0x1313 )
     {
-        u16 caps = bootsym(boot_edid_caps);
+        u16 caps = boot_info->edid_caps;
         printk(" VBE/DDC methods:%s%s%s; ",
                (caps & 1) ? " V1" : "",
                (caps & 2) ? " V2" : "",
                !(caps & 3) ? " none" : "");
         printk("EDID transfer time: %d seconds\n", caps >> 8);
-        if ( *(u32 *)bootsym(boot_edid_info) == 0x13131313 )
+        if ( *(u32 *)boot_info->edid_info == 0x13131313 )
         {
             printk(" EDID info not retrieved because ");
             if ( !(caps & 3) )
diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index 8c37b28..988464f 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -5,6 +5,7 @@
 #include <xen/guest_access.h>
 #include <xen/irq.h>
 #include <xen/time.h>
+#include <xen/video.h>
 #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
 #include <asm/boot_info.h>
 #include <asm/e820.h>
@@ -45,6 +46,8 @@ const struct efi_pci_rom *__read_mostly efi_pci_roms;
 #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */
 extern struct e820entry e820map[];
 
+extern unsigned char boot_edid_info[128];
+
 static boot_module_t __read_mostly boot_info_mods[3] = {};
 
 boot_info_t __read_mostly boot_info_efi = {
@@ -61,6 +64,9 @@ boot_info_t __read_mostly boot_info_efi = {
     .acpi = EFI_INVALID_TABLE_ADDR,
     .acpi20 = EFI_INVALID_TABLE_ADDR,
     .smbios = EFI_INVALID_TABLE_ADDR,
+    .vga_console_info = {},
+    .edid_caps = 0,
+    .edid_info = boot_edid_info,
     .mods_nr = 0,
     .mods = boot_info_mods,
     .warn_msg = NULL,
diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c
index 575db62..942a356 100644
--- a/xen/drivers/video/vesa.c
+++ b/xen/drivers/video/vesa.c
@@ -9,13 +9,14 @@
 #include <xen/lib.h>
 #include <xen/xmalloc.h>
 #include <xen/kernel.h>
-#include <xen/vga.h>
+#include <xen/video.h>
 #include <asm/io.h>
 #include <asm/page.h>
+#include <asm/boot_info.h>
 #include "font.h"
 #include "lfb.h"
 
-#define vlfb_info    vga_console_info.u.vesa_lfb
+#define vlfb_info    boot_info->vga_console_info.u.vesa_lfb
 
 static void lfb_flush(void);
 
@@ -43,7 +44,7 @@ void __init vesa_early_init(void)
 {
     unsigned int vram_vmode;
 
-    vga_compat = !(vga_console_info.u.vesa_lfb.gbl_caps & 2);
+    vga_compat = !(boot_info->vga_console_info.u.vesa_lfb.gbl_caps & 2);
 
     if ( (vlfb_info.bits_per_pixel < 8) || (vlfb_info.bits_per_pixel > 32) )
         return;
diff --git a/xen/drivers/video/vga.c b/xen/drivers/video/vga.c
index 40e5963..608d92b 100644
--- a/xen/drivers/video/vga.c
+++ b/xen/drivers/video/vga.c
@@ -8,12 +8,10 @@
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/mm.h>
-#include <xen/vga.h>
+#include <xen/video.h>
 #include <xen/pci.h>
 #include <asm/io.h>
-
-/* Filled in by arch boot code. */
-struct xen_vga_console_info vga_console_info;
+#include <asm/boot_info.h>
 
 static int vgacon_keep;
 static unsigned int xpos, ypos;
@@ -75,15 +73,15 @@ void __init video_init(void)
             vgacon_keep = 1;
     }
 
-    switch ( vga_console_info.video_type )
+    switch ( boot_info->vga_console_info.video_type )
     {
     case XEN_VGATYPE_TEXT_MODE_3:
         if ( page_is_ram_type(paddr_to_pfn(0xB8000), RAM_TYPE_CONVENTIONAL) ||
              ((video = ioremap(0xB8000, 0x8000)) == NULL) )
             return;
         outw(0x200a, 0x3d4); /* disable cursor */
-        columns = vga_console_info.u.text_mode_3.columns;
-        lines   = vga_console_info.u.text_mode_3.rows;
+        columns = boot_info->vga_console_info.u.text_mode_3.columns;
+        lines   = boot_info->vga_console_info.u.text_mode_3.rows;
         memset(video, 0, columns * lines * 2);
         video_puts = vga_text_puts;
         break;
@@ -92,7 +90,7 @@ void __init video_init(void)
         vesa_early_init();
         break;
     default:
-        memset(&vga_console_info, 0, sizeof(vga_console_info));
+        memset(&boot_info->vga_console_info, 0, 
sizeof(boot_info->vga_console_info));
         break;
     }
 }
@@ -163,7 +161,7 @@ void __init video_endboot(void)
             }
     }
 
-    switch ( vga_console_info.video_type )
+    switch ( boot_info->vga_console_info.video_type )
     {
     case XEN_VGATYPE_TEXT_MODE_3:
         if ( !vgacon_keep )
@@ -206,6 +204,6 @@ static void vga_text_puts(const char *s)
 
 int __init fill_console_start_info(struct dom0_vga_console_info *ci)
 {
-    memcpy(ci, &vga_console_info, sizeof(*ci));
+    memcpy(ci, &boot_info->vga_console_info, sizeof(*ci));
     return 1;
 }
diff --git a/xen/include/asm-x86/boot_info.h b/xen/include/asm-x86/boot_info.h
index 7444876..df31627 100644
--- a/xen/include/asm-x86/boot_info.h
+++ b/xen/include/asm-x86/boot_info.h
@@ -19,6 +19,7 @@
 #define __BOOT_INFO_H__
 
 #include <xen/types.h>
+#include <xen/video.h>
 
 #include <asm/e820.h>
 #include <asm/mbd.h>
@@ -79,6 +80,13 @@ typedef struct {
     /* SMBIOS physical address. */
     paddr_t smbios;
 
+    /* VGA console info. */
+    struct xen_vga_console_info vga_console_info;
+
+    /* EDID info. */
+    unsigned short edid_caps;
+    unsigned char *edid_info;
+
     /* Number of modules. */
     unsigned int mods_nr;
 
diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h
index 210ff57..ae68322 100644
--- a/xen/include/asm-x86/config.h
+++ b/xen/include/asm-x86/config.h
@@ -119,8 +119,6 @@ extern unsigned int trampoline_xen_phys_start;
 extern unsigned char trampoline_cpu_started;
 extern char wakeup_start[];
 extern unsigned int video_mode, video_flags;
-extern unsigned short boot_edid_caps;
-extern unsigned char boot_edid_info[128];
 #endif
 
 #define asmlinkage
diff --git a/xen/include/xen/vga.h b/xen/include/xen/vga.h
deleted file mode 100644
index f72b63d..0000000
--- a/xen/include/xen/vga.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- *  vga.h
- *
- *  This file is subject to the terms and conditions of the GNU General Public
- *  License.  See the file COPYING in the main directory of this archive
- *  for more details.
- */
-
-#ifndef _XEN_VGA_H
-#define _XEN_VGA_H
-
-#include <xen/video.h>
-
-#ifdef CONFIG_VGA
-extern struct xen_vga_console_info vga_console_info;
-#endif
-
-#endif /* _XEN_VGA_H */
-- 
1.7.10.4


_______________________________________________
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®.