From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Daniel Kiper <daniel.kiper@oracle.com>, xen-devel@lists.xenproject.org
Cc: jgross@suse.com, keir@xen.org, ian.campbell@citrix.com,
stefano.stabellini@eu.citrix.com, ross.philipson@citrix.com,
roy.franz@linaro.org, ning.sun@intel.com, jbeulich@suse.com,
qiaowei.ren@intel.com, richard.l.maliszewski@intel.com,
gang.wei@intel.com, fu.wei@linaro.org
Subject: Re: [PATCH for-xen-4.5 v4 15/18] x86: move video data to boot_info
Date: Fri, 17 Oct 2014 23:55:09 +0100 [thread overview]
Message-ID: <54419E4D.4000801@citrix.com> (raw)
In-Reply-To: <1413555132-22138-16-git-send-email-daniel.kiper@oracle.com>
On 17/10/2014 15:12, Daniel Kiper wrote:
> Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
After adjusting for previously-expressed issues,
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> 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 c1a4977..5f990e1 100644
> --- a/xen/arch/x86/boot_info.c
> +++ b/xen/arch/x86/boot_info.c
> @@ -33,11 +33,46 @@
> #include <asm/page.h>
> #include <asm/setup.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,
> @@ -52,6 +87,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);
> +}
> +
> boot_info_t __init *__init_boot_info(u32 mbd_pa)
> {
> mbd_t *mbd = __va(mbd_pa);
> @@ -155,6 +231,8 @@ boot_info_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 d8b30c1..8ee3e93 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 6417419..05f9e93 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;
> @@ -592,8 +522,6 @@ void __init noreturn __start_xen(boot_info_t *boot_info_ptr)
> * 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)) );
> @@ -621,20 +549,20 @@ void __init noreturn __start_xen(boot_info_t *boot_info_ptr)
> 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");
> @@ -642,15 +570,15 @@ void __init noreturn __start_xen(boot_info_t *boot_info_ptr)
> }
>
> /* 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 abaebd4..6212bed 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 4d888ab..97f8a3b 100644
> --- a/xen/include/asm-x86/boot_info.h
> +++ b/xen/include/asm-x86/boot_info.h
> @@ -20,6 +20,7 @@
> #define __BOOT_INFO_H__
>
> #include <xen/types.h>
> +#include <xen/video.h>
>
> #include <asm/e820.h>
> #include <asm/mbd.h>
> @@ -80,6 +81,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 */
next prev parent reply other threads:[~2014-10-17 22:55 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-17 14:11 [PATCH for-xen-4.5 v4 00/18] xen: Break multiboot (v1) dependency and add multiboot2 support Daniel Kiper
2014-10-17 14:11 ` [PATCH for-xen-4.5 v4 01/18] xen/makefile: clean target should remove xen.efi binary Daniel Kiper
2014-10-17 14:11 ` [PATCH for-xen-4.5 v4 02/18] x86/boot: fix reloc.S build dependencies Daniel Kiper
2014-10-17 14:51 ` Jan Beulich
2014-10-17 16:10 ` Daniel Kiper
2014-10-17 16:22 ` Jan Beulich
2014-10-17 14:56 ` Andrew Cooper
2014-10-17 15:10 ` Jan Beulich
2014-10-17 14:11 ` [PATCH for-xen-4.5 v4 03/18] x86: define cmdline_cook() loader_name argument as a const Daniel Kiper
2014-10-17 14:11 ` [PATCH for-xen-4.5 v4 04/18] x86/boot: use constant in head.S instead of hardcoded value Daniel Kiper
2014-10-17 15:00 ` Andrew Cooper
2014-10-17 15:52 ` Daniel Kiper
2014-10-17 16:18 ` Jan Beulich
2014-10-17 16:22 ` Daniel Kiper
2014-10-20 8:00 ` Jan Beulich
2014-10-17 14:11 ` [PATCH for-xen-4.5 v4 05/18] x86/boot/reloc: create generic alloc and copy functions Daniel Kiper
2014-10-17 16:04 ` Andrew Cooper
2014-10-17 17:11 ` Daniel Kiper
2014-10-17 17:22 ` Andrew Cooper
2014-10-17 14:11 ` [PATCH for-xen-4.5 v4 06/18] x86: introduce MultiBoot Data (MBD) type Daniel Kiper
2014-10-17 17:14 ` Andrew Cooper
2014-10-17 14:12 ` [PATCH for-xen-4.5 v4 07/18] x86/efi: add place_string_u32() function Daniel Kiper
2014-10-17 14:12 ` [PATCH for-xen-4.5 v4 08/18] x86: introduce boot_info structure Daniel Kiper
2014-10-17 20:55 ` Andrew Cooper
2014-10-17 14:12 ` [PATCH for-xen-4.5 v4 09/18] x86: move boot_loader_name from mbi to boot_info Daniel Kiper
2014-10-17 21:05 ` Andrew Cooper
2014-10-17 14:12 ` [PATCH for-xen-4.5 v4 10/18] x86: move cmdline " Daniel Kiper
2014-10-17 21:27 ` Andrew Cooper
2014-10-17 14:12 ` [PATCH for-xen-4.5 v4 11/18] x86: move legacy BIOS memory map stuff " Daniel Kiper
2014-10-17 22:08 ` Andrew Cooper
2014-10-17 14:12 ` [PATCH for-xen-4.5 v4 12/18] x86: move modules data from mbi to boot_info and remove mbi Daniel Kiper
2014-10-17 22:35 ` Andrew Cooper
2014-10-20 8:38 ` Jan Beulich
2014-10-17 14:12 ` [PATCH for-xen-4.5 v4 13/18] x86: move EFI memory map stuff to boot_info Daniel Kiper
2014-10-17 14:12 ` [PATCH for-xen-4.5 v4 14/18] x86: move MPS, ACPI and SMBIOS data " Daniel Kiper
2014-10-17 22:51 ` Andrew Cooper
2014-10-17 14:12 ` [PATCH for-xen-4.5 v4 15/18] x86: move video " Daniel Kiper
2014-10-17 22:55 ` Andrew Cooper [this message]
2014-10-17 14:12 ` [PATCH for-xen-4.5 v4 16/18] x86: move HDD " Daniel Kiper
2014-10-17 22:57 ` Andrew Cooper
2014-10-17 14:12 ` [PATCH for-xen-4.5 v4 17/18] x86/boot: use %ecx instead of %eax Daniel Kiper
2014-10-17 14:12 ` [PATCH for-xen-4.5 v4 18/18] xen/x86: add multiboot2 protocol support Daniel Kiper
2014-10-17 23:13 ` Andrew Cooper
2014-10-17 14:42 ` [PATCH for-xen-4.5 v4 00/18] xen: Break multiboot (v1) dependency and add multiboot2 support Jan Beulich
2014-10-17 15:49 ` Daniel Kiper
2014-10-23 10:19 ` Jan Beulich
2014-10-23 11:08 ` Andrew Cooper
2014-10-23 14:57 ` Daniel Kiper
2014-10-23 15:26 ` Jan Beulich
2014-10-23 15:50 ` Daniel Kiper
2014-10-23 16:04 ` Jan Beulich
2014-10-23 17:55 ` konrad wilk
2014-10-24 9:09 ` Jan Beulich
2014-10-23 15:55 ` Andrew Cooper
2014-10-23 18:04 ` konrad wilk
2014-10-23 21:55 ` Andrew Cooper
2014-10-24 7:07 ` Daniel Kiper
2014-10-23 11:14 ` Stefano Stabellini
2014-10-23 11:33 ` Jan Beulich
2014-10-17 18:02 ` Roy Franz
2014-10-27 11:09 ` Daniel Kiper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54419E4D.4000801@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=daniel.kiper@oracle.com \
--cc=fu.wei@linaro.org \
--cc=gang.wei@intel.com \
--cc=ian.campbell@citrix.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=keir@xen.org \
--cc=ning.sun@intel.com \
--cc=qiaowei.ren@intel.com \
--cc=richard.l.maliszewski@intel.com \
--cc=ross.philipson@citrix.com \
--cc=roy.franz@linaro.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.