video: fix handling framebuffer located above 4GB
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Mon, 23 Sep 2019 12:31:47 +0000 (14:31 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 23 Sep 2019 12:31:47 +0000 (14:31 +0200)
commitc250e2d5c0d3f2c2d3192968b875c6b31ec916fe
tree45127ac499370ebbf1b6712930987ea29b41f7dc
parent08cb4b93dd898246131791cd8491ae35c5ef8f55
video: fix handling framebuffer located above 4GB

On some machines (for example Thinkpad P52), UEFI GOP reports
framebuffer located above 4GB (0x4000000000 on that machine). This
address does not fit in {xen,dom0}_vga_console_info.u.vesa_lfb.lfb_base
field, which is 32bit. The overflow here cause all kind of memory
corruption when anything tries to write something on the screen,
starting with zeroing the whole framebuffer in vesa_init().

Fix this similar to how it's done in Linux: add ext_lfb_base field at
the end of the structure, to hold upper 32bits of the address. Since the
field is added at the end of the structure, it will work with older
Linux versions too (other than using possibly truncated address - no
worse than without this change). Thanks to ABI containing size of the
structure (start_info.console.dom0.info_size), Linux can detect when
this field is present and use it appropriately then.

Since this change public interface and use __XEN_INTERFACE_VERSION__,
bump __XEN_LATEST_INTERFACE_VERSION__.

Note: if/when backporting this change to Xen <= 4.12, #if in xen.h needs
to be extended with " || defined(__XEN__)".

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 9cf11fdcd91ff8e9cd038f8336cf21f0701e8b7b
master date: 2019-05-17 14:48:23 +0200
xen/arch/x86/efi/efi-boot.h
xen/drivers/video/vesa.c
xen/include/public/xen-compat.h
xen/include/public/xen.h