mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: "Bryan O'Donoghue" <pure.logic@nexus-software.ie>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "Kweh, Hock Leong" <hock.leong.kweh@intel.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Matt Fleming <matt@codeblueprint.co.uk>,
	"linux-efi@vger.kernel.org" <linux-efi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Borislav Petkov <bp@alien8.de>,
	Sascha Weisenberger <sascha.weisenberger@siemens.com>,
	Daniel Wagner <daniel.wagner@siemens.com>
Subject: Re: [PATCH 0/2] efi: Enhance capsule loader to support signed Quark images
Date: Sun, 19 Feb 2017 17:52:37 -0800	[thread overview]
Message-ID: <b4271434-3868-6014-1dfd-dde5c1381c9d@siemens.com> (raw)
In-Reply-To: <c1beeeb5-2359-d9c1-4759-b112c7d1a613@nexus-software.ie>

On 2017-02-19 17:33, Bryan O'Donoghue wrote:
> 
> 
> On 19/02/17 13:33, Jan Kiszka wrote:
>>> I would not object strongly to having conditionally compiled code in
>>> mainline that adds support for this, but bodging the default code path
>>> like this for a Quark quirk is out of the question imo.
>> I'm open for any consensus that avoids bending mainline too much and
>> still helps us (and maybe also other Quark X1020 integrators) getting
>> rid of additional patches.
> 
> We could make efi_capsule_setup_info() a weak symbol just like
> 
> drivers/firmware/efi/reboot.c:
> bool __weak efi_poweroff_required(void)
> 
> that way Arm is none the wiser and we can bury the Quark Quirk in
> x86/platform/efi/quirks.c - where you're right Ard it arguably belongs -
> not in the core code.
> 
> diff --git a/arch/x86/platform/efi/quirks.c
> b/arch/x86/platform/efi/quirks.c
> index 30031d5..950663da 100644
> --- a/arch/x86/platform/efi/quirks.c
> +++ b/arch/x86/platform/efi/quirks.c
> @@ -495,3 +495,19 @@ bool efi_poweroff_required(void)
>  {
>         return acpi_gbl_reduced_hardware || acpi_no_s5;
>  }
> +
> +ssize_t csh_efi_capsule_setup_info(struct capsule_info *cap_info,
> +                                  void *kbuff, size_t hdr_bytes)
> +{
> +       /* Code to deal with the CSH goes here */
> +       return 0;
> +}
> +
> +ssize_t efi_capsule_setup_info(struct capsule_info *cap_info,
> +                              void *kbuff, size_t hdr_bytes)
> +{
> +       if (quark)
> +               return csh_efi_capsule_setup_info(cap_info, kbuff,
> hdr_bytes);
> +       else
> +               return __efi_capsule_setup_info(cap_info, kbuff,
> hdr_bytes);
> +}
> 
> diff --git a/drivers/firmware/efi/capsule-loader.c
> b/drivers/firmware/efi/capsule-loader.c
> index 9ae6c11..d8bdc6f 100644
> --- a/drivers/firmware/efi/capsule-loader.c
> +++ b/drivers/firmware/efi/capsule-loader.c
> @@ -53,7 +53,7 @@ static void efi_free_all_buff_pages(struct
> capsule_info *cap_info)
>   * @kbuff: a mapped first page buffer pointer
>   * @hdr_bytes: the total received number of bytes for efi header
>   **/
> -static ssize_t efi_capsule_setup_info(struct capsule_info *cap_info,
> +ssize_t __efi_capsule_setup_info(struct capsule_info *cap_info,
>                                       void *kbuff, size_t hdr_bytes)
>  {
>         efi_capsule_header_t *cap_hdr;
> @@ -98,6 +98,13 @@ static ssize_t efi_capsule_setup_info(struct
> capsule_info *cap_info,
> 
>         return 0;
>  }
> +EXPORT_SYMBOL_GPL(__efi_capsule_setup_info);
> +
> +ssize_t __weak efi_capsule_setup_info(struct capsule_info *cap_info,
> +                                            void *kbuff, size_t hdr_bytes)
> +{
> +       return __efi_capsule_setup_info(cap_info, kbuff, hdr_bytes);
> +}
>

Good idea.

> One thing we want is to continue to have Quark work on ia32 builds
> without having to compile a Quark specific kernel just to get this
> feature working.
> 
> Jan I haven't had time to look at what you said about the BSP code not
> working with capsules on Gen2 (I will during the week though). If you
> currently have to strip the CSH to make this work then we're missing a
> trick on tip-of-tree and need to sort that out for the final version of
> this.

Yes, I agree. I will look into this when I'm back from ELC next week (no
related hardware with me).

Jan

-- 
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux

  reply	other threads:[~2017-02-20  1:53 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15 18:14 Jan Kiszka
2017-02-15 18:14 ` [PATCH 1/2] efi/capsule: Prepare for loading images with security header Jan Kiszka
2017-02-15 18:14 ` [PATCH 2/2] efi/capsule: Add support for Quark " Jan Kiszka
2017-02-17  1:30   ` Bryan O'Donoghue
2017-03-24 16:44     ` Jan Kiszka
2017-02-15 18:17 ` [PATCH 0/2] efi: Enhance capsule loader to support signed Quark images Ard Biesheuvel
2017-02-15 18:47   ` Jan Kiszka
2017-02-15 18:41 ` Andy Shevchenko
2017-02-15 18:46 ` Andy Shevchenko
2017-02-15 18:50   ` Jan Kiszka
2017-02-15 18:59     ` Jan Kiszka
2017-02-16  3:00       ` Kweh, Hock Leong
2017-02-16  7:29         ` Jan Kiszka
2017-02-18 21:48           ` Ard Biesheuvel
2017-02-19 13:33             ` Jan Kiszka
2017-02-20  1:33               ` Bryan O'Donoghue
2017-02-20  1:52                 ` Jan Kiszka [this message]
2017-03-24 15:18                 ` Jan Kiszka
2017-02-17  0:53         ` Bryan O'Donoghue
2017-02-17  8:23           ` Kweh, Hock Leong
2017-02-17  9:24             ` Jan Kiszka
2017-02-28 12:12               ` Matt Fleming
2017-02-28 12:20                 ` Jan Kiszka
2017-02-28 12:29                   ` Matt Fleming
2017-02-28 13:25                     ` Ard Biesheuvel
2017-02-28 13:35                       ` Andy Shevchenko
2017-02-28 13:36                         ` Andy Shevchenko
2017-02-28 15:07                           ` Bryan O'Donoghue
2017-02-28 15:09                             ` Bryan O'Donoghue
2017-02-28 15:27                             ` Andy Shevchenko
2017-02-28 16:52                               ` Bryan O'Donoghue
2017-02-28 17:18                                 ` Andy Shevchenko
2017-02-28 17:42                                   ` Bryan O'Donoghue
2017-03-01 14:02                                     ` Bryan O'Donoghue
2017-03-01 14:55                                       ` Andy Shevchenko
2017-02-17  9:51             ` Bryan O'Donoghue
2017-02-17 10:14               ` Jan Kiszka
2017-02-17 11:42                 ` Bryan O'Donoghue

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=b4271434-3868-6014-1dfd-dde5c1381c9d@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=bp@alien8.de \
    --cc=daniel.wagner@siemens.com \
    --cc=hock.leong.kweh@intel.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=pure.logic@nexus-software.ie \
    --cc=sascha.weisenberger@siemens.com \
    /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

all inboxes | Powered by JetHome®