From: Igor Druzhinin Date: Thu, 10 Oct 2019 14:50:50 +0000 (+0200) Subject: x86/efi: properly handle 0 in pixel reserved bitmask X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~1303 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=521a1445510a30873aec471194045e7f4b5e8d75;p=xen.git x86/efi: properly handle 0 in pixel reserved bitmask In some graphics modes firmware is allowed to return 0 in pixel reserved bitmask which doesn't go against UEFI Spec 2.8 (12.9 Graphics Output Protocol). Without this change non-TrueColor modes won't work which will cause GOP init to fail - observed while trying to boot EFI Xen with Cirrus VGA. Signed-off-by: Igor Druzhinin Reviewed-by: Jan Beulich Release-acked-by: Juergen Gross --- diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h index a0737f98c3..940ce12706 100644 --- a/xen/arch/x86/efi/efi-boot.h +++ b/xen/arch/x86/efi/efi-boot.h @@ -528,9 +528,10 @@ static void __init efi_arch_video_init(EFI_GRAPHICS_OUTPUT_PROTOCOL *gop, bpp = set_color(mode_info->PixelInformation.BlueMask, bpp, &vga_console_info.u.vesa_lfb.blue_pos, &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); + if ( mode_info->PixelInformation.ReservedMask ) + bpp = set_color(mode_info->PixelInformation.ReservedMask, bpp, + &vga_console_info.u.vesa_lfb.rsvd_pos, + &vga_console_info.u.vesa_lfb.rsvd_size); if ( bpp > 0 ) break; /* fall through */