From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.2417.1643403859942530124 for ; Fri, 28 Jan 2022 13:04:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=DIjSSMzE; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from [10.0.0.19] (c-73-27-179-174.hsd1.fl.comcast.net [73.27.179.174]) by linux.microsoft.com (Postfix) with ESMTPSA id 8A8A020B800A; Fri, 28 Jan 2022 13:04:18 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8A8A020B800A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1643403859; bh=IdiZ6DHJj7KV9MgZfmKv5ZH+p9JJaA0njB/faMo7MjU=; h=Date:To:Cc:From:Subject:From; b=DIjSSMzEhRiJ5iBiI4uMttOOlNYO13YOOpK9p8cnrCz+3RWrpg8lL9t9OWQgrm1pQ c7O6QUgyxs8YN8GWnvcu+RRuIv/MLXIn4LxzgSle82VxcpOTbbLeIUoVDC3WKF6E8S 6gJS7TUt7ZdLDnY4k9/fiotIfKfS+U8Hyj1sLcB4= Message-ID: <6ba246e9-1706-a719-ca7e-ed13700b2b25@linux.microsoft.com> Date: Fri, 28 Jan 2022 16:04:17 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 To: "devel@edk2.groups.io" Cc: Andrew Fish , Leif Lindholm , Michael D Kinney , Michael Kubacki , Benjamin You , Sarathy Jayakumar , Yinghan Yang From: "Michael Kubacki" Subject: [RFC] Add Platform Runtime Mechanism (PRM) to edk2 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 * Benjamin You 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.