MMIO address resource allocation methods, apparatus, computing devices and storage media
By dynamically allocating MMIO address resources through out-of-band controllers and preset lists, the problems of resource waste and device failure caused by static allocation are solved, thereby improving system stability and compatibility.
Patent Information
- Application Number
- CN202410172102.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-06
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2044-02-06
AI Technical Summary
The existing MMIO address resource allocation mechanism is static and cannot be flexibly allocated according to the dynamic changes of PCIe peripherals, resulting in too many or too few resources, causing resource waste and device failure.
The device information of the PCIe device is obtained through the out-of-band controller, and MMIO address resources are dynamically allocated using a preset list and resource allocation strategy, including BMC and IPMI commands. Information acquisition and verification are performed in conjunction with the I2C bus or SMBUS to achieve flexible resource allocation.
Dynamic allocation of MMIO address resources is achieved, avoiding resource shortages or waste, improving system stability and device compatibility, and reducing the cost of manual adjustments and startup time.
Smart Images

Figure CN118132458B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to an MMIO (Memory-mapped I / O) address resource allocation method, an MMIO address resource allocation device, a computing device, and a computer-readable storage medium. Background Technology
[0002] Modern computers, servers, and other computing devices frequently connect to various PCIe peripherals, such as sound cards, graphics cards, and network cards. In MMIO technology, the computer's CPU can control these peripherals by controlling memory, thus requiring the allocation of MMIO address resources to PCIe devices for CPU control. Existing MMIO address resource allocation mechanisms are static and cannot flexibly allocate MMIO address resources based on the dynamic changes in PCIe peripherals, often resulting in excessive or insufficient allocation of resources. Therefore, there is an urgent need in this field for a technology that can dynamically allocate MMIO address resources to flexibly adapt to various changes such as the insertion and removal of PCIe devices, preventing resource shortages or waste. Summary of the Invention
[0003] Therefore, this application aims to provide an MMIO address resource allocation method, MMIO address resource allocation device, computing device, and computer-readable storage medium, which can realize the dynamic allocation of MMIO address resources and prevent resource shortage or waste.
[0004] In one aspect, this application provides an MMIO address resource allocation method, comprising: obtaining device information of a PCIe device connected to a computing device through an out-of-band controller; obtaining MMIO address resource information corresponding to the device information of the PCIe device based on a preset list, wherein the preset list indicates the correspondence between device information and MMIO address resource information; and determining the MMIO address resources allocated to the PCIe device based on the MMIO address resource information.
[0005] According to this aspect, the out-of-band controller is an independent system that manages the various components of a computing device. By acquiring information about PCIe devices through the out-of-band controller, it can obtain device information independently, outside the computing device's own system. The out-of-band controller can promptly detect changes in PCIe devices, thus adapting to these changes and dynamically acquiring device information for targeted allocation of MMIO address resources. After the out-of-band controller obtains information about the PCIe devices plugged into the board, it queries a list stored in the firmware to determine the required MMIO address resource size for each plugged-in PCIe device, thereby achieving accurate allocation. This list is pre-configured in the firmware by the computing device firmware developers, who can store all types of peripherals and their required resource sizes in this list, achieving the most comprehensive and accurate MMIO address resource allocation possible.
[0006] In some implementations, obtaining device information of PCIe devices connected to a computing device via an out-of-band controller includes: during the power-on phase after the computing device is powered on and started, obtaining device information of PCIe devices connected to the computing device via an out-of-band controller, wherein the out-of-band controller obtains information from the board of the computing device during the standby phase when the computing device is powered on but not started.
[0007] According to this embodiment, out-of-band management boot starts running as soon as the computing device is plugged into the power supply, without relying on the power-on operation. This allows for long-term, real-time monitoring of the insertion and removal status of PCIe devices on the computer, enabling timely awareness of changes in PCIe devices. Consequently, reliable PCIe device information is provided to the firmware of the computing device during the power-on phase, allowing the firmware to accurately allocate MMIO address resources during the boot process.
[0008] In some implementations, the out-of-band controller includes a BMC. Obtaining device information of a PCIe device connected to the computing device via the out-of-band controller includes: obtaining the device information of the PCIe device connected to the computing device from the BMC via IPMI commands.
[0009] According to this embodiment, the BMC is a commonly used out-of-band controller, which has good management performance for computing devices, especially servers, and is currently widely used in various types of computing devices. IPMI commands are a common method used by the BMC to communicate with various components of the computing device. Using the BMC to acquire PCIe devices facilitates the broad applicability of the MMIO address resource allocation method proposed in this application, expands the application scope of this application, and improves the implementation effect of the technical solution of this application.
[0010] In some implementations, the BMC obtains device information from the board of the computing device via the I2C bus or SMBUS.
[0011] According to this embodiment, the I2C bus or SMBUS is a widely used computing device bus that connects to various boards of the computing device and can accurately determine the peripheral connection status of each board.
[0012] In some implementations, determining the MMIO address resources allocated to the PCIe device based on the MMIO address resource information includes: formulating a resource allocation strategy based on the MMIO address resource information; and determining the MMIO address resources allocated to the PCIe device based on the resource allocation strategy.
[0013] According to this implementation method, after obtaining the query results, a resource allocation strategy can be formulated based on the MMIO resource size required by each PCIe device, rather than directly allocating resources according to the required resources. This can cope with various possible unexpected situations and make the allocation method meet the resource requirements under different circumstances as much as possible.
[0014] In some implementations, the resource allocation strategy includes a minimum allocation strategy and a maximum allocation strategy. The minimum allocation strategy allocates as few MMIO address resources as possible to the PCIe device, while the maximum allocation strategy allocates as many MMIO address resources as possible to the PCIe device. Based on the MMIO address resource information, the resource allocation strategy is formulated, including: if the PCIe device has low hot-swapping requirements, the minimum allocation strategy is used; if the PCIe device has high hot-swapping requirements, the maximum allocation strategy is used.
[0015] According to this embodiment, configuring the MMIO address resource allocation strategy based on the hot-swapping behavior of computing devices helps to make the allocation strategy more rational. Computing devices with high hot-swapping requirements are more likely to have their PCIe devices changed, therefore they need to be allocated as many MMIO address resources as possible, and vice versa. This ensures the rational use of resources and minimizes waste or resource shortages.
[0016] In some implementations, after determining the MMIO address resources allocated to the PCIe device based on the MMIO address resource information, the method further includes: determining whether the device information matches the PCIe device information discovered during the PCIe enumeration process; if not, sending the mismatch result to the out-of-band controller, so that the out-of-band controller obtains the updated device information of the PCIe device connected to the computing device; obtaining the updated device information from the out-of-band controller; and re-determining the MMIO address resources allocated to the PCIe device based on the updated device information.
[0017] According to this embodiment, a verification and feedback process for MMIO address resource allocation is provided. Through this process, the resource allocation strategy can be changed in a timely manner when the PCIe device changes unexpectedly, so that the allocation of MMIO address resources is consistent with the actual PCIe device connection status at the time of the computing device, avoiding resource allocation errors in the event of unexpected device insertion or temporary removal.
[0018] In some implementations, the out-of-band controller acquires and stores information from the board of the computing device, and the information storage format includes a check bit.
[0019] According to this embodiment, by storing PCIe device information, the firmware of the computing device can retrieve the PCIe device information at any time to perform allocation operations. Adding a checksum during storage ensures that the stored data is as error-free as possible during transmission, thus ensuring data accuracy and security.
[0020] In some implementations, this method is carried out by running firmware of the computing device, including at least one of BIOS, UEFI, CoreBoot, and SlimBootloader.
[0021] According to this embodiment, the firmware can adopt several commonly used computing device firmwares, which have wide applicability, good operational performance, and can be combined with the allocation scheme of this application to realize the dynamic allocation of MMIO address resources.
[0022] On the other hand, this application provides an MMIO address resource allocation device, comprising: a first acquisition module, configured to acquire device information of a PCIe device connected to a computing device via an out-of-band controller; a second acquisition module, configured to acquire MMIO address resource information corresponding to the device information of the PCIe device based on a preset list, the preset list indicating the correspondence between device information and MMIO address resource information; and a determination module, configured to determine the MMIO address resources allocated to the PCIe device based on the MMIO address resource information.
[0023] In some implementations, the acquisition module is further configured to: acquire device information of PCIe devices connected to the computing device through an out-of-band controller during the power-on phase after the computing device is powered on and started, wherein the out-of-band controller acquires information from the board of the computing device during the standby phase when the computing device is powered on but not started.
[0024] In some implementations, the out-of-band controller includes a BMC, and the acquisition module is further configured to acquire device information of a PCIe device connected to the computing device from the BMC via IPMI commands.
[0025] In some implementations, the BMC obtains device information from the board of the computing device via the I2C bus or SMBUS.
[0026] In some embodiments, the apparatus is further configured to: formulate a resource allocation strategy based on MMIO address resource information; and determine the MMIO address resources allocated to the PCIe device based on the resource allocation strategy.
[0027] In some implementations, the resource allocation strategy includes a minimum allocation strategy and a maximum allocation strategy. The minimum allocation strategy is used to allocate as few MMIO address resources as possible to the PCIe device, and the maximum allocation strategy is used to allocate as many MMIO address resources as possible to the PCIe device. The device is further configured to: adopt the minimum allocation strategy if the PCIe device has low hot-swapping requirements; and adopt the maximum allocation strategy if the PCIe device has high hot-swapping requirements.
[0028] In some implementations, the apparatus is further configured to: determine whether the device information matches the PCIe device information discovered during the PCIe enumeration process; if not, send the mismatch result to the out-of-band controller, so that the out-of-band controller obtains the updated device information of the PCIe device connected to the computing device; obtain the updated device information from the out-of-band controller; and reallocate MMIO address resources for the PCIe device based on the updated device information.
[0029] In some implementations, the out-of-band controller acquires and stores information from the board of the computing device, and the information storage format includes a check bit.
[0030] In some implementations, the device functions by running firmware of the computing device, which includes at least one of BIOS, UEFI, CoreBoot, and SlimBootloader.
[0031] On the other hand, this application provides a computing device including a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the above-described MMIO address resource allocation method.
[0032] In another aspect, this application provides a computer-readable storage medium storing a computer program for executing the above-described MMIO address resource allocation method.
[0033] On the other hand, this application provides a computer program product, including program code, which, when a computer runs the computer program product, causes the computer to implement the above-described MMIO address resource allocation method.
[0034] Any of the MMIO address resource allocation devices, computing devices, computer-readable storage media or computer program products provided above are used to execute the MMIO address resource allocation method provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects of the corresponding schemes in the corresponding methods provided above, and will not be repeated here. Attached Figure Description
[0035] The specific embodiments of this application are described in detail below with reference to the accompanying drawings, wherein:
[0036] Figure 1 A schematic diagram of the architecture of an MMIO address resource allocation method according to an embodiment of this application is shown;
[0037] Figure 2 A flowchart illustrating an MMIO address resource allocation method according to an embodiment of this application is shown.
[0038] Figure 3 Showing according to Figure 2 A schematic diagram of the time distribution of the MMIO address resource allocation method in the embodiment;
[0039] Figure 4 Showing according to Figure 2 A schematic diagram of the hardware architecture of the MMIO address resource allocation method in this embodiment;
[0040] Figure 5 A flowchart illustrating an MMIO address resource allocation method according to an embodiment of this application is shown.
[0041] Figure 6 Showing according to Figure 5 A flowchart illustrating the MMIO address resource allocation method in this embodiment;
[0042] Figure 7 A schematic diagram of the architecture of an MMIO address resource allocation method according to an embodiment of this application is shown;
[0043] Figure 8 This diagram illustrates the structure of an MMIO address resource allocation apparatus according to an embodiment of the present application.
[0044] Figure 9 A schematic diagram of the structure of a computing device according to an embodiment of this application is shown. Detailed Implementation
[0045] To enable those skilled in the art to more clearly understand the concepts and ideas of this application, the application is described in detail below with reference to specific embodiments. It should be understood that the embodiments given herein are only a part of all possible embodiments of this application. After reading the specification of this application, those skilled in the art are capable of making improvements, modifications, or substitutions to parts or the entirety of the following embodiments, and such improvements, modifications, or substitutions are also included within the scope of protection claimed in this application.
[0046] In this document, the terms "one," "an," and other similar words are not intended to indicate that only one of the described things exists, but rather that the description refers only to one of the described things, which may have one or more. In this document, the terms "comprising," "including," and other similar words are intended to indicate a logical relationship, not a spatial relationship. For example, "A includes B" means that logically B belongs to A, not that spatially B is located inside A. Furthermore, the meanings of the terms "comprising," "including," and other similar words should be considered open-ended, not closed-ended. For example, "A includes B" means that B belongs to A, but B does not necessarily constitute all of A; A may also include other elements such as C, D, and E.
[0047] In this document, the terms "first," "second," and other similar terms are not intended to imply any order, quantity, or importance, but are merely used to distinguish different elements. In this document, the terms "embodiment," "this embodiment," "an embodiment," or "an example" do not indicate that the description applies only to one specific embodiment, but rather that such description may also be applicable to one or more other embodiments. Those skilled in the art will understand that any description made herein with respect to one embodiment can be substituted, combined, or otherwise combined with the descriptions in one or more other embodiments, and the new embodiments resulting from such substitutions, combinations, or other combinations are readily conceived by those skilled in the art and fall within the scope of protection of this application.
[0048] MMIO refers to a communication mechanism between computer hardware and the operating system. It occupies physical memory addresses, the length of which can be considered a resource allocated to various PCIe (Peripheral Component Interconnect Express) devices (including bridges, interrupt devices, etc.). In MMIO, specific input / output devices (such as bridges, graphics cards, network adapters, etc.) are mapped to their allocated computer memory address space, enabling the processor to communicate with these devices by reading and writing memory. By reading and writing specific memory addresses, the OS (Operating System) can trigger device operations, transmit data, or receive device status information.
[0049] During computer startup, the BIOS (Basic Input Output System) software performs initialization and self-tests on the hardware and software operating environment before guiding the OS to boot. Before startup, the BIOS transmits the initialization and self-test results to the OS in a specific format, such as ACPI (Advanced Configuration and Power Management Interface) or DT (Device Tree). Subsequently, the OS, or more precisely, the device drivers residing in the OS kernel space, can then function correctly based on the data transmitted by the BIOS.
[0050] In this field, taking the x86 computer architecture as an example, the MMIO allocation is embedded in the boot process. Taking the UEFI (Unified Extensible Firmware Interface) firmware boot process as an example, the firmware boot process includes SEC (Security Phase), PEI (Pre-EFIInitialization), DXE (Driver Execution Environment), and BDS (Boot Device Selection). In the early PEI phase, the first step of the MMIO allocation process can be performed: writing resource parameter settings to the root bridge's control register. In the DXE phase, the second and third steps of the MMIO allocation process can be performed. The second step involves writing resource parameters to the control register of each device. The third step involves checking the correctness of resource allocation during PCIe enumeration. After firmware boot is complete, the OS boot and operation process begins.
[0051] The MMIO resource allocation scheme is static and fixed. Developers know all the PCIe peripherals connected to the computer before development and choose a value greater than the required MMIO, writing it in segments into the control registers of each PCIe controller. Because the allocation strategy is static, a BIOS only supports one hardware configuration. During development or end-user use, if PCIe devices are removed, added, or replaced, the required MMIO will change, and the BIOS's static setting will no longer match the hardware configuration. There are two possible mismatches: 1) Allocating too much MMIO resource to the hardware devices used by the OS will waste overall memory resources, reducing the available memory for the OS and leading to a decrease in computer system performance; 2) Intentionally or unintentionally allocating too little MMIO resource will prevent the CPU from communicating with the device, causing the device to malfunction, device drivers to fail to load properly, or device instructions to fail to run due to lack of access to valid memory. When the second mismatch occurs, the entire computer system will be in an abnormal state. The BIOS will handle this phenomenon during the next boot.
[0052] In some implementations, MMIO address resource allocation includes the following steps: First, developers need to know a fixed configuration and calculate the required MMIO resources. Then, the resource parameter settings are written to the root bridge's control register. Next, the resource parameters are written to the control register of each device. Then, PCIe device enumeration is performed. If insufficient allocated MMIO resources are found during the enumeration process, an alarm box pops up, notifying the PCIe device of failure, and the BIOS setup page is entered. At this point, developers need to be notified to change the MMIO parameters and modify them in the BIOS, and finally, the system is restarted. This technology is commonly used in industrial computers, consumer computers, and other products.
[0053] In some implementations, MMIO address resource allocation includes the following steps: First, developers need to know a fixed configuration and calculate the required MMIO resources. Then, the resource parameter settings are written to the root bridge's control register. Next, the resource parameters are written to the control register of each device. Then, PCIe device enumeration is performed. If insufficient allocated MMIO resources are found during the enumeration process, a cold reset is performed. After the cold reset, MMIO resources are reallocated to the root bridge, prioritizing segments with insufficient resources. Then, the resource parameters are written to the control register of each device again. Then, PCIe device enumeration is performed again. If no resource shortage is found, the OS boot phase begins. This technique is commonly found in server computer products.
[0054] The problems with these implementation methods are as follows: 1) To prevent system stability issues, developers often set MMIO to be larger than actually needed, i.e., actual value = needed value + redundancy value. This wastes memory resources and reduces system performance. Theoretically, no matter how large the "redundancy value" is, it cannot avoid MMIO insufficiency because the PCIe protocol evolves and changes, and PCIe peripheral types evolve and change over time. 2) The static allocation method of MMIO results in relatively weak server compatibility with PCIe devices. A BIOS version may only support a few hardware configuration strategies. 3) When MMIO resources are insufficient, restarting will cause additional startup time. Theoretically, reallocation cannot completely solve the resource shortage problem. Startup time is related to the number of restarts, and startup time is strongly correlated with user experience. Therefore, a compromise needs to be made between startup time and the number of resource adjustments, and theoretically, the problem still cannot be completely solved. 4) When the conditions are met and the problem cannot be solved, PCIe devices will fail, resulting in the loss of critical functions. 5) Additional investment is required from R&D personnel, testers, and front-end personnel to perform actions such as BIOS reset, solution verification, and system shutdown flashing, which increases costs.
[0055] Some embodiments of this application can solve the problems of device failure and system instability caused by insufficient MMIO memory resource allocation under different hardware configurations.
[0056] In some embodiments of this application, the BMC (Baseboard Management Controller) system extracts the model, location, and quantity information of the backplane and stand-up panel via the I2C (Inter-Integrated Circuit) interface and stores it in its own NVROM (Non-Volatile Read-Only Memory) in a specific encoded format. The data is encoded and stored in a specific format with check bits to ensure the reliability of storage and transmission. During server startup, the BIOS obtains the above information from the BMC via IPMI (Intelligent Platform Management Interface) commands and compares it with a list stored in the BIOS's NVROM database (e.g., a list of fixed hardware configuration information) to calculate a detailed MMIO allocation strategy and use it to rationally allocate MMIO resources in each subsequent stage. During server startup, the BIOS employs device scanning, verification, device data recalculation, and IPMI command feedback mechanisms during MMIO resource allocation. If any hardware changes occur, the BIOS can make corresponding adjustments.
[0057] In some embodiments of this application, the BMC collects external card insertion schemes and transmits them to the BIOS in a specific encoded form. This allows the CPU to allocate MMIO resources according to more accurate device requirements, and the saved physical memory is provided to the operating system, reducing resource waste and improving operating system performance. These embodiments include hardware configuration self-testing and feedback functions, saving the additional costs caused by manual adjustment of MMIO resources during testing and development, as well as the additional management costs of software versions. They also avoid various negative impacts that may be caused by repeated front-end flashing. These embodiments configure the CPU to perform device enumeration when it boots to the BDS stage. If an "Out of Resource" phenomenon is detected, resources will be reallocated in a localized manner, effectively preventing device failures due to insufficient PCIe device resources and improving system stability. These embodiments offer flexibility in MMIO memory resource allocation, effectively expanding the feasibility of server PCIe peripheral hardware combinations, providing stronger device compatibility, and meeting a wider range of customer needs.
[0058] Figure 1 A schematic diagram of the hardware architecture of an MMIO address resource allocation method according to an embodiment of this application is shown.
[0059] like Figure 1 As shown, multiple PCIe devices are plugged into the board of a computing device. The figure shows three PCIe devices: PCIe device 1, PCIe device 2, and PCIe device 3. Those skilled in the art will understand that the figure is merely an example, and any suitable number of PCIe devices can be plugged into the board of the computing device. The out-of-band controller (OOB controller) communicates with the board, thus the OOB controller (e.g., BMC) can obtain device information of the PCIe devices from the board, thereby knowing the number, type, and model of the PCIe devices plugged into the board. The firmware (e.g., BIOS) running in the CPU of the computing device communicates with the OOB controller, thus the CPU can obtain PCIe device information from the OOB controller. Based on the PCIe device device information obtained from the OOB controller, the CPU determines how many MMIO address resources each PCIe device needs by querying a preset list in the firmware, i.e., determining the MMIO address resource information, and thus allocates MMIO address resources to the PCIe devices to meet the different MMIO address resource requirements of different PCIe devices.
[0060] In this embodiment, PCIE can refer to a high-speed serial computer expansion bus standard, which belongs to high-speed serial point-to-point dual-channel high-bandwidth transmission. Connected devices are allocated dedicated channel bandwidth and do not share bus bandwidth. It primarily supports active power management, error reporting, end-to-end reliable transmission, hot-plugging, and Quality of Service (QoS) functions. PCIE is an upgrade to the traditional PCI (Peripheral Component Interconnect) standard, aiming to provide higher data transfer rates and performance, offering faster and more stable connections for various types of external devices. PCIE devices can refer to devices compliant with the PCIE standard, including graphics cards, sound cards, network cards, storage devices, and other hardware devices.
[0061] In this embodiment, "board" can refer to hardware components such as the motherboard, backplane, riser, adapter board, and expansion cards of a computing device. For example, a hardware backplane can be used to connect the motherboard and various hard drives. Some backplanes do not have bridging chips, so they are transparent to the CPU, meaning there are no nodes associated with them in the PCIe tree structure. For example, an expansion card can refer to a card that uses or does not use an adapter board; for example, an OCP network card uses no adapter board, while an RTX A6000 graphics card uses an adapter board.
[0062] In this embodiment, an out-of-band controller can refer to a controller used to run an out-of-band management system. An out-of-band management system can be a system that manages computing devices through a dedicated network interface card (NIC) or management port. It is unaffected by operating system and hardware failures, providing a more stable management method. Unlike out-of-band management, in-band management is management software running on the computing device itself. It relies on APIs (Application Programming Interfaces) provided by the operating system and is more susceptible to operating system and hardware failures. Out-of-band management can be implemented through dedicated hardware devices, management software, or cloud platforms. An out-of-band management system enables remote management and monitoring without physical contact with the server and does not affect server performance. Out-of-band management can perform operations such as powering on / off, restarting, system installation, and remote control of the server, making it ideal for scenarios such as remote data centers and cloud computing environments. Common out-of-band controllers include BMC, DRAC (Dell Remote Access Controller), and iLO (Integrated Lights-Out).
[0063] In this embodiment, the firmware of a computing device refers to a computer program whose code is fixed to the motherboard of the computing device, closely related to the hardware, and existing between software and hardware. The firmware of a computing device is the lowest software level connected to the overall hardware, and it is the bootloader and operating system kernel, an interface that can communicate with and control the hardware. Firmware is the software that performs the most basic and lowest-level work of a system.
[0064] As an example, firmware may include at least one of BIOS, UEFI, CoreBoot, and SlimBootloader.
[0065] In this example, BIOS can refer to a set of programs embedded in a ROM chip on the computer's motherboard. It stores the computer's most important basic input / output programs, power-on self-test (POST) programs, and system boot programs. It can read and write specific system settings information from CMOS (Complementary Metal Oxide Semiconductor). The main function of BIOS is to provide the lowest-level, most direct hardware settings and control for the computer.
[0066] In this example, UEFI can refer to a scalable, standardized firmware interface specification used to define the software interface between the operating system and system firmware, as an alternative to BIOS. The scalable firmware interface is responsible for power-on self-test (POST), communication with the operating system, and providing an interface between the operating system and hardware.
[0067] In this example, CoreBoot could refer to firmware born from an open-source software project designed to replace the proprietary BIOS in most computers. CoreBoot performs some hardware initialization and then executes other boot logic. By separating hardware initialization from subsequent boot logic, CoreBoot can run firmware directly, run an operating system in flash memory, load custom bootloaders, or implement custom application extensions that implement firmware standards. This allows the system to contain only the functionality necessary for the target application, thus reducing the amount of code and flash memory required.
[0068] In this example, SlimBootloader can refer to a type of computer firmware specifically tailored for IoT applications. It is an open-source boot firmware solution that initializes the core hardware components of the system when the system powers on, and then loads and boots the required operating system. It features security, lightweight design, and high optimization, allowing for isolation, configuration, and optimization according to the specific needs of the system to achieve excellent boot performance while minimizing the firmware's footprint. It also boasts a modular and scalable design.
[0069] Figure 2 A schematic diagram of the hardware architecture of an MMIO address resource allocation method according to an embodiment of this application is shown.
[0070] like Figure 2 As shown, the CPU is installed on the motherboard of the computing device, and a backplane and a top panel are connected to it. Multiple PCIe devices are connected to the backplane and the top panel. The BMC system can independently manage the various components of the computing device; therefore, the BMC system can obtain information about the cards connected to the motherboard and the PCIe peripherals connected to those cards. Figure 2 In the process, the BMC obtains information from the backplane and the frontplane via the I2C bus or SMBUS bus, thereby obtaining data such as the number, type and model of the PCIe devices plugged into it.
[0071] Specifically, the BMC system extracts the location, quantity, and model information of the backplane and the stand-up board through the I2C interface. Within this hardware framework, the BMC traverses the I2C addresses of all peripheral EEPROMs through the I2C interface to obtain the board names (Board IDs) of all backplanes, stand-up boards, adapter cards, and expansion cards.
[0072] Figure 3 A flowchart illustrating an MMIO address resource allocation method according to an embodiment of this application is shown.
[0073] According to this embodiment, the MMIO address resource allocation method includes steps S310 to S330, and each step is described in detail below.
[0074] S310. Obtain device information of the PCIe device connected to the computing device through the out-of-band controller.
[0075] In this embodiment, the out-of-band controller has the function of independently managing various components of the computing device under different conditions. Using this function, the firmware of the computing device can obtain device information of the PCIe devices connected to the computing device from the out-of-band controller. The PCIe device information may include the type, model, and manufacturer of the PCIe device. Based on this information, the specific type of a PCIe device can be determined, so as to determine how many MMIO address resources it requires. Specifically, the type information of the PCIe device (e.g., whether it is a sound card or a network card) can be obtained through the in-band management system; while the model (e.g., the device model indicated in the DeviceID) and manufacturer information (e.g., the manufacturer information indicated in the Vender ID) of the PCIe device can be obtained through the out-of-band management system (running on the out-of-band controller). The PCIe devices connected to the computing device are plugged into the board, and the out-of-band controller can obtain the corresponding device information from the computing device's board to provide the firmware with the basis for performing MMIO address resource allocation.
[0076] As an example, in order to obtain device information of PCIe devices connected to a computing device through an out-of-band controller, the device information of PCIe devices connected to the computing device can be obtained through the out-of-band controller during the power-on phase after the computing device is powered on and started. The out-of-band controller obtains information from the board of the computing device during the standby phase when the computing device is powered on but not started.
[0077] Figure 4 Showing according to Figure 3 A schematic diagram of the time distribution of the MMIO address resource allocation method in the embodiment.
[0078] like Figure 4 As shown, in the direction of time flow, the computing device is initially in a power-off state. At this time, the power supply is not plugged in, and the power plug is disconnected from the power outlet. Then, after the power is plugged in, it enters the BMC standby time, entering the standby phase. At this time, the power is plugged in again, and the BMC begins normal operation. Then, after the user presses the power button on the computing device, it enters the BIOS boot time, at which point the standby phase ends, and the boot phase begins. At this time, the BIOS begins booting, but the OS has not yet started; both the BMC and CPU begin normal operation. After the BIOS has finished booting, it enters the computing device's running time or running phase, at which point the boot phase ends, the power is plugged in again, the BMC and CPU are working normally, the BIOS exits its operation, and the OS begins operation. This continues until a subsequent power outage by the user or an unexpected power failure causes the computing device to return to a power-off state.
[0079] During BMC standby time, the BMC reads and stores information about PCIe devices via the I2C bus. During BMC standby time, the PCIe device may undergo one or more hardware changes, such as insertion or removal events. In these cases, the BMC can reread and store the device information via the I2C bus. During BIOS (or firmware) boot process, the BIOS can obtain device parameters from the BMC, perform resource allocation, and later verify and provide feedback on the device parameters.
[0080] It should be understood that the BMC is a management system independent of the computing device's own hardware (such as the CPU) and software (such as the OS), and the BMC can operate as soon as the computing device is plugged in. Therefore, the BMC can obtain PCIe device information at any time after the computing device is plugged in, such as during the power-on and running phases, and is not limited to the standby phase.
[0081] The MMIO address resource allocation method proposed in this application will be executed from the start of normal BMC operation until the BIOS boot process is complete.
[0082] As an example, the out-of-band controller includes the BMC. To obtain device information of PCIe devices connected to the computing device through the out-of-band controller, the information of the PCIe devices connected to the computing device can be obtained from the BMC via IPMI commands.
[0083] In this example, IPMI can refer to an industry standard used to manage peripherals for computing devices. For instance, IPMI can span different operating systems, firmware, and hardware platforms, intelligently monitoring, controlling, and automatically reporting the operational status of numerous servers to reduce server system costs. Users can use IPMI to monitor the physical health characteristics of servers, such as temperature, voltage, fan status, and power supply status. At the core of IPMI is the BMC system. During operation, all IPMI functions are accomplished by sending commands to the BMC using instructions defined in the IPMI specification. The BMC receives these commands, records event messages in the system event log, and maintains sensor data records describing the status of sensors in the system.
[0084] As an example, the BMC obtains information from the board of the computing device via the I2C bus or SMBUS.
[0085] In this example, the I2C bus can refer to a simple, two-wire, bidirectional synchronous serial bus that uses one clock line and one data line to transfer information between two devices connected to the bus, providing a simple and efficient method for data exchange between devices. Each device connected to the bus has a unique address, and any device can act as both a master and a slave, but only one master is allowed at a time.
[0086] In this example, SMBUS can refer to a low-speed, inexpensive, and powerful bus used in computing devices to control devices on the motherboard and collect relevant information. For example, SMBUS provides a control bus for tasks such as system and power management. In systems using SMBUS, devices send and receive messages through SMBUS instead of using separate control lines, thus saving pin count. Using SMBUS, devices can also provide their manufacturing information, telling the system their model number, part number, etc., save their status for pending events, report different types of errors, receive control parameters, and return their status, etc.
[0087] As an example, the out-of-band controller obtains and stores information from the board of the computing device, and the information storage format includes a check bit.
[0088] In this example, the specific data of the PCIe peripheral is encoded and stored in a specific format, which includes a checksum to ensure the reliability of data storage and transmission.
[0089] S320. Based on a preset list, obtain the MMIO address resource information corresponding to the device information of the PCIe device. The preset list indicates the correspondence between the device information and the MMIO address resource information.
[0090] In this embodiment, the preset list can refer to a list compiled by the developer during the development process, outlining the required MMIO address resource sizes of all known PCIe devices on the market. This preset list can be stored together with the firmware as part of the firmware. The preset list records the correspondence between each known PCIe device and its required MMIO address resource size. Based on this correspondence, the firmware can find the required resource size for each device based on the PCIe device information obtained from the out-of-band controller, thereby making accurate allocations. In some implementations, the firmware can find the required MMIO resource size for each PCIe device under different strategies, and then allocate resources according to the corresponding strategies.
[0091] Specifically, during the power-on phase of a computing device, the BIOS obtains PCIe device information from the BMC via the IPMI command and compares it with the list stored in the database in the BIOS's NVROM (such as a list of basic device information) to formulate a detailed MMIO allocation strategy and use it to allocate MMIO resources reasonably in each subsequent stage.
[0092] S330. Determine the MMIO address resources allocated to the PCIe device based on the MMIO address resource information.
[0093] In this embodiment, after obtaining the device information of the PCIe device, its MMIO address resource information can be determined, thereby knowing the required MMIO address resource size, so that the MMIO address resource can be allocated according to the corresponding resource requirements of the device.
[0094] Figure 5 A flowchart illustrating an MMIO address resource allocation method according to an embodiment of this application is shown.
[0095] According to this embodiment, the MMIO address resource allocation method includes steps S510 to S560, and each step is described in detail below.
[0096] S510: Obtain device information of the PCIe device connected to the computing device through the out-of-band controller.
[0097] S520. Based on a preset list, obtain the MMIO address resource information corresponding to the device information of the PCIe device. The preset list indicates the correspondence between the device information and the MMIO address resource information.
[0098] For details regarding the S510 and S520, please refer to [link / reference]. Figure 3 The detailed descriptions of S310 and S320 in the embodiments will not be repeated here.
[0099] S530. Based on the query results, formulate a resource allocation strategy.
[0100] In this embodiment, after querying the required MMIO address resources for each PCIe device, resources can be allocated based on the query results. The allocation method can be to directly allocate resources based on the required size of each device, or to modify the query results before allocation. Multiple flexible allocation strategies can be developed to address various situations that may arise with PCIe devices.
[0101] As an example, resource allocation strategies include a minimum allocation strategy and a maximum allocation strategy. The minimum allocation strategy allocates as few MMIO address resources as possible to a PCIe device, while the maximum allocation strategy allocates as many MMIO address resources as possible to a PCIe device. To formulate a resource allocation strategy based on MMIO address resource information, a minimum allocation strategy can be used when the hot-swapping demand of the PCIe device is low, and a maximum allocation strategy can be used when the hot-swapping demand of the PCIe device is high.
[0102] In some application scenarios, the need for hot-swapping is low, meaning that the computing device undergoes little or no hot-swapping during use, resulting in a low probability of changes to its PCIe devices. Therefore, resources can be allocated as economically as possible based on the MMIO address resources obtained from the query, ensuring minimal resource redundancy. Conversely, the need for hot-swapping is high, meaning that the computing device frequently undergoes hot-swapping during use, leading to a higher probability of changes or removals to its PCIe devices. Therefore, more MMIO address resources should be allocated to create greater redundancy, in order to cope with situations where changes to PCIe devices increase resource requirements.
[0103] In some application scenarios, MMIO resource allocation strategies can be refined and replaced with multiple allocation strategies according to R&D needs. For example, for multi-GPU graphics computers, a minimum allocation strategy can be used because these models rarely involve hot-swapping applications. However, for storage-type 24NVME (Non-Volatile Memory Express) passthrough models, a maximum allocation strategy can be used because when a hard drive fails, the user may hot-swap the old NVME hard drive to another model that requires more MMIO resources, thus increasing the required MMIO resources.
[0104] In some application scenarios, different allocation strategies can be selected through BIOS SETUP options, allowing operators to choose manually or automatically. For example, a dynamic strategy can be implemented, automatically comparing and reallocating resources during the BIOS boot BDS phase. In automatic selection, after the BMC obtains information about the PCIe devices on the board, it can consult the hardware and software interface documentation to determine the hardware configuration or model of the current computing device. The hardware and software interface documentation describes various hardware configurations, each including a complete set of PCIe devices, which can employ different MMIO resource allocation strategies. In some configurations, PCIe devices need to be allocated according to the maximum allocation strategy. For example, when the PCIe device is a hard drive, since hard drives are frequently replaced and may be replaced with models requiring more MMIO resources, the interface or root port where the hard drive is connected needs to be allocated as many MMIO resources as possible. For example, it can be allocated according to the maximum MMIO address resources required by all known or commercially available hard drives. In some configurations, PCIe devices can be allocated according to the minimum allocation strategy. For example, when the PCIe device is a GPU, since GPUs rarely undergo hot-plugging applications, the required MMIO address resources of the GPU can be allocated directly according to the query list, without the need to leave any margin.
[0105] S540. Determine the MMIO address resources allocated to the PCIe device according to the resource allocation strategy.
[0106] In this embodiment, after formulating the resource allocation strategy, the MMIO address resources to be allocated to each PCIe device can be determined, enabling the firmware of the computing device to allocate resources to the PCIe devices during the firmware boot phase after power-on. This allocation can refer to allocation directly to a specific device, or allocation to the root node or other nodes of the PCIe device tree structure.
[0107] S550. Determine whether the device information matches the PCIe device information found during the PCIe enumeration process.
[0108] In this embodiment, PCIe enumeration refers to the process by which the CPU finds and recognizes PCIe devices after startup. During the enumeration process, the CPU uses a depth-first search algorithm to scan the PCIe devices, exploring every possible branch path until it can't go any deeper, and each node can only be visited once. For example, the PCIe enumeration process generally includes: creating a root node; scanning devices under the root node; and allocating resources to devices under the root node.
[0109] Figure 6 Showing according to Figure 5A flowchart illustrating the MMIO address resource allocation method in this embodiment.
[0110] Specifically, such as Figure 6 As shown, after booting, the firmware of the computing device obtains PCIe device information data from the BMC via IPMI commands. After obtaining the data, the firmware begins parsing it and accurately allocates MMIO address resources based on the data. Then, it performs the PCIe enumeration process. During the enumeration process, the firmware compares the device data read from the BMC with the device data discovered during the enumeration process to determine whether the data provided by the BMC matches the actual discovered data.
[0111] In this embodiment, the MMIO resource allocation process during the startup of the computing device includes device scanning, verification, device data recalculation, and IPMI command feedback mechanisms to ensure that the MMIO resource allocation process is not affected by hardware damage during the startup process.
[0112] S560. If not, send the mismatch result to the out-of-band controller so that the out-of-band controller can obtain updated device information of the PCIe device connected to the computing device.
[0113] Specifically, such as Figure 6 As shown, if during the PCIe device enumeration process, a mismatch is found between the device information read from the BMC and the data detected during enumeration, an error message is reported to the BMC via IPMI commands, causing the BMC to rescan the I2C or SMBUS to obtain new device information. Besides initiating the BMC's rescan or self-test through PCIe enumeration, the BMC can also periodically poll the PCIe device information on each board during its standby time. If a device change is detected, a rescan can be initiated. Additionally, hardware changes, such as cable plugging / unplugging, can also trigger the BMC's rescan or self-test via CPLD interrupts.
[0114] Subsequently, during the standby phase of the next operating cycle of the computing device (e.g., the next power-on startup), updated device information can be obtained from the out-of-band controller, and then the MMIO address resources allocated to the PCIe device can be re-determined based on the updated device information.
[0115] Specifically, such as Figure 6As shown, after reporting the data mismatch to the BMC via the IPMI command, the BMC rescans the I2C or SMBUS to obtain the updated information of the PCIe device and writes the new data into the BMC system's ROM. At this time, the computing device's firmware again obtains the PCIe device information from the BMC system and gets the updated information. After obtaining the updated information again via the IPMI command, the PCIe device information data can be parsed again and MMIO address resources can be allocated accurately accordingly.
[0116] Figure 7 This diagram illustrates the architecture of an MMIO address resource allocation method according to an embodiment of this application.
[0117] like Figure 7 As shown, in MMIO technology, from an abstract behavioral perspective, the CPU controls PCIe devices through memory. However, in practice, the CPU's I / O instructions are transmitted through the PCIe physical circuitry, and the upper-layer protocol programs of the link parse the I / O instructions.
[0118] In this embodiment, the communication structure between the PCIe device and the CPU forms a tree structure. The root of the tree structure can be called the root bridge, as is the term used by AMD. In some art, such as according to the terminology used by Intel, the root node of the tree structure can be called a stack. In the BIOS field, the root node of the tree structure can also be called a root complex.
[0119] The CPU and the root bridge typically contain multiple lanes. Depending on the hardware design, the root bridge can be divided into multiple root ports, each containing multiple lanes. Different root ports can be assigned to the root bridge by writing registers to the PCIe root management chip. For example, a root bridge with 16 lanes (x16) can be divided into 3 root ports. One root port has 8 lanes (x8) for connecting a GPU (Graphics Processing Unit) or graphics card; the other two root ports each have 4 lanes, used to connect a network card and an OCP (OpenCompute Project) network card, respectively. Therefore, 8 + 4 + 4 = 16. One root bridge is thus allocated into 3 root ports. Any matching PCIe device can be plugged into the root port. In the example above, three end devices were plugged in, but you can also plug in an adapter bridge. For example, you can convert one root port with four channels into four root ports with one channel each, so you can plug four PCIe devices that only need one channel into these root ports.
[0120] In this embodiment, the allocation of MMIO address resources includes two steps. The first step is to allocate MMIO address resources to the root bridge, and the second step is to allocate MMIO address resources to the root ports. In this embodiment, the allocation method of this application can be used when allocating MMIO address resources to the root bridge; the allocation of root ports can be done using conventional methods or other methods. Since the allocation to the root bridge affects the allocation to the root ports, the MMIO address resource allocation method of this embodiment can still affect the size of the MMIO address resources ultimately allocated to each PCIe device.
[0121] In this embodiment, taking a server as an example, its motherboard has one hard drive backplane BC15NHBA plugged in, and three other vertical boards (such as IoRiser adapter cards) plugged in, namely BC15PRUE, BC15PRUI, and BC15PRUC.
[0122] In this embodiment, each CPU has four root ports, such as P0, P1, P2, and P3 of CPU1. Each root port can correspond to one or more cable interfaces. For example, the P0 root port of CPU1 corresponds to two cable interfaces, UBC1-1 and UBC1-2. For motherboards without bridging structures, one root port corresponds to one cable interface; for motherboards with bridging, such as those with a 1-to-2 or 1-to-4 bridging chip, the chip will divide one root port into two or four cable interfaces.
[0123] In this embodiment, UBC1-1 may be connected to a SATA (Serial Advanced Technology Attachment) backplane, which does not occupy MMIO resources. UBC1-2 may be connected to a RAID (Redundant Arrays of Independent Disks) card, which can occupy up to 12MB of MMIO address space.
[0124] Initially, MMIO address space is allocated on a per-root-port basis, with each port receiving 10MB according to an equal allocation principle, for a total of 80MB. See Table 1.
[0125] Table 1
[0126]
[0127] After the power is plugged in, the server enters the BMC standby state from the power-off state. In this state, the BMC accesses the EEPROM chips on each backplane and stand-up board through the I2C bus to obtain the name of each backplane (e.g., BoardID) and the cable connection status.
[0128] When the power button is clicked, the CPU obtains information through the IPMI command during the initialization process. Based on this information, it can be analyzed that the machine is using a specific combination of hardware and software interfaces as specified in the documentation. Then, based on the data about this combination preset in the BIOS, it can be determined which devices may be plugged into each interface.
[0129] In this embodiment, the hardware / software interface documentation can refer to a document stored in the BIOS database, which records various hardware connection configurations (or combinations). Each hardware connection configuration includes a complete set of PCIe devices required to connect to each interface of the computing device. Different configurations may correspond to different machine models. In different configurations, the PCIe devices connected to each interface of the computing device may be different. Therefore, after obtaining the PCIe device information through the BMC, by referring to the hardware / software interface documentation, it is possible to determine which hardware configuration the computing device adopts. Based on this configuration, it is possible to determine which machine model the computing device uses, and it can also be used to help determine the MMIO resource size that should be allocated to the corresponding interface (e.g., cable interface or root port).
[0130] Hardware and software interface documentation can be used in conjunction with lists stored in the BIOS (such as device basic information lists). In some cases, if the model of the device plugged into the cable interface is known, the required MMIO address resource size can be determined directly through the device basic information list. If no device is plugged into the cable interface, the hardware and software interface documentation can be used to determine the hardware connection configuration of the computing device. Based on the information in this specific configuration, it can be used to predict what kind of device will be plugged into this interface or might be plugged in, thus determining the required MMIO address resource size in advance.
[0131] Then, MMIO resources are pre-allocated for each root bridge. This allocation is a general allocation, and the results are shown in Table 2. Further refined allocation is then performed for the root ports; the details of the allocation are not elaborated here.
[0132] Table 2
[0133]
[0134] This embodiment uses the I2C communication interface of the out-of-band management chip to traverse the board's EEPROM and obtain the insertion information. This allows the CPU to obtain the specific hardware configuration early in the CPU startup phase via IPMI commands, thereby allocating MMIO physical memory resources to each root bridge in a targeted manner. Compared to the initial state, this embodiment saves 28MB of MMIO physical memory resources, which is 35% of the initial allocation, thus improving operating system performance. In addition, this embodiment eliminates the risk of out-of-resource errors caused by individual PCIe devices, improving the stability of machine operation.
[0135] Based on the foregoing Figure 2 The present application also provides an MMIO address resource allocation device, the structural schematic of which is shown in the embodiment of the method described above. Figure 8 As shown. This device is used to perform the aforementioned... Figure 2 Each step in the process.
[0136] According to this embodiment, the device includes a first acquisition module 810, a second acquisition module 820, and a determination module 830. The first acquisition module 810 is used to acquire device information of a PCIe device connected to a computing device via an out-of-band controller. The second acquisition module 820 is used to acquire MMIO address resource information corresponding to the device information of the PCIe device based on a preset list, where the preset list indicates the correspondence between device information and MMIO address resource information. The determination module 830 is used to determine the MMIO address resources allocated to the PCIe device based on the MMIO address resource information.
[0137] It should be noted that, Figure 8 The MMIO address resource allocation device 800 provided in the illustrated embodiment is only illustrated by the division of the above-described functional modules when executing the method. In practical applications, the above-described functional allocation can be completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device 800 provided in the above embodiment and Figure 2 The method embodiments shown belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0138] Figure 9 This is a schematic diagram of the hardware structure of a computing device 900 provided in an embodiment of this application.
[0139] See Figure 9The computing device 900 includes a processor 910, a memory 920, a communication interface 930, and a bus 940, which are interconnected via the bus 940. The processor 910, memory 920, and communication interface 930 may also be connected using other methods besides the bus 940.
[0140] The memory 920 can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), flash memory, optical storage, hard disk, etc.
[0141] The processor 910 may be a general-purpose processor, which can be a processor that performs specific steps and / or operations by reading and executing contents stored in memory (e.g., memory 920). For example, the general-purpose processor may be a central processing unit (CPU). The processor 910 may include at least one circuit to perform... Figure 2 The illustrated embodiment provides all or part of the steps of the MMIO address resource allocation method.
[0142] The communication interface 930 includes input / output (I / O) interfaces, physical interfaces, and logical interfaces for interconnecting devices within the computing device 900, as well as interfaces for interconnecting the computing device 900 with other devices (such as other computing devices or user equipment). Physical interfaces can be Ethernet interfaces, fiber optic interfaces, ATM interfaces, etc. The communication interface 930 can connect to external input and output devices. For example, input devices can be microphones or microphone arrays for capturing voice input signals; they can be communication network connectors for receiving collected input signals from the cloud or other devices; and they can also include, for example, keyboards, mice, etc. Output devices can output various information externally, including determined distance information, direction information, etc. Output devices can include, for example, displays, speakers, printers, and communication networks and their connected remote output devices, etc.
[0143] The bus 940 can be any type of communication bus used to interconnect the processor 910, memory 920 and communication interface 930, such as a system bus.
[0144] The aforementioned devices can be disposed on separate chips, or at least partially or entirely on the same chip. Whether to dispose of the devices independently on different chips or integrate them on one or more chips often depends on the needs of the product design. This application does not limit the specific implementation of the aforementioned devices.
[0145] Figure 9 The computing device 900 shown is merely an example. In the implementation process, the computing device 900 may also include other components, which will not be listed one by one in this article.
[0146] Embodiments of this application may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the steps in the MMIO address resource allocation method according to various embodiments of this application described above.
[0147] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0148] The concepts, principles, and ideas of this application have been described in detail above with reference to specific embodiments (including examples and instances). Those skilled in the art should understand that the embodiments of this application are not limited to those given above. After reading this application, those skilled in the art can make any possible improvements, substitutions, and equivalents to the steps, methods, apparatus, and components in the above embodiments, and such improvements, substitutions, and equivalents should be considered to fall within the scope of this application. The scope of protection of this application is limited to the claims.
Claims
1. A method for allocating MMIO address resources, characterized in that, The method includes: Obtain device information of the PCIe devices connected to the computing device through the out-of-band controller; Based on a preset list, obtain the MMIO address resource information corresponding to the device information of the PCIe device. The preset list indicates the correspondence between the device information and the MMIO address resource information. Based on the MMIO address resource information, the MMIO address resources allocated to the PCIe device are determined; The step of determining the MMIO address resources allocated to the PCIe device based on the MMIO address resource information includes: Based on the MMIO address resource information, a resource allocation strategy is formulated; Based on the resource allocation strategy, the MMIO address resources allocated to the PCIe device are determined; The resource allocation strategy includes a minimum allocation strategy and a maximum allocation strategy. The minimum allocation strategy is used to allocate as few MMIO address resources as possible to the PCIe device, and the maximum allocation strategy is used to allocate as many MMIO address resources as possible to the PCIe device. The step of formulating a resource allocation strategy based on the MMIO address resource information includes: If the hot-swapping requirement of the PCIe device is low, the minimum allocation strategy shall be adopted. If the PCIe device has a high demand for hot-swapping, the maximum allocation strategy shall be adopted.
2. The method according to claim 1, characterized in that, The step of obtaining device information of the PCIe device connected to the computing device through the out-of-band controller includes: During the power-on phase after the computing device is powered on and started, the out-of-band controller obtains the device information of the PCIe device connected to the computing device. The out-of-band controller obtains the information from the board of the computing device during the standby phase when the computing device is powered on but not started.
3. The method according to claim 1, characterized in that, The out-of-band controller includes a BMC, and the process of obtaining device information of a PCIe device connected to the computing device through the out-of-band controller includes: Device information of the PCIe devices connected to the computing device is obtained from the BMC via IPMI commands.
4. The method according to claim 3, characterized in that, The BMC obtains the device information from the board of the computing device via the I2C bus or SMBUS.
5. The method according to claim 1, characterized in that, After determining the MMIO address resources allocated to the PCIe device based on the MMIO address resource information, the method further includes: Determine whether the device information matches the PCIe device information found during the PCIe enumeration process; If not, the mismatch result is sent to the out-of-band controller, so that the out-of-band controller can obtain the updated device information of the PCIe device connected to the computing device; The updated device information is obtained from the out-of-band controller; Based on the updated device information, the MMIO address resources allocated to the PCIe device are re-determined.
6. The method according to claim 1, characterized in that, The out-of-band controller obtains and stores the information from the board of the computing device, and the storage format of the information includes a check bit.
7. The method according to claim 1, characterized in that, The method is implemented by running firmware on a computing device, the firmware including at least one of BIOS, UEFI, CoreBoot, and SlimBootloader.
8. A computing device, characterized in that, The computing device includes a processor and a memory, the processor being configured to execute a computer program stored in the memory to implement the MMIO address resource allocation method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for dynamically identifying PCIE equipment by BMC
CN114443553A
Peripheral component interface express (PCIE) device initialization method and server
CN115686650A
Address space allocation method, server, electronic equipment and storage medium
CN116346781A
