DYNAMIC MEMORY LAYOUTS FOR FIRMWARE UPDATES BASED ON OEM MEMORY SUBSYSTEM
A capsule-based firmware update process is provided. After an operating system has provided a firmware update in the form of a capsule and the computing system is rebooted, a module can be loaded to locate a memory subsystem separate from the system memory. The module can initialize the separate memory subsystem and then identify a contiguous block of memory within the separate memory subsystem. The module can then cause the capsule to be coalesced from the system memory into the separate memory subsystem. Once the capsule is coalesced into the separate memory subsystem and the system memory is registered, the module can cause the coalesced capsule to be copied back into system memory where it can be accessed by other components that are subsequently loaded during the boot process.
N/A
BACKGROUNDThe Unified Extensible Firmware Interface (UEFI) is an interface between an operating system and firmware on a computing system. The UEFI defines a mechanism for enabling the operating system to initiate a firmware update. In UEFI-based systems, an operating system can deliver a firmware update to the firmware in the form of a capsule such as by invoking the UpdateCapsule runtime service. This capsule, which includes the firmware image as its payload, is stored in a contiguous virtual address space. However, the capsule will be spread across a discontinuous set of physical address ranges in system memory. For this reason, when the operating system delivers the capsule to the UpdateCapsule runtime service, it will provide a “scatter gather list” which defines the physical address ranges where the capsule fragments are stored.
The operating system can specify whether the capsule should be processed immediately or after reboot (e.g., using a flag in the capsule's header). When the capsule is to be processed after reboot, the UpdateCapsule runtime service will set appropriate variables to ensure that, after the system is reset, the UEFI pre-boot environment will detect that the capsule is stored in system memory and cause the capsule to be processed.
The UEFI boot sequence includes three phases: a security (SEC) phase, a pre-EFI initialization (PEI) phase and a driver execution environment (DXE) phase. During the PEI phase, the memory reference code (MRC) will be executed to initialize the system memory (e.g., DRAM). When the operating system has delivered a capsule, and after the system memory that includes the capsule is initialized, a platform PEI module will coalesce the capsule into a contiguous block of the system memory and then register the system memory while excluding the block that contains the coalesced capsule. The platform PEI module can then copy the coalesced capsule into the registered system memory and create a capsule hand-off block (HOB) that describes where the capsule is stored. The capsule HOB will be detected during the DXE phase to thereby allow the capsule to be located and processed to install the firmware update.
This process of handling capsules has various drawbacks. For example, before the capsule fragments can be coalesced, the MRC must initialize the system memory to allow the capsule fragments to be coalesced in a contiguous block in the system memory. Then, once the capsule is coalesced, there is a possibility that the block containing the coalesced capsule could become corrupted or unavailable by the time the DXE phase components attempt to process the capsule to install the firmware update. Additionally, non-UEFI computing systems do not support this capsule-based firmware update process (e.g., Coreboot computing systems such as Chromebooks).
BRIEF SUMMARYThe present invention extends to methods, systems, and computer program products for performing a capsule-based firmware update process. After an operating system has provided a firmware update in the form of a capsule and the computing system is rebooted, a module can be loaded to locate a memory subsystem separate from the system memory. The module can initialize the separate memory subsystem and then identify a contiguous block of memory within the separate memory subsystem. The module can then cause the capsule to be coalesced from the system memory into the separate memory subsystem. Once the capsule is coalesced into the separate memory subsystem and the system memory is registered, the module can cause the coalesced capsule to be copied back into system memory where it can be accessed by other components that are subsequently loaded during the boot process.
In some embodiments, the present invention is implemented on a computing system as a method for providing a firmware update in the form of a capsule. During a boot process on the computing system, a module can detect that a capsule containing a firmware update exists in system memory. In response to the detection, the module can identify a block of memory in a separate memory subsystem that is available on the computing system. The module can then cause the capsule to be coalesced from the system memory into the block of memory in the separate memory subsystem.
In some embodiments, the present invention is implemented as a computing system that includes one or more processors, system memory, a separate memory subsystem, an operating system, and firmware. During a boot process, the firmware can detect that the operating system has stored a capsule containing a firmware update in the system memory. In response to the detection, the firmware can identify a block of memory in the separate memory subsystem and cause the capsule to be coalesced from the system memory into the block of memory in the separate memory subsystem.
In some embodiments, the present invention is implemented as computer storage media storing computer executable which when executed on a computing system implement a method for providing a firmware update in the form of a capsule. The method can include: during an initialization stage of a boot process, detecting that an operating system on the computing system has stored a capsule in system memory, the capsule including a firmware update; in response to the detection, determining that a first separate memory subsystem is to be employed to coalesce the capsule; identifying a block of memory in the first separate memory subsystem; causing the capsule to be coalesced from the system memory into the block of memory in the first separate memory subsystem; and after the capsule is coalesced into the block of memory in the first separate memory subsystem, causing the coalesced capsule to be copied into the system memory.
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter.
Understanding that these drawings depict only typical embodiments of the invention and are not therefore to be considered limiting of its scope, the invention will be described and explained with additional specificity and detail through the use of the accompanying drawings in which:
In the specification and the claims, the term “separate memory subsystem” should be construed as encompassing any memory subsystem other than system memory. The term “system memory” should be construed as a computing system's RAM in which the operating system is loaded and which the operating system employs during runtime. Examples of separate memory subsystems include graphics processing unit (GPU) memory, Non-Volatile Memory Express (NVMe) based storage and dedicated internal memory. The term “computing system” should be construed as representing laptops, desktops, tablets, thin clients, mobile devices, or other similar end user computing devices that have an operating system that supports capsule-based firmware updates.
In the specification, embodiments of the present invention will be described primarily in the context of a UEFI-based computing system. In such cases, the term “capsule” can be construed in accordance with the UEFI specification. However, the present invention enables a capsule-based firmware update process to be implemented on non-UEFI-based computing systems including Coreboot computing systems and legacy bios computing systems. In such cases, the term “capsule” can be construed as a data structure that includes a firmware image which, when delivered by the operating system, is spread across a discontinuous set of physical address ranges in system memory and must therefore be coalesced before the capsule can be processed to update firmware.
Computing system 100 also includes a number of software components including capsule update service 121, PEI foundation 122, PEI module 123 and capsule module 124. In a UEFI environment, capsule update service 121 can be a UEFI runtime service with which operating system 110 interfaces at runtime, PEI foundation 122 can represent the core components that manage the PEI phase including the loading of PEI modules (PEIMs), and PEI module 123 and capsule module 124 can both be PEIMs. However, as mentioned above, embodiments of the present invention can also be implemented in non-UEFI environments and therefore, these components should be construed in accordance with the functionality they perform. For example, capsule update service 121 can represent any software component that enables operating system 110 to notify firmware at runtime of the existence of a capsule in system memory 131. Similarly, PEI foundation 122, PEI module 123 and capsule module 124 could represent components that execute during the ROM stage in a Coreboot implementation or option ROMs in a legacy BIOS implementation. Policies 125, which is an optional component, represents any type of data structure accessible to PEI module 123 that defines which separate memory subsystem should be employed to implement the techniques of the present invention (e.g., a UEFI variable).
In step 1a shown in
Turning to
Turning to
Turning to
Turning to
Turning to
To summarize, the capsule-based firmware update process of the present invention enables a capsule to be coalesced into a memory subsystem separate from system memory and then copied back into system memory during an initialization stage of the boot process so that the capsule can be processed to install the firmware update at a subsequent stage. On UEFI-based computing systems, this process can minimize or eliminate complications during the firmware update process due to corruption or unavailability of system memory. Additionally, this process enables firmware updates to be delivered in the form of capsules on non-UEFI-based computing systems.
Method 300 includes an act 301 of, during a boot process on a computing system, detecting that a capsule that contains a firmware update exists in system memory. For example, PEI module 123 could determine whether a scatter gather list is defined in a variable employed in the boot environment.
Method 300 includes an act 302 of, in response to the detection, identifying a block of memory in a separate memory subsystem that is available on the computing system. For example, PEI module 123 could identify a block of memory in GPU memory 132, NVMe-based storage 133 or dedicated internal memory 134.
Method 300 includes an act 303 of causing the capsule to be coalesced from the system memory into the block of memory in the separate memory subsystem. For example, PEI module 123 could specify a block of memory in GPU memory 132, NVMe-based storage 133 or dedicated internal memory 134 in a request to coalesce the capsule.
Embodiments of the present invention may comprise or utilize special purpose or general-purpose computers including computer hardware, such as, for example, one or more processors and system memory. Embodiments within the scope of the present invention also include physical and other computer-readable media for carrying or storing computer-executable instructions and/or data structures. Such computer-readable media can be any available media that can be accessed by a general purpose or special purpose computer system.
Computer-readable media are categorized into two disjoint categories: computer storage media and transmission media. Computer storage media (devices) include RAM, ROM, EEPROM, CD-ROM, solid state drives (“SSDs”) (e.g., based on RAM), Flash memory, phase-change memory (“PCM”), other types of memory, other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other similarly storage medium which can be used to store desired program code means in the form of computer-executable instructions or data structures and which can be accessed by a general purpose or special purpose computer. Transmission media include signals and carrier waves. Because computer storage media and transmission media are disjoint categories, computer storage media does not include signals or carrier waves.
Computer-executable instructions comprise, for example, instructions and data which, when executed by a processor, cause a general purpose computer, special purpose computer, or special purpose processing device to perform a certain function or group of functions. The computer executable instructions may be, for example, binaries, intermediate format instructions such as assembly language or P-Code, or even source code.
Those skilled in the art will appreciate that the invention may be practiced in network computing environments with many types of computer system configurations, including, personal computers, desktop computers, laptop computers, message processors, hand-held devices, multi-processor systems, microprocessor-based or programmable consumer electronics, network PCs, minicomputers, mainframe computers, mobile telephones, PDAs, tablets, pagers, routers, switches, and the like.
The invention may also be practiced in distributed system environments where local and remote computer systems, which are linked (either by hardwired data links, wireless data links, or by a combination of hardwired and wireless data links) through a network, both perform tasks. In a distributed system environment, program modules may be located in both local and remote memory storage devices. An example of a distributed system environment is a cloud of networked servers or server resources. Accordingly, the present invention can be hosted in a cloud environment.
The present invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described embodiments are to be considered in all respects only as illustrative and not restrictive. The scope of the invention is, therefore, indicated by the appended claims rather than by the foregoing description.
Claims
1. A method, implemented on a computing system, for providing a firmware update in the form of a capsule, the method comprising:
- during a boot process on a computing system, detecting that a capsule exists in system memory, the capsule containing a firmware update;
- in response to the detection, identifying a block of memory in a separate memory subsystem that is available on the computing system; and
- causing the capsule to be coalesced from the system memory into the block of memory in the separate memory subsystem.
2. The method of claim 1, wherein causing the capsule to be coalesced from the system memory into the block of memory in the separate memory subsystem comprises identifying a physical address of the block of memory.
3. The method of claim 1, further comprising:
- prior to causing the capsule to be coalesced from the system memory into the block of memory in the separate memory subsystem, initializing the separate memory subsystem.
4. The method of claim 1, further comprising:
- causing the capsule that has been coalesced into the block of memory in the separate memory subsystem to be copied to the system memory.
5. The method of claim 4, further comprising:
- prior to causing the capsule that has been coalesced into the block of memory in the separate memory subsystem to be copied to the system memory, registering the system memory.
6. The method of claim 4, wherein causing the capsule that has been coalesced into the block of memory in the separate memory subsystem to be copied to the system memory comprises identifying a physical address of the block of memory.
7. The method of claim 1, wherein the separate memory subsystem is a first separate memory subsystem of multiple separate memory subsystems available on the computing system, the method further comprising:
- selecting the first separate memory subsystem from among the multiple separate memory subsystems based on a policy.
8. The method of claim 1, wherein the separate memory subsystem is one of:
- GPU memory;
- NVMe-based storage; or
- dedicated internal memory.
9. The method of claim 1, further comprising:
- prior to causing the capsule to be coalesced from the system memory into the block of memory in the separate memory subsystem, causing the system memory to be initialized.
10. A computing system comprising:
- one or more processors;
- system memory;
- a separate memory subsystem;
- an operating system; and
- firmware that is configured to perform the following: during a boot process, detect that the operating system has stored a capsule in the system memory, the capsule containing a firmware update; in response to the detection, identify a block of memory in the separate memory subsystem; and cause the capsule to be coalesced from the system memory into the block of memory in the separate memory subsystem.
11. The computing system of claim 10, wherein the firmware comprises a pre-EFI initialization module.
12. The computing system of claim 10, further comprising:
- one or more additional separate memory subsystems; and
- a policy that dictates that the block of memory in the separate memory subsystem should be identified rather than a block of memory in the one or more additional separate memory subsystems.
13. The computing system of claim 10, wherein the firmware causes the capsule to be coalesced from the system memory into the block of memory in the separate memory subsystem comprises by identifying a physical address of the block of memory.
14. The computing system of claim 10, wherein the firmware is further configured to initialize the separate memory subsystem prior to causing the capsule to be coalesced from the system memory into the block of memory in the separate memory subsystem.
15. The computing system of claim 10, wherein the firmware is further configured to cause the capsule that has been coalesced into the block of memory in the separate memory subsystem to be copied to the system memory.
16. The computing system of claim 15, wherein the firmware is further configured to register the system memory prior to causing the capsule that has been coalesced into the block of memory in the separate memory subsystem to be copied to the system memory.
17. The computing system of claim 10, wherein the separate memory subsystem is one of: GPU memory, NVMe-based storage or dedicated internal memory.
18. One or more computer storage media storing computer executable which when executed on a computing system implement a method for providing a firmware update in the form of a capsule, the method comprising:
- during an initialization stage of a boot process, detecting that an operating system on the computing system has stored a capsule in system memory, the capsule including a firmware update;
- in response to the detection, determining that a first separate memory subsystem is to be employed to coalesce the capsule;
- identifying a block of memory in the first separate memory subsystem;
- causing the capsule to be coalesced from the system memory into the block of memory in the first separate memory subsystem; and
- after the capsule is coalesced into the block of memory in the first separate memory subsystem, causing the coalesced capsule to be copied into the system memory.
19. The computer storage media of claim 18, wherein determining that the first separate memory subsystem is to be employed to coalesce the capsule comprises selecting the first separate memory subsystem from among multiple separate memory subsystems based on a policy.
20. The computer storage media of claim 18, wherein the method further comprises:
- after the capsule is coalesced into the block of memory in the first separate memory subsystem and prior to causing the coalesced capsule to be copied into the system memory, registering the system memory.
Type: Application
Filed: Feb 3, 2020
Publication Date: Aug 5, 2021
Patent Grant number: 11294691
Inventors: Sumanth Vidyadhara (Bangalore), Karunakar Poosapalli (Telangana)
Application Number: 16/780,287