All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/2] Add capsule-pstore backend support
@ 2020-03-12  1:13 Qiuxu Zhuo
  2020-03-15 13:56 ` Ard Biesheuvel
  0 siblings, 1 reply; 9+ messages in thread
From: Qiuxu Zhuo @ 2020-03-12  1:13 UTC (permalink / raw)
  To: ardb, keescook; +Cc: tony.luck, matt, liming.gao, linux-efi, Qiuxu Zhuo

Change Log v5->v6:
  Part1: No changes.
  Part2: Update capsule-pstore.c file header.
         Move the variable 'efi_capsule_pstore_info' backward (for removing some function declarations).


History:
  The v5 was sent about two years ago [1]. At that time there was a concern about the EFI system table
  entry 'CapsulePtr' as below: whether it was an array of capsules or an array of pointers to capsules.

      typedef struct { UINT32 CapsuleArrayNumber; VOID* CapsulePtr[1]; } EFI_CAPSULE_TABLE;

  The latest UEFI specification v2.8 [2] has a clarification in P268 for 'CapsulePtr'  as below:

      "CapsulePtr A pointer to an array of capsules that contain the same CapsuleGuid value.
       Each CapsulePtr points to an instance of an EFI_CAPSULE_HEADER, with the capsule data
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       concatenated on its end."
       ^^^^^^^^^^^^^^^^^^^^^^^

  According to the highlighted description above, the 'CapsulePtr' should be an array of pointers to capsules.
  The capsule-pstore driver and the tested BIOS also use the 'CapsulePtr' as an array of pointers to capsules.


Test:
  The v6 is well-tested on an Intel Kaby Lake client platform + BIOS(10/24/2016) and an Intel Ice Lake
  client platform + BIOS(09/12/2019).

Reference:
  [1] https://lore.kernel.org/linux-efi/?q=capsule-pstore
  [2] https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_A_Feb14.pdf 

Qiuxu Zhuo (2):
  efi: Add 'nr_config_table' variable in efi structure
  eif/capsule-pstore: Add capsule pstore backend

 arch/x86/platform/efi/efi.c           |   1 +
 drivers/firmware/efi/Kconfig          |  21 +
 drivers/firmware/efi/Makefile         |   1 +
 drivers/firmware/efi/arm-init.c       |   4 +-
 drivers/firmware/efi/capsule-pstore.c | 692 ++++++++++++++++++++++++++
 drivers/firmware/efi/efi.c            |   1 +
 include/linux/efi.h                   |   1 +
 7 files changed, 720 insertions(+), 1 deletion(-)
 create mode 100644 drivers/firmware/efi/capsule-pstore.c

-- 
2.17.1


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

* Re: [PATCH v6 0/2] Add capsule-pstore backend support
  2020-03-12  1:13 [PATCH v6 0/2] Add capsule-pstore backend support Qiuxu Zhuo
@ 2020-03-15 13:56 ` Ard Biesheuvel
  2020-03-15 14:45   ` Zhuo, Qiuxu
  2020-03-16  5:32   ` Zhuo, Qiuxu
  0 siblings, 2 replies; 9+ messages in thread
From: Ard Biesheuvel @ 2020-03-15 13:56 UTC (permalink / raw)
  To: Qiuxu Zhuo; +Cc: Kees Cook, Tony Luck, Matt Fleming, Gao, Liming, linux-efi

On Wed, 11 Mar 2020 at 21:12, Qiuxu Zhuo <qiuxu.zhuo@intel.com> wrote:
>
> Change Log v5->v6:
>   Part1: No changes.
>   Part2: Update capsule-pstore.c file header.
>          Move the variable 'efi_capsule_pstore_info' backward (for removing some function declarations).
>

This conflicts badly with the efi/core changes queued up in the tip
tree (and hence linux-next) Please rebase and repost


>
> History:
>   The v5 was sent about two years ago [1]. At that time there was a concern about the EFI system table
>   entry 'CapsulePtr' as below: whether it was an array of capsules or an array of pointers to capsules.
>
>       typedef struct { UINT32 CapsuleArrayNumber; VOID* CapsulePtr[1]; } EFI_CAPSULE_TABLE;
>
>   The latest UEFI specification v2.8 [2] has a clarification in P268 for 'CapsulePtr'  as below:
>
>       "CapsulePtr A pointer to an array of capsules that contain the same CapsuleGuid value.
>        Each CapsulePtr points to an instance of an EFI_CAPSULE_HEADER, with the capsule data
>        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>        concatenated on its end."
>        ^^^^^^^^^^^^^^^^^^^^^^^
>
>   According to the highlighted description above, the 'CapsulePtr' should be an array of pointers to capsules.
>   The capsule-pstore driver and the tested BIOS also use the 'CapsulePtr' as an array of pointers to capsules.
>
>
> Test:
>   The v6 is well-tested on an Intel Kaby Lake client platform + BIOS(10/24/2016) and an Intel Ice Lake
>   client platform + BIOS(09/12/2019).
>
> Reference:
>   [1] https://lore.kernel.org/linux-efi/?q=capsule-pstore
>   [2] https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_A_Feb14.pdf
>
> Qiuxu Zhuo (2):
>   efi: Add 'nr_config_table' variable in efi structure
>   eif/capsule-pstore: Add capsule pstore backend
>
>  arch/x86/platform/efi/efi.c           |   1 +
>  drivers/firmware/efi/Kconfig          |  21 +
>  drivers/firmware/efi/Makefile         |   1 +
>  drivers/firmware/efi/arm-init.c       |   4 +-
>  drivers/firmware/efi/capsule-pstore.c | 692 ++++++++++++++++++++++++++
>  drivers/firmware/efi/efi.c            |   1 +
>  include/linux/efi.h                   |   1 +
>  7 files changed, 720 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/firmware/efi/capsule-pstore.c
>
> --
> 2.17.1
>

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

* RE: [PATCH v6 0/2] Add capsule-pstore backend support
  2020-03-15 13:56 ` Ard Biesheuvel
@ 2020-03-15 14:45   ` Zhuo, Qiuxu
  2020-03-16  5:32   ` Zhuo, Qiuxu
  1 sibling, 0 replies; 9+ messages in thread
From: Zhuo, Qiuxu @ 2020-03-15 14:45 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Kees Cook, Luck, Tony, Matt Fleming, Gao, Liming, linux-efi

> From: linux-efi-owner@vger.kernel.org <linux-efi-owner@vger.kernel.org> On Behalf Of Ard Biesheuvel
>> ...
> >          Move the variable 'efi_capsule_pstore_info' backward (for removing some function declarations).
> 
> This conflicts badly with the efi/core changes queued up in the tip tree (and hence linux-next) Please rebase and repost

OK. Will rebase the patches on top of tip tree and repost.

-Qiuxu


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

* RE: [PATCH v6 0/2] Add capsule-pstore backend support
  2020-03-15 13:56 ` Ard Biesheuvel
  2020-03-15 14:45   ` Zhuo, Qiuxu
@ 2020-03-16  5:32   ` Zhuo, Qiuxu
  2020-03-18 20:19     ` Ard Biesheuvel
  1 sibling, 1 reply; 9+ messages in thread
From: Zhuo, Qiuxu @ 2020-03-16  5:32 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Kees Cook, Luck, Tony, Matt Fleming, Gao, Liming, linux-efi

> From: linux-efi-owner@vger.kernel.org <linux-efi-owner@vger.kernel.org> On
>...
> On Wed, 11 Mar 2020 at 21:12, Qiuxu Zhuo <qiuxu.zhuo@intel.com> wrote:
> >
> > Change Log v5->v6:
> >   Part1: No changes.
> >   Part2: Update capsule-pstore.c file header.
> >          Move the variable 'efi_capsule_pstore_info' backward (for removing
> some function declarations).
> >
> 
> This conflicts badly with the efi/core changes queued up in the tip tree (and hence linux-next) Please rebase and repost

Hi Ard,

The following commit on the tip tree removes the variables 'config_table' from the efi structure.

    9cd437ac0ef4 ("efi/x86: Make fw_vendor, config_table and runtime sysfs nodes x86 specific")

But the external driver "capsule-pstore.ko" needs to access 'config_table' and 'nr_tables' to go through
the configuration table to extract crash capsules.

Adding 'config_table' and 'nr_tables' back to the efi structure looks like not a good way. 
Do you have any  suggestion on how to export 'config_table' and 'nr_tables' variables for the external driver "capsule-pstore.ko"?

Thanks!
-Qiuxu




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

* Re: [PATCH v6 0/2] Add capsule-pstore backend support
  2020-03-16  5:32   ` Zhuo, Qiuxu
@ 2020-03-18 20:19     ` Ard Biesheuvel
  2020-03-19  8:53       ` Zhuo, Qiuxu
  0 siblings, 1 reply; 9+ messages in thread
From: Ard Biesheuvel @ 2020-03-18 20:19 UTC (permalink / raw)
  To: Zhuo, Qiuxu; +Cc: Kees Cook, Luck, Tony, Matt Fleming, Gao, Liming, linux-efi

On Mon, 16 Mar 2020 at 01:33, Zhuo, Qiuxu <qiuxu.zhuo@intel.com> wrote:
>
> > From: linux-efi-owner@vger.kernel.org <linux-efi-owner@vger.kernel.org> On
> >...
> > On Wed, 11 Mar 2020 at 21:12, Qiuxu Zhuo <qiuxu.zhuo@intel.com> wrote:
> > >
> > > Change Log v5->v6:
> > >   Part1: No changes.
> > >   Part2: Update capsule-pstore.c file header.
> > >          Move the variable 'efi_capsule_pstore_info' backward (for removing
> > some function declarations).
> > >
> >
> > This conflicts badly with the efi/core changes queued up in the tip tree (and hence linux-next) Please rebase and repost
>
> Hi Ard,
>
> The following commit on the tip tree removes the variables 'config_table' from the efi structure.
>
>     9cd437ac0ef4 ("efi/x86: Make fw_vendor, config_table and runtime sysfs nodes x86 specific")
>
> But the external driver "capsule-pstore.ko" needs to access 'config_table' and 'nr_tables' to go through
> the configuration table to extract crash capsules.
>
> Adding 'config_table' and 'nr_tables' back to the efi structure looks like not a good way.
> Do you have any  suggestion on how to export 'config_table' and 'nr_tables' variables for the external driver "capsule-pstore.ko"?
>

I will get back to you on monday about this. In any case, this will
have to wait until v5.8

>

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

* RE: [PATCH v6 0/2] Add capsule-pstore backend support
  2020-03-18 20:19     ` Ard Biesheuvel
@ 2020-03-19  8:53       ` Zhuo, Qiuxu
  2020-03-20 19:25         ` Luck, Tony
  0 siblings, 1 reply; 9+ messages in thread
From: Zhuo, Qiuxu @ 2020-03-19  8:53 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Kees Cook, Luck, Tony, Matt Fleming, Gao, Liming, linux-efi

> From: linux-efi-owner@vger.kernel.org <linux-efi-owner@vger.kernel.org> On> Behalf Of Ard Biesheuvel
> ...
> > The following commit on the tip tree removes the variables 'config_table' from the efi structure.
> >
> >     9cd437ac0ef4 ("efi/x86: Make fw_vendor, config_table and runtime sysfs nodes x86 specific")
> >
> > But the external driver "capsule-pstore.ko" needs to access  'config_table' and 'nr_tables' to go through the configuration table to extract  crash capsules.
> >
> > Adding 'config_table' and 'nr_tables' back to the efi structure looks like not a good way.
> > Do you have any  suggestion on how to export 'config_table' and 'nr_tables' variables for the external driver "capsule-pstore.ko"?
> >
> 
> I will get back to you on monday about this. In any case, this will have to wait until v5.8

OK. Thanks!

-Qiuxu



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

* Re: [PATCH v6 0/2] Add capsule-pstore backend support
  2020-03-19  8:53       ` Zhuo, Qiuxu
@ 2020-03-20 19:25         ` Luck, Tony
  2020-03-25 15:52           ` Ard Biesheuvel
  0 siblings, 1 reply; 9+ messages in thread
From: Luck, Tony @ 2020-03-20 19:25 UTC (permalink / raw)
  To: Zhuo, Qiuxu
  Cc: Ard Biesheuvel, Kees Cook, Matt Fleming, Gao, Liming, linux-efi

On Thu, Mar 19, 2020 at 01:53:38AM -0700, Zhuo, Qiuxu wrote:
> > From: linux-efi-owner@vger.kernel.org <linux-efi-owner@vger.kernel.org> On> Behalf Of Ard Biesheuvel
> > ...
> > > The following commit on the tip tree removes the variables 'config_table' from the efi structure.
> > >
> > >     9cd437ac0ef4 ("efi/x86: Make fw_vendor, config_table and runtime sysfs nodes x86 specific")
> > >
> > > But the external driver "capsule-pstore.ko" needs to access  'config_table' and 'nr_tables' to go through the configuration table to extract  crash capsules.
> > >
> > > Adding 'config_table' and 'nr_tables' back to the efi structure looks like not a good way.
> > > Do you have any  suggestion on how to export 'config_table' and 'nr_tables' variables for the external driver "capsule-pstore.ko"?
> > >
> > 
> > I will get back to you on monday about this. In any case, this will have to wait until v5.8
> 
> OK. Thanks!

Would it be acceptable to take the first half of Qiuxu's
function efi_capsule_table_get() and move it into the
generic efi code naming it something like: "efi_get_table_by_guid()"?
Then EXPORT_GPL that function?

-Tony

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

* Re: [PATCH v6 0/2] Add capsule-pstore backend support
  2020-03-20 19:25         ` Luck, Tony
@ 2020-03-25 15:52           ` Ard Biesheuvel
  2020-03-25 17:33             ` Ard Biesheuvel
  0 siblings, 1 reply; 9+ messages in thread
From: Ard Biesheuvel @ 2020-03-25 15:52 UTC (permalink / raw)
  To: Luck, Tony; +Cc: Zhuo, Qiuxu, Kees Cook, Matt Fleming, Gao, Liming, linux-efi

On Fri, 20 Mar 2020 at 20:25, Luck, Tony <tony.luck@intel.com> wrote:
>
> On Thu, Mar 19, 2020 at 01:53:38AM -0700, Zhuo, Qiuxu wrote:
> > > From: linux-efi-owner@vger.kernel.org <linux-efi-owner@vger.kernel.org> On> Behalf Of Ard Biesheuvel
> > > ...
> > > > The following commit on the tip tree removes the variables 'config_table' from the efi structure.
> > > >
> > > >     9cd437ac0ef4 ("efi/x86: Make fw_vendor, config_table and runtime sysfs nodes x86 specific")
> > > >
> > > > But the external driver "capsule-pstore.ko" needs to access  'config_table' and 'nr_tables' to go through the configuration table to extract  crash capsules.
> > > >
> > > > Adding 'config_table' and 'nr_tables' back to the efi structure looks like not a good way.
> > > > Do you have any  suggestion on how to export 'config_table' and 'nr_tables' variables for the external driver "capsule-pstore.ko"?
> > > >
> > >
> > > I will get back to you on monday about this. In any case, this will have to wait until v5.8
> >
> > OK. Thanks!
>
> Would it be acceptable to take the first half of Qiuxu's
> function efi_capsule_table_get() and move it into the
> generic efi code naming it something like: "efi_get_table_by_guid()"?
> Then EXPORT_GPL that function?
>

That sounds reasonable to me.

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

* Re: [PATCH v6 0/2] Add capsule-pstore backend support
  2020-03-25 15:52           ` Ard Biesheuvel
@ 2020-03-25 17:33             ` Ard Biesheuvel
  0 siblings, 0 replies; 9+ messages in thread
From: Ard Biesheuvel @ 2020-03-25 17:33 UTC (permalink / raw)
  To: Luck, Tony; +Cc: Zhuo, Qiuxu, Kees Cook, Matt Fleming, Gao, Liming, linux-efi

On Wed, 25 Mar 2020 at 16:52, Ard Biesheuvel <ardb@kernel.org> wrote:
>
> On Fri, 20 Mar 2020 at 20:25, Luck, Tony <tony.luck@intel.com> wrote:
> >
> > On Thu, Mar 19, 2020 at 01:53:38AM -0700, Zhuo, Qiuxu wrote:
> > > > From: linux-efi-owner@vger.kernel.org <linux-efi-owner@vger.kernel.org> On> Behalf Of Ard Biesheuvel
> > > > ...
> > > > > The following commit on the tip tree removes the variables 'config_table' from the efi structure.
> > > > >
> > > > >     9cd437ac0ef4 ("efi/x86: Make fw_vendor, config_table and runtime sysfs nodes x86 specific")
> > > > >
> > > > > But the external driver "capsule-pstore.ko" needs to access  'config_table' and 'nr_tables' to go through the configuration table to extract  crash capsules.
> > > > >
> > > > > Adding 'config_table' and 'nr_tables' back to the efi structure looks like not a good way.
> > > > > Do you have any  suggestion on how to export 'config_table' and 'nr_tables' variables for the external driver "capsule-pstore.ko"?
> > > > >
> > > >
> > > > I will get back to you on monday about this. In any case, this will have to wait until v5.8
> > >
> > > OK. Thanks!
> >
> > Would it be acceptable to take the first half of Qiuxu's
> > function efi_capsule_table_get() and move it into the
> > generic efi code naming it something like: "efi_get_table_by_guid()"?
> > Then EXPORT_GPL that function?
> >
>
> That sounds reasonable to me.

Actually, I don't think this is necessary. The capsule pstore
implementation uses a fixed GUID, which we could simply add to the
common_tables[] array so that its address gets recorded when we
iterate over the list of config tables.

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

end of thread, other threads:[~2020-03-25 17:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12  1:13 [PATCH v6 0/2] Add capsule-pstore backend support Qiuxu Zhuo
2020-03-15 13:56 ` Ard Biesheuvel
2020-03-15 14:45   ` Zhuo, Qiuxu
2020-03-16  5:32   ` Zhuo, Qiuxu
2020-03-18 20:19     ` Ard Biesheuvel
2020-03-19  8:53       ` Zhuo, Qiuxu
2020-03-20 19:25         ` Luck, Tony
2020-03-25 15:52           ` Ard Biesheuvel
2020-03-25 17:33             ` Ard Biesheuvel

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.