From: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
To: "Prakhya,
Sai Praneeth"
<sai.praneeth.prakhya-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Josh Triplett <josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org>,
"linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Borislav Petkov <bp-l3A5Bk7waGM@public.gmane.org>,
"Neri,
Ricardo" <ricardo.neri-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
"Shankar,
Ravi V" <ravi.v.shankar-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] x86/efi-bgrt: Fix kernel panic when mapping BGRT data
Date: Mon, 14 Dec 2015 15:08:17 +0000 [thread overview]
Message-ID: <20151214150817.GB2571@codeblueprint.co.uk> (raw)
In-Reply-To: <FFF73D592F13FD46B8700F0A279B802F014F2335-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
On Fri, 11 Dec, at 05:58:09AM, Sai Praneeth Prakhya wrote:
>
> >The original motivation for efi_lookup_mapped_addr came from
> >early_ioremap printing a warning if used on an address range
> >already mapped as RAM. Does early_mem* handle that case correctly
> >without a warning?
>
> Thanks a lot Josh for letting me know that. I don't think
> early_memremap() does that because early_memremap() and
> early_ioremap() both use __early_ioremap() but with different page
> protections (and I am not sure how those protections effect warning,
> but I will check that). Waiting for comments from Matt and Boris.
Right, early_memremap() was introduced for the purpose of mapping RAM,
so we shouldn't be seeing any warning here.
> >Because not all firmware places the BGRT image in boot services
> >memory; some firmware places the BGRT image variously in BIOS
> >reserved memory, ACPI reclaim >space, or other strange places.
> >
> >- Josh Triplett
>
> I think we should not support buggy firmware implementations because
> it's same as encouraging them, instead we could let user know that
> he has got a buggy firmware and we skip bgrt code as if bgrt was
> disabled and carry on with normal boot process. One way of detecting
> buggy implementation without doing page table switch in
> efi_bgrt_init() is to enable a chicken bit if we find bgrt header
> and image address in EFI_BOOT_SERVICES_DATA regions while we are
> switching efi runtime services to virtual mode in
> __efi_enter_virtual_mode() and check for the same bit in
> efi_bgrt_init().
Trying to inform firmware developers that we noticed some buggy
behaviour should definitely be discussed as a separate patch (because
it's debatable whether there's any value in that in this scenario).
The changes in this patch look OK to me, and I think all of Josh's
concerns have been addressed. So unless anyone complains soon, I'm
going to apply it and send it to tip.
WARNING: multiple messages have this Message-ID (diff)
From: Matt Fleming <matt@codeblueprint.co.uk>
To: "Prakhya, Sai Praneeth" <sai.praneeth.prakhya@intel.com>
Cc: Josh Triplett <josh@joshtriplett.org>,
"linux-efi@vger.kernel.org" <linux-efi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Borislav Petkov <bp@suse.de>,
"Neri, Ricardo" <ricardo.neri@intel.com>,
"Shankar, Ravi V" <ravi.v.shankar@intel.com>
Subject: Re: [PATCH] x86/efi-bgrt: Fix kernel panic when mapping BGRT data
Date: Mon, 14 Dec 2015 15:08:17 +0000 [thread overview]
Message-ID: <20151214150817.GB2571@codeblueprint.co.uk> (raw)
In-Reply-To: <FFF73D592F13FD46B8700F0A279B802F014F2335@ORSMSX109.amr.corp.intel.com>
On Fri, 11 Dec, at 05:58:09AM, Sai Praneeth Prakhya wrote:
>
> >The original motivation for efi_lookup_mapped_addr came from
> >early_ioremap printing a warning if used on an address range
> >already mapped as RAM. Does early_mem* handle that case correctly
> >without a warning?
>
> Thanks a lot Josh for letting me know that. I don't think
> early_memremap() does that because early_memremap() and
> early_ioremap() both use __early_ioremap() but with different page
> protections (and I am not sure how those protections effect warning,
> but I will check that). Waiting for comments from Matt and Boris.
Right, early_memremap() was introduced for the purpose of mapping RAM,
so we shouldn't be seeing any warning here.
> >Because not all firmware places the BGRT image in boot services
> >memory; some firmware places the BGRT image variously in BIOS
> >reserved memory, ACPI reclaim >space, or other strange places.
> >
> >- Josh Triplett
>
> I think we should not support buggy firmware implementations because
> it's same as encouraging them, instead we could let user know that
> he has got a buggy firmware and we skip bgrt code as if bgrt was
> disabled and carry on with normal boot process. One way of detecting
> buggy implementation without doing page table switch in
> efi_bgrt_init() is to enable a chicken bit if we find bgrt header
> and image address in EFI_BOOT_SERVICES_DATA regions while we are
> switching efi runtime services to virtual mode in
> __efi_enter_virtual_mode() and check for the same bit in
> efi_bgrt_init().
Trying to inform firmware developers that we noticed some buggy
behaviour should definitely be discussed as a separate patch (because
it's debatable whether there's any value in that in this scenario).
The changes in this patch look OK to me, and I think all of Josh's
concerns have been addressed. So unless anyone complains soon, I'm
going to apply it and send it to tip.
next prev parent reply other threads:[~2015-12-14 15:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-10 18:27 [PATCH] x86/efi-bgrt: Fix kernel panic when mapping BGRT data Sai Praneeth Prakhya
[not found] ` <1449772021-983-1-git-send-email-sai.praneeth.prakhya-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-12-10 21:42 ` Josh Triplett
2015-12-10 21:42 ` Josh Triplett
2015-12-11 5:58 ` Prakhya, Sai Praneeth
2015-12-11 5:58 ` Prakhya, Sai Praneeth
[not found] ` <FFF73D592F13FD46B8700F0A279B802F014F2335-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-12-14 15:08 ` Matt Fleming [this message]
2015-12-14 15:08 ` Matt Fleming
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=20151214150817.GB2571@codeblueprint.co.uk \
--to=matt-mf/unelci9gs6ibeejttw/xrex20p6io@public.gmane.org \
--cc=bp-l3A5Bk7waGM@public.gmane.org \
--cc=josh-iaAMLnmF4UmaiuxdJuQwMA@public.gmane.org \
--cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ravi.v.shankar-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=ricardo.neri-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=sai.praneeth.prakhya-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.