linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/efi-bgrt: Switch pr_err() to pr_debug() for invalid BGRT
@ 2015-06-29 12:06 Matt Fleming
       [not found] ` <1435579602-6612-1-git-send-email-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Matt Fleming @ 2015-06-29 12:06 UTC (permalink / raw)
  To: Tom Yan
  Cc: Josh Triplett, Matthew Garrett, linux-efi-u79uwXL29TY76Z2rM5mHXA,
	linux-acpi-u79uwXL29TY76Z2rM5mHXA, Matt Fleming

From: Matt Fleming <matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Josh Triplett <josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org>
Cc: Matthew Garrett <mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
Signed-off-by: Matt Fleming <matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---

Tom, if you could test out this patch that would be really helpful. I'll
take this one through the EFI git repo.

 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 d7f997f7c26d..ea48449b2e63 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);
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-06-30 10:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-29 12:06 [PATCH] x86/efi-bgrt: Switch pr_err() to pr_debug() for invalid BGRT Matt Fleming
     [not found] ` <1435579602-6612-1-git-send-email-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-06-29 13:13   ` Borislav Petkov
     [not found]     ` <20150629131305.GB13113-fF5Pk5pvG8Y@public.gmane.org>
2015-06-29 14:00       ` Josh Triplett
2015-06-29 14:17         ` Borislav Petkov
     [not found]           ` <20150629141724.GG12383-fF5Pk5pvG8Y@public.gmane.org>
2015-06-29 14:45             ` josh-iaAMLnmF4UmaiuxdJuQwMA
2015-06-29 14:49           ` Matt Fleming
     [not found]             ` <20150629144940.GF28334-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-06-29 14:53               ` josh-iaAMLnmF4UmaiuxdJuQwMA
2015-06-29 15:44               ` Borislav Petkov
2015-06-29 16:35                 ` josh
2015-06-30  9:31                   ` Matt Fleming
2015-06-29 14:02   ` Josh Triplett
2015-06-29 21:52   ` Tom Yan
2015-06-30 10:00     ` Matt Fleming

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).