linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Fleming <matt@codeblueprint.co.uk>
To: Icenowy Zheng <icenowy@aosc.xyz>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-efi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Josh Triplett <josh@joshtriplett.org>,
	Dave Young <dyoung@redhat.com>, Josh Boyer <jwboyer@redhat.com>,
	Andy Lutomirski <luto@amacapital.net>
Subject: Re: [PATCH] x86/efi-bgrt: remove the check of the version field
Date: Mon, 15 Aug 2016 13:56:43 +0100	[thread overview]
Message-ID: <20160815125643.GG30909@codeblueprint.co.uk> (raw)
In-Reply-To: <20160809052546.31462-1-icenowy@aosc.xyz>

On Tue, 09 Aug, at 01:25:46PM, Icenowy Zheng wrote:
> Some broken firmwares have a wrongly filled version field in BGRT table.
> (See http://wiki.osdev.org/Broken_UEFI_implementations )
> 
> As we know, these firmwares can also provide correct BGRT image, although
> the table is wrong.
> 
> After removing the check of the version field, the kernel can now extract
> the image correctly, and the information is also correct.
> 
> Tested on a Thinkpad E531 (68854UC).
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
> ---
>  arch/x86/platform/efi/efi-bgrt.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/arch/x86/platform/efi/efi-bgrt.c b/arch/x86/platform/efi/efi-bgrt.c
> index 6a2f569..f492ea0 100644
> --- a/arch/x86/platform/efi/efi-bgrt.c
> +++ b/arch/x86/platform/efi/efi-bgrt.c
> @@ -47,11 +47,6 @@ void __init efi_bgrt_init(void)
>  		       bgrt_tab->header.length, sizeof(*bgrt_tab));
>  		return;
>  	}
> -	if (bgrt_tab->version != 1) {
> -		pr_notice("Ignoring BGRT: invalid version %u (expected 1)\n",
> -		       bgrt_tab->version);
> -		return;
> -	}
>  	if (bgrt_tab->status & 0xfe) {
>  		pr_notice("Ignoring BGRT: reserved status bits are non-zero %u\n",
>  		       bgrt_tab->status);

This would be less scary if we checked for known broken and known good
version values instead of removing the check altogether, i.e. 0 and 1.

The whole point of the version field is that it tells us about the
layout of the BGRT table, so it's not exactly a useless check.

  parent reply	other threads:[~2016-08-15 12:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160809052546.31462-1-icenowy@aosc.xyz>
     [not found] ` <20160809052546.31462-1-icenowy-ymACFijhrKM@public.gmane.org>
2016-08-10 12:52   ` [PATCH] x86/efi-bgrt: remove the check of the version field Ingo Molnar
     [not found]     ` <120791470839405@web16h.yandex.ru>
     [not found]       ` <120791470839405-TUpq1W2QCG9xpj1cXAZ9Bg@public.gmane.org>
2016-08-11  8:48         ` Ingo Molnar
2016-08-15 12:56 ` Matt Fleming [this message]
2016-08-15 16:09   ` Josh Triplett
     [not found]   ` <20160815125643.GG30909-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2016-08-17  5:44     ` Dave Young
2016-08-18 20:41       ` Matt Fleming
     [not found]         ` <20160818204130.GQ30909-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2016-08-22  7:28           ` Dave Young
     [not found]             ` <388401471855799@web30j.yandex.ru>
     [not found]               ` <388401471855799-X2xH9E7M2qxxpj1cXAZ9Bg@public.gmane.org>
2016-08-24  7:30                 ` Dave Young

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=20160815125643.GG30909@codeblueprint.co.uk \
    --to=matt@codeblueprint.co.uk \
    --cc=dyoung@redhat.com \
    --cc=hpa@zytor.com \
    --cc=icenowy@aosc.xyz \
    --cc=josh@joshtriplett.org \
    --cc=jwboyer@redhat.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).