public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael Kubacki" <mikuback@linux.microsoft.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: Andrew Fish <afish@apple.com>, Leif Lindholm <leif@nuviainc.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Michael Kubacki <mikuback@linux.microsoft.com>,
	Benjamin You <benjamin.you@intel.com>,
	Sarathy Jayakumar <sarathy.jayakumar@intel.com>,
	Yinghan Yang <Yinghan.Yang@microsoft.com>
Subject: [RFC] Add Platform Runtime Mechanism (PRM) to edk2
Date: Fri, 28 Jan 2022 16:04:17 -0500	[thread overview]
Message-ID: <6ba246e9-1706-a719-ca7e-ed13700b2b25@linux.microsoft.com> (raw)

Overview
--------
This RFC proposes adding a new package called "PrmPkg" to edk2/master. 
This package contains common functionality to support a new firmware 
solution called Platform Runtime Mechanism (PRM).

PRM has been developed in edk2-staging/PlatformRuntimeMechanism.
(https://github.com/tianocore/edk2-staging/tree/PlatformRuntimeMechanism)

We believe it is beneficial to make this source code more widely 
available due to:
   1. PRM specification adoption
   2. Feature completeness
   3. Overall validation coverage
   4. Interest from the community and future collaboration

This RFC does not restate the purpose and technical details of PRM as 
those are covered in detail in the PRM Specification and within 
documentation on edk2-staging/PlatformRuntimeMechanism.

1. PRM specification adoption

Intel and Microsoft have worked together to standardize PRM in the ACPI 
Specification and the PRM Specification hosted on uefi.org.

   * ACPI 6.4 Specification: https://uefi.org/node/4149

   * PRM Specification: 
https://uefi.org/sites/default/files/resources/Platform%20Runtime%20Mechanism%20-%20with%20legal%20notice.pdf

2. Feature completeness

PrmPkg implements the full firmware functionality described in the PRM 
Specification and there are no significant changes to functionality 
planned at this time.

3. Overall validation coverage

PrmPkg has been integrated and tested on client and server systems in 
addition to virtual platforms (OvmfPkg/QEMU).

Platform integration is simple and a demonstration of this integration 
for OvmfPkg is available in the following branch: 
https://github.com/makubacki/edk2/tree/ovmf_prmpkg_integration

The code has been built with:
   * MSFT VS2015, VS2017, and VS2019
   * GCC5 (see https://bugzilla.tianocore.org/show_bug.cgi?id=3802)
   * iASL compiler (20200528 - https://acpica.org/node/181)

The Linux kernel currently includes the following PRM support:
   * _OSC PRM bit - allows FW to know determine the OS is PRM-capable 
and can redirect _DSM method from alternate triggers (such as SMI) to PRM.
   * PRM invocation via _DSM, includes PRM module and handler parsing 
from ACPI PRMT table, and also the PRM operation region handler for 
runtime PRM service invocation.
   * An OS configuration for PRM enabling, PRM support can be disabled 
during OS image build.

Upstream Linux does not currently support the following:
   * Ability for the OS driver to call a PRM handler directly, it has to 
be via ACPI _DSM.
   * Run time update PRM module and handler via PE/COFF PRM image.

This commit provides additional context of the changes in Linux: 
https://github.com/torvalds/linux/commit/cefc7ca46235f01d5233e3abd4b79452af01d9e9

Windows 11 (https://www.microsoft.com/software-download/windows11) and 
Windows Server 2022 
(https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk) 
include the PRM functionality noted above in addition to PRM direct call 
and PRM runtime updates.

PRM has been tested on IA32, X64, and AARCH64 targets.

4. Interest from the community and future collaboration

PRM has been presented at several industry conferences:

* OSFC 2020 - "PRM: SMM Goes on a Diet"
   https://cfp.osfc.io/osfc2020/talk/MCJASB/

* OCP Summit 2019 - "Case Study Alternatives for SMM Usage in Intel 
Platforms"
   https://www.youtube.com/watch?v=mu3DRLM1dPA

In addition, Microsoft plans to publish the Windows PRM driver interface 
and a WDF sample driver that uses the interface to the Windows Driver 
Samples GitHub repository 
(https://github.com/microsoft/Windows-driver-samples).

We have received interest from various vendors in adopting and 
contributing to PRM. We believe a PrmPkg in edk2 can increase 
accessibility to PRM and ease collaboration that will help evolve the 
feature.

PrmPkg
------
PrmPkg contains the common functionality needed to enable PRM on any 
system. It does not contain platform-specific code such as PRM modules 
(and by extension PRM handlers). Other than sample modules, PrmPkg will 
only contain code needed to provide PRM feature functionality as defined 
in the PRM Specification.

For further information on PrmPkg, please see the code tree at:
https://github.com/tianocore/edk2-staging/tree/PlatformRuntimeMechanism

In particular:
* Readme.md: 
https://github.com/tianocore/edk2-staging/blob/PlatformRuntimeMechanism/Readme.md

* Samples/Readme.md: 
https://github.com/tianocore/edk2-staging/blob/PlatformRuntimeMechanism/PrmPkg/Samples/Readme.md

* Docs/PrmHandlerWritersGuide.md: 
https://github.com/tianocore/edk2-staging/blob/PlatformRuntimeMechanism/Docs/PrmHandlerWritersGuide.md

The proposed maintainers of PrmPkg are:
* Michael Kubacki <michael.kubacki@microsoft.com>
* Benjamin You <benjamin.you@intel.com>

Next Steps
----------
1. The code will remain in edk2-staging/PlatformRuntimeMechanism for the 
foreseeable future due to external dependencies currently on that code. 
No further updates will be made to the code in edk2-staging and 
consumers will be encouraged to move to the package in edk2.

2. The documentation will be updated to reflect movement to the edk2 
repository and to ensure content is up-to-date.

3. The changes will be condensed into a patch series that maintains 
important history and passes edk2 patch and CI checks.

                 reply	other threads:[~2022-01-28 21:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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-list 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=6ba246e9-1706-a719-ca7e-ed13700b2b25@linux.microsoft.com \
    --to=devel@edk2.groups.io \
    /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