Re: [PATCH] x86/efi-bgrt: Switch pr_err() to pr_debug() for invalid BGRT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Matt!

The patch works for me against linux 4.0.6. I no longer see the
message in dmesg with the BIOS option set to "Auto". I assume this is
expected? It will only be displayed if I build it with a debug flag,
right?
https://www.kernel.org/doc/local/pr_debug.txt

On 29 June 2015 at 20:06, Matt Fleming <matt@xxxxxxxxxxxxxxxxxxx> wrote:
> From: Matt Fleming <matt.fleming@xxxxxxxxx>
>
> 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@xxxxxxxxx>
> Cc: Josh Triplett <josh@xxxxxxxxxxxxxxxx>
> Cc: Matthew Garrett <mjg59@xxxxxxxxxxxxx>
> Signed-off-by: Matt Fleming <matt.fleming@xxxxxxxxx>
> ---
>
> 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
>
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux