public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Matt Fleming <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mjg59@srcf.ucam.org, tglx@linutronix.de, mingo@kernel.org,
	hpa@zytor.com, linux-kernel@vger.kernel.org,
	josh@joshtriplett.org, tom.ty89@gmail.com,
	torvalds@linux-foundation.org, matt.fleming@intel.com,
	peterz@infradead.org
Subject: [tip:core/efi] x86/efi-bgrt: Switch pr_err() to pr_debug() for invalid BGRT
Date: Sun, 9 Aug 2015 03:23:40 -0700	[thread overview]
Message-ID: <tip-248fbcd5aee00f6519a12c5ed3bc3dc0f5e84de5@git.kernel.org> (raw)
In-Reply-To: <1438936621-5215-2-git-send-email-matt@codeblueprint.co.uk>

Commit-ID:  248fbcd5aee00f6519a12c5ed3bc3dc0f5e84de5
Gitweb:     http://git.kernel.org/tip/248fbcd5aee00f6519a12c5ed3bc3dc0f5e84de5
Author:     Matt Fleming <matt.fleming@intel.com>
AuthorDate: Fri, 7 Aug 2015 09:36:55 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 8 Aug 2015 10:37:39 +0200

x86/efi-bgrt: Switch pr_err() to pr_debug() for invalid BGRT

It's totally legitimate, per the ACPI spec, for the firmware to
set the BGRT 'status' field to zero to indicate that the BGRT
image isn't being displayed, and we shouldn't be printing an
error message in that case because it's just noise for users. So
swap pr_err() for pr_debug().

However, Josh points that out it still makes sense to test the
validity of the upper 7 bits of the 'status' field, since
they're marked as "reserved" in the spec and must be zero. If
firmware violates this it really *is* an error.

Reported-by: Tom Yan <tom.ty89@gmail.com>
Tested-by: Tom Yan <tom.ty89@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1438936621-5215-2-git-send-email-matt@codeblueprint.co.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/platform/efi/efi-bgrt.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/x86/platform/efi/efi-bgrt.c b/arch/x86/platform/efi/efi-bgrt.c
index d7f997f..ea48449 100644
--- a/arch/x86/platform/efi/efi-bgrt.c
+++ b/arch/x86/platform/efi/efi-bgrt.c
@@ -50,11 +50,16 @@ void __init efi_bgrt_init(void)
 		       bgrt_tab->version);
 		return;
 	}
-	if (bgrt_tab->status != 1) {
-		pr_err("Ignoring BGRT: invalid status %u (expected 1)\n",
+	if (bgrt_tab->status & 0xfe) {
+		pr_err("Ignoring BGRT: reserved status bits are non-zero %u\n",
 		       bgrt_tab->status);
 		return;
 	}
+	if (bgrt_tab->status != 1) {
+		pr_debug("Ignoring BGRT: invalid status %u (expected 1)\n",
+			 bgrt_tab->status);
+		return;
+	}
 	if (bgrt_tab->image_type != 0) {
 		pr_err("Ignoring BGRT: invalid image type %u (expected 0)\n",
 		       bgrt_tab->image_type);

           reply	other threads:[~2015-08-09 10:24 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1438936621-5215-2-git-send-email-matt@codeblueprint.co.uk>]

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=tip-248fbcd5aee00f6519a12c5ed3bc3dc0f5e84de5@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=mingo@kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tom.ty89@gmail.com \
    --cc=torvalds@linux-foundation.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