From a98b4da4fd4f1c7ad9a47ade17f377b833e5c9ae Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Wed, 5 Dec 2018 17:21:01 +0800 Subject: x86: Handle 64bit framebuffer memory address properly In a EFI system, the frame buffer address is 64bit, so currently if the address is beyound 4G, kexec will set wrong address due to truncate. Linux kernel commit ae2ee627dc87 ('efifb: Add support for 64-bit frame buffer addresses') added support for 64bit frame buffer address, an 'ext_lfb_base' field is added as the upper 32-bits of the frame buffer, and introduced a new capability flag 'VIDEO_TYPE_CAPABILITY_64BIT_BASE' to indicate if the extend field is used. This patch adopts this change, set proper extent address and capability flag when the address is beyound 4G. Signed-off-by: Kairui Song Signed-off-by: Simon Horman --- kexec/arch/i386/x86-linux-setup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'kexec/arch/i386/x86-linux-setup.c') diff --git a/kexec/arch/i386/x86-linux-setup.c b/kexec/arch/i386/x86-linux-setup.c index 6cda12c..1bd408b 100644 --- a/kexec/arch/i386/x86-linux-setup.c +++ b/kexec/arch/i386/x86-linux-setup.c @@ -158,10 +158,15 @@ static int setup_linux_vesafb(struct x86_linux_param_header *real_mode) real_mode->lfb_width = var.xres; real_mode->lfb_height = var.yres; real_mode->lfb_depth = var.bits_per_pixel; - real_mode->lfb_base = fix.smem_start; + real_mode->lfb_base = fix.smem_start & 0xffffffffUL; real_mode->lfb_linelength = fix.line_length; real_mode->vesapm_seg = 0; + if (fix.smem_start > 0xffffffffUL) { + real_mode->ext_lfb_base = fix.smem_start >> 32; + real_mode->capabilities |= VIDEO_CAPABILITY_64BIT_BASE; + } + /* FIXME: better get size from the file returned by proc_iomem() */ real_mode->lfb_size = (fix.smem_len + 65535) / 65536; real_mode->pages = (fix.smem_len + 4095) / 4096; -- cgit