linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chen Yu <yu.c.chen@intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ard Biesheuvel <ardb@kernel.org>, Len Brown <lenb@kernel.org>,
	Ashok Raj <ashok.raj@intel.com>,
	Andy Shevchenko <andriy.shevchenko@intel.com>,
	Mike Rapoport <rppt@kernel.org>,
	Hongyu Ning <hongyu.ning@intel.com>,
	Aubrey Li <aubrey.li@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v13 2/4] drivers/acpi: Introduce Platform Firmware Runtime Update device driver
Date: Thu, 23 Dec 2021 22:04:24 +0800	[thread overview]
Message-ID: <20211223140424.GA665673@chenyu-desktop> (raw)
In-Reply-To: <CAJZ5v0hT+0qhCBJg08bRiRMKC6U4UUFkU9PFC6UjGT4Hk2WrbA@mail.gmail.com>

On Wed, Dec 22, 2021 at 06:23:56PM +0100, Rafael J. Wysocki wrote:
> On Wed, Dec 22, 2021 at 5:32 AM Chen Yu <yu.c.chen@intel.com> wrote:
> >
> > Introduce the pfr_update driver which can be used for Platform Firmware
> > Runtime code injection and driver update [1]. The user is expected to
> > provide the EFI capsule, and pass it to the driver by writing the capsule
> > to a device special file. The capsule is transferred by the driver to the
> > platform firmware with the help of an ACPI _DSM method under the special
> > ACPI Platform Firmware Runtime Update device (INTC1080), and the actual
> > firmware update is carried out by the low-level Management Mode code in
> > the platform firmware.
> >
> > This patch allows certain pieces of the platform firmware to be
> > updated on the fly while the system is running (runtime) without the
> > need to restart it, which is key in the cases when the system needs to
> > be available 100% of the time and it cannot afford the downtime related
> > to restarting it, or when the work carried out by the system is
> > particularly important, so it cannot be interrupted, and it is not
> > practical to wait until it is complete.
> >
> > Link: https://uefi.org/sites/default/files/resources/Intel_MM_OS_Interface_Spec_Rev100.pdf # [1]
> > Cc: Andy Shevchenko <andriy.shevchenko@intel.com>
> > Cc: Ard Biesheuvel <ardb@kernel.org>
> > Cc: Ashok Raj <ashok.raj@intel.com>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Len Brown <lenb@kernel.org>
> > Cc: Mike Rapoport <rppt@kernel.org>
> > Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> > Tested-by: Hongyu Ning <hongyu.ning@intel.com>
> > Signed-off-by: Chen Yu <yu.c.chen@intel.com>
> > ---
> 
> [cut history]
>
[...] 
> > +static bool applicable_image(const void *data, struct pfru_update_cap_info *cap,
> > +                            struct pfru_device *pfru_dev)
> > +{
> > +       struct pfru_payload_hdr *payload_hdr;
> > +       const efi_capsule_header_t *cap_hdr = data;
> > +       const struct efi_manage_capsule_header *m_hdr;
> > +       const struct efi_manage_capsule_image_header *m_img_hdr;
> > +       const struct efi_image_auth *auth;
> > +       int type, size;
> > +
> > +       /*
> > +        * If the code in the capsule is older than the current
> > +        * firmware code, the update will be rejected by the firmware,
> > +        * so check the version of it upfront without engaging the
> > +        * Management Mode update mechanism which may be costly.
> > +        */
> 
> Since we are worrying so much about engaging the Management Mode in
> vain, it is somewhat inconsistent to only check the firmware version
> information and avoid doing some general sanity checks on the capsule
> image (for example, whether or not the image size value in the header
> is consistent with the image size etc.).
> 
> I'm not asking for another version of this patch, but something like a
> follow-up change adding more sanity checks on top of this series.
>
Ok, I'll sync with specification team and then enhance the sanity check in
a follow-up change.

thanks,
Chenyu

  reply	other threads:[~2021-12-23 14:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22  4:22 [PATCH v13 0/4] Introduce Platform Firmware Runtime Update and Telemetry drivers Chen Yu
2021-12-22  4:31 ` [PATCH v13 1/4] efi: Introduce EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER and corresponding structures Chen Yu
2021-12-22  4:31 ` [PATCH v13 2/4] drivers/acpi: Introduce Platform Firmware Runtime Update device driver Chen Yu
2021-12-22 17:23   ` Rafael J. Wysocki
2021-12-23 14:04     ` Chen Yu [this message]
2021-12-22  4:32 ` [PATCH v13 3/4] drivers/acpi: Introduce Platform Firmware Runtime Telemetry Chen Yu
2021-12-22  4:32 ` [PATCH v13 4/4] tools: Introduce power/acpi/tools/pfrut Chen Yu
2021-12-22 17:16 ` [PATCH v13 0/4] Introduce Platform Firmware Runtime Update and Telemetry drivers Rafael J. Wysocki
2021-12-23 14:04   ` Chen Yu

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=20211223140424.GA665673@chenyu-desktop \
    --to=yu.c.chen@intel.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=ardb@kernel.org \
    --cc=ashok.raj@intel.com \
    --cc=aubrey.li@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hongyu.ning@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rppt@kernel.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 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).