From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753395AbdDEICp (ORCPT ); Wed, 5 Apr 2017 04:02:45 -0400 Received: from terminus.zytor.com ([65.50.211.136]:59161 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751912AbdDEICn (ORCPT ); Wed, 5 Apr 2017 04:02:43 -0400 Date: Wed, 5 Apr 2017 00:57:55 -0700 From: "tip-bot for Cohen, Eugene" Message-ID: Cc: ard.biesheuvel@linaro.org, peterz@infradead.org, mingo@kernel.org, torvalds@linux-foundation.org, eugene@hp.com, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, matt@codeblueprint.co.uk Reply-To: torvalds@linux-foundation.org, mingo@kernel.org, peterz@infradead.org, ard.biesheuvel@linaro.org, matt@codeblueprint.co.uk, tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com, eugene@hp.com In-Reply-To: <20170404152744.26687-2-ard.biesheuvel@linaro.org> References: <20170404152744.26687-2-ard.biesheuvel@linaro.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:efi/urgent] efi/libstub: Skip GOP with PIXEL_BLT_ONLY format Git-Commit-ID: 540f4c0e894f7e46a66dfa424b16424cbdc12c38 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 540f4c0e894f7e46a66dfa424b16424cbdc12c38 Gitweb: http://git.kernel.org/tip/540f4c0e894f7e46a66dfa424b16424cbdc12c38 Author: Cohen, Eugene AuthorDate: Tue, 4 Apr 2017 16:27:43 +0100 Committer: Ingo Molnar CommitDate: Wed, 5 Apr 2017 09:20:18 +0200 efi/libstub: Skip GOP with PIXEL_BLT_ONLY format The UEFI Specification permits Graphics Output Protocol (GOP) instances without direct framebuffer access. This is indicated in the Mode structure with a PixelFormat enumeration value of PIXEL_BLT_ONLY. Given that the kernel does not know how to drive a Blt() only framebuffer (which is only permitted before ExitBootServices() anyway), we should disregard such framebuffers when looking for a GOP instance that is suitable for use as the boot console. So modify the EFI GOP initialization to not use a PIXEL_BLT_ONLY instance, preventing attempts later in boot to use an invalid screen_info.lfb_base address. Signed-off-by: Eugene Cohen [ Moved the Blt() only check into the loop and clarified that Blt() only GOPs are unusable by the kernel. ] Signed-off-by: Ard Biesheuvel Cc: # v4.7+ Cc: Linus Torvalds Cc: Matt Fleming Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: leif.lindholm@linaro.org Cc: linux-efi@vger.kernel.org Cc: lorenzo.pieralisi@arm.com Fixes: 9822504c1fa5 ("efifb: Enable the efi-framebuffer platform driver ...") Link: http://lkml.kernel.org/r/20170404152744.26687-2-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar --- drivers/firmware/efi/libstub/gop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/efi/libstub/gop.c b/drivers/firmware/efi/libstub/gop.c index 932742e..24c461d 100644 --- a/drivers/firmware/efi/libstub/gop.c +++ b/drivers/firmware/efi/libstub/gop.c @@ -149,7 +149,8 @@ setup_gop32(efi_system_table_t *sys_table_arg, struct screen_info *si, status = __gop_query32(sys_table_arg, gop32, &info, &size, ¤t_fb_base); - if (status == EFI_SUCCESS && (!first_gop || conout_found)) { + if (status == EFI_SUCCESS && (!first_gop || conout_found) && + info->pixel_format != PIXEL_BLT_ONLY) { /* * Systems that use the UEFI Console Splitter may * provide multiple GOP devices, not all of which are @@ -266,7 +267,8 @@ setup_gop64(efi_system_table_t *sys_table_arg, struct screen_info *si, status = __gop_query64(sys_table_arg, gop64, &info, &size, ¤t_fb_base); - if (status == EFI_SUCCESS && (!first_gop || conout_found)) { + if (status == EFI_SUCCESS && (!first_gop || conout_found) && + info->pixel_format != PIXEL_BLT_ONLY) { /* * Systems that use the UEFI Console Splitter may * provide multiple GOP devices, not all of which are