Method for processing resources and electronic device
By parsing the configuration space information of PCIe devices and adjusting resource allocation using the management controller, the problem of resource allocation mismatch caused by firmware information misidentification was solved, achieving higher resource allocation accuracy and system stability.
Patent Information
- Application Number
- CN202511422246.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-09-30
AI Technical Summary
During the startup process of electronic devices, resource allocation mismatch caused by misidentification of PCIe device firmware information can affect device functionality and system stability.
By parsing the configuration space information of connected devices, resource configuration information can be obtained, and resource allocation strategies can be flexibly adjusted based on the intervention of the management controller to ensure that resource allocation matches device requirements.
It improves the accuracy of resource allocation, avoids limitations in equipment functionality, and enhances system stability and security.
Smart Images

Figure CN120892096B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of resource management technology, and in particular to resource processing methods and electronic devices. Background Technology
[0002] In the current field of computer technology, Peripheral Component Interconnect Express (PCIe), as a high-performance serial computer expansion bus standard, has become a key interface for connecting external devices and electronic devices (such as computer motherboards). PCIe devices encompass various types, including network cards, graphics cards, and storage controllers, and are widely used in servers, personal computers, and embedded systems. With the expansion of the PCIe device market, the diversity and complexity of devices are also increasing. However, during the boot process of electronic devices, due to the varying maturity levels of different PCIe devices, errors in firmware settings can lead to misidentification, thus affecting the functionality of the PCIe device. Especially for peripheral devices connected via the PCIe interface, this misidentification directly affects the allocation of Memory Mapped I / O (MMIO) resources, potentially limiting the device's performance or causing partial or complete malfunction.
[0003] Therefore, there is a problem of resource allocation mismatch caused by misidentification of firmware information in related technologies. Summary of the Invention
[0004] This application provides a resource processing method and an electronic device to at least solve the problem of resource allocation mismatch caused by misidentification of firmware information in related technologies.
[0005] This application provides a method for processing resources, including:
[0006] During the startup process of an electronic device, a set of designated registers indicated by the configuration space information of the connected devices among multiple connected devices are parsed to obtain the resource information of the connected devices of the multiple connected devices. The multiple connected devices are devices connected to the electronic device through a designated interface, and the resource information of the connected devices of the multiple connected devices is used to indicate the resource requirements of the corresponding connected devices.
[0007] Obtain resource configuration information, wherein the resource configuration information is configured by the basic input / output system in response to a specified command forwarded by the management controller, the resource configuration information is used to indicate the resource configuration policy of the connected devices among the plurality of connected devices, the specified command is a command executed by the management controller to trigger a specified interrupt process, the specified interrupt process is used to instruct the processor to suspend processing and save the execution state of the processor when it suspends processing;
[0008] Based on the resource configuration information and the resource information of the connected devices among the multiple connected devices, the specified resources are allocated to the connected devices among the multiple connected devices.
[0009] This application also provides a resource processing apparatus, comprising:
[0010] The parsing module is used to parse a set of specified registers indicated by the configuration space information of the connected devices among multiple connected devices during the startup process of the electronic device, so as to obtain the resource information of the connected devices of the multiple connected devices. The multiple connected devices are devices connected to the electronic device through a specified interface, and the resource information of the connected devices of the multiple connected devices is used to indicate the resource requirements of the corresponding connected devices.
[0011] The acquisition module is used to acquire resource configuration information, wherein the resource configuration information is configured by the basic input / output system in response to a specified command forwarded by the management controller, the resource configuration information is used to indicate the resource configuration policy of the connected devices among the plurality of connected devices, the specified command is a command executed by the management controller to trigger a specified interrupt process, and the specified interrupt process is used to instruct the processor to suspend processing and save the execution state of the processor when it suspends processing;
[0012] The allocation module is used to allocate specified resources to the connected devices among the multiple connected devices based on the resource configuration information and the resource information of the connected devices.
[0013] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the processing steps of any of the above-described resources when executing the computer program.
[0014] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described resource processing methods.
[0015] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described resource processing methods.
[0016] This application describes a method for parsing a set of designated registers indicated by the configuration space information of multiple connected devices during the startup process of an electronic device. This parsing yields resource information for the connected devices, where the multiple connected devices are those connected to the electronic device via designated interfaces. The resource information of these connected devices indicates their respective resource requirements. Furthermore, resource configuration information is obtained, configured by the basic input / output system in response to a designated command forwarded by the management controller. This resource configuration information indicates the resource configuration strategy for the connected devices, and the designated command is executed by the management controller. The command is used to trigger a specified interrupt procedure, which instructs the processor to pause processing and save the execution state when the processor pauses processing. Based on resource configuration information and resource information of multiple connected devices, specified resources are allocated to the connected devices among the multiple connected devices. This enables the basic input / output system to flexibly adjust the resource allocation strategy through the intervention of the management controller, even if the device firmware declaration is incorrect. This solves the problem of resource allocation mismatch caused by misidentification of firmware information in related technologies, improves the accuracy of resource allocation, and improves system stability by avoiding device function limitation caused by improper resource allocation. Attached Figure Description
[0017] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram illustrating an application scenario of a resource processing method according to an embodiment of this application.
[0019] Figure 2 This is a flowchart illustrating an optional resource processing method according to an embodiment of this application.
[0020] Figure 3 This is a schematic diagram of an optional resource processing method according to an embodiment of this application.
[0021] Figure 4 This is a schematic diagram illustrating an optional resource processing interaction according to an embodiment of this application.
[0022] Figure 5 This is a flowchart illustrating another optional resource processing method according to an embodiment of this application.
[0023] Figure 6 This is a structural block diagram of an optional resource processing apparatus according to an embodiment of this application. Detailed Implementation
[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0025] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0026] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0027] According to one aspect of the embodiments of this application, a method for processing resources is provided. Optionally, in this embodiment, the above-described resource processing method may be applied, but is not limited to, to... Figure 1 The hardware environment shown includes terminal device 102 and server 104. Server 104 can be connected to terminal device 102 via a network and can be used to provide services (e.g., application services, etc.) to terminal device 102 or clients installed on terminal device 102. A database can be set up on server 104 or independently of server 104 to provide data storage services for server 104.
[0028] The aforementioned network may include, but is not limited to, at least one of the following: wired network and wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network (WAN), metropolitan area network (MAN), and local area network (LAN). The aforementioned wireless network may include, but is not limited to, at least one of the following: Wireless Fidelity (WIFI) and Bluetooth. Terminal device 102 may be, but is not limited to, a personal computer (PC), tablet computer, etc. Server 104 may be, but is not limited to, a cloud server, server cluster, or other server types.
[0029] The resource processing method of this application embodiment can be executed by server 104, terminal device 102, or jointly by server 104 and terminal device 102. Alternatively, the resource processing method of this application embodiment can be executed by a client installed on the terminal device 102.
[0030] Taking the resource processing method in this embodiment executed by terminal device 102 as an example, Figure 2 This is a flowchart illustrating an optional resource processing method according to an embodiment of this application, such as... Figure 2 As shown, the process of this method may include the following steps:
[0031] Step S202: During the startup process of the electronic device, a set of specified registers indicated by the configuration space information of the connected devices among the multiple connected devices are parsed to obtain the resource information of the connected devices of the multiple connected devices. The multiple connected devices are devices connected to the electronic device through specified interfaces, and the resource information of the connected devices of the multiple connected devices is used to indicate the resource requirements of the corresponding connected devices.
[0032] Step 204: Obtain resource configuration information. The resource configuration information is configured by the basic input / output system in response to a specified command forwarded by the management controller. The resource configuration information is used to indicate the resource configuration policy of the connected devices among multiple connected devices. The specified command is a command executed by the management controller to trigger a specified interrupt process. The specified interrupt process is used to instruct the processor to suspend processing and save the execution state when the processor suspends processing.
[0033] Step S206: Based on the resource configuration information and the resource information of the connected devices among the multiple connected devices, the specified resources are allocated to the connected devices among the multiple connected devices.
[0034] The resource processing method in this embodiment can be mainly applied to the field of computer system hardware resource management, especially for resource allocation issues of devices based on PCI Express (PCIE) technology. It involves intelligently parsing and dynamically configuring hardware resource (especially MMIO resources) requirements during the startup phase of electronic devices (such as servers, personal computers, embedded systems, etc.) to ensure that resource allocation is highly matched with the actual needs of the device, thereby improving system performance and the full utilization of device functions.
[0035] In the current computer technology field, PCIe, as a high-performance serial computer expansion bus standard, has become a key interface for connecting external devices and electronic devices (such as computer motherboards). PCIe devices encompass various types, including network cards, graphics cards, and storage controllers, and are widely used in servers, personal computers, and embedded systems. With the expansion of the PCIe device market, the diversity and complexity of devices are also increasing. However, during the boot process of electronic devices, due to the varying maturity levels of different PCIe devices, errors in firmware settings can lead to misidentification, thus affecting the functionality of the PCIe device. Especially for peripheral devices connected via the PCIe interface, this misidentification directly affects the allocation of MMIO resources, potentially limiting the device's performance or causing partial or complete functional failure. Therefore, related technologies suffer from resource allocation mismatch issues caused by firmware information misidentification.
[0036] To at least partially solve the aforementioned technical problems, in this embodiment, during the startup process of the electronic device, a set of designated registers indicated by the configuration space information of the connected devices among multiple connected devices are parsed to obtain the resource information of the connected devices among multiple connected devices. Resource configuration information based on the management controller is obtained. Based on the resource configuration information and the resource information of the connected devices among multiple connected devices, designated resources are allocated to the connected devices among multiple connected devices. This enables the basic input / output system to flexibly adjust the resource allocation strategy through the intervention of the management controller even if the device firmware declaration is incorrect. This solves the problem of resource allocation mismatch caused by misidentification of firmware information in related technologies, improves the accuracy of resource allocation, and improves the stability of the system by avoiding device function limitations caused by improper resource allocation.
[0037] It should be noted that, in this embodiment, the electronic device can be a server, personal computer, or other similar device. The connected device can be a device that has already connected to the electronic device through a specified interface, specifically an external network device or electronic information that establishes a connection with the electronic device through a specific physical or logical structure. For example, devices connected via a PCIe interface, such as network cards, graphics processors, and storage controllers. The specified interface can refer to a specific interface type used to connect the connected device to the host electronic device. In the case where the specified device is a PCIe device, the specified interface can be a PCIe interface. The configuration space information can refer to the configuration information related to the connected device recorded in the configuration space corresponding to the connected device. The configuration space refers to the space that stores device identifiers, status, and configuration information. The configuration space can include a set of specified registers, which are used to declare resource requirements (such as MMIO resource type and size) within the configuration space.
[0038] Resource information is extracted by parsing a set of specified registers indicated by the configuration space information. This resource information can be used to indicate the type and size of resources required by connected devices. For example, MMIO resources refer to a dedicated area of system memory requested by the device to achieve high-speed data transmission and processing.
[0039] Electronic devices include a Basic Input / Output System (BIOS), a management controller (such as a Baseboard Management Controller (BMC)), and a processor, etc. The BIOS can refer to system software used to control the boot sequence and hardware resource initialization of electronic devices (such as servers). The management controller can refer to a component that remotely monitors and manages hardware. In this embodiment, the management controller can be used to forward configuration commands and trigger interrupt procedures. A specified interrupt procedure can be used to instruct the processor to suspend its currently executing task and enter a pre-defined processing procedure upon receiving a specific signal, for immediate response and handling of adjustments to device resource configuration. Resource configuration information can refer to information generated by the BIOS in response to a specified command forwarded by the Baseboard Management Controller. This information indicates how to flexibly adjust resource allocation strategies based on the actual needs of connected devices rather than their configuration space declarations. Specifically, this may include, but is not limited to, the selection of three modes: Auto / MMIOL / MMIOH, and the specific resource allocation details for each mode. A specified command can refer to a special command executed by the management controller. It can be generated through a specified protocol (such as the Intelligent Platform Management Interface (IPMI) protocol). Specified commands can be used to trigger specified interrupt processes within the basic input / output system, thereby enabling dynamic adjustment of resources.
[0040] Optionally, during the initial startup of the electronic device, the Basic Input / Output System (PIS) can initialize system resources, including setting the address and type of the System Management Interrupt (SMI) handler. The PIS writes the SMI handler's address information into a specific register in the processor and loads the handler's code into System Management RAM (SMRAM) to ensure that the SMI handler is not interfered with by user-level programs during execution. When it is detected that the management controller needs to adjust the resource allocation policy for connected PCIe devices, a System Management Interrupt (SMI) can be triggered to send a hardware interrupt signal to the system chipset (such as the southbridge chip). The signal is configured according to a preset SMI interrupt type to ensure that it can be recognized and responded to by the processor. Upon receiving the SMI interrupt signal, the CPU immediately suspends the current execution task and jumps to the preset SMI handler address in SMRAM.
[0041] Optionally, during server maintenance, the management controller may detect that the firmware claim of a PCIe device does not match its actual requirements, necessitating an adjustment to the resource allocation strategy. The management controller will send a hardware signal to the chipset, triggering an SMI interrupt and initiating the resource allocation strategy adjustment process.
[0042] Optionally, upon receiving a specified interrupt signal, the processor will pause its current execution task and adjust the memory area corresponding to the specified interrupt signal, such as the area in SMRAM where the pre-defined SMI handler is located. At this time, the processor can save its current execution state (such as register values, program counter, etc.) to ensure accurate resumption of execution after interrupt handling. Then, the processor jumps to the corresponding interrupt handler code in SMRAM based on the SMI signal and begins executing the SMI processing flow.
[0043] Optionally, when the management controller triggers the interrupt process, the interrupt signal can be sent to the interrupt controller, which then sends the interrupt signal to the processor, causing the processor to suspend the current task, save the current state, and then jump to the preset interrupt handling process.
[0044] Optionally, the type of a specified command forwarded by the management controller can be determined by parsing the interrupt handling process. Preset command types can include configuration commands, query commands, and recovery commands. Query commands can be used to instruct the querying of resource configuration information and can be for a specific connected device. Recovery commands can be used to instruct the restoration of default resource information for connected devices, and can also be for a specific connected device, or for all connected devices.
[0045] Optionally, when the electronic device starts up, the basic input / output system can poll and check the configuration space information of all devices connected through the specified P interface, read the contents of the specified registers to understand the resource requirements, and determine the resource requirements.
[0046] Optionally, the BMC can receive resource allocation adjustment commands via IPMI to perform initial verification and identification of the resource allocation adjustment commands. If the initial verification and identification are successful, a specified interruption process is triggered to control the allocation according to the new resource configuration policy.
[0047] Optionally, the management controller can be deployed with a demand database, which can be used to record the correspondence between device types and resource requirements. During the startup process of electronic devices, it can identify whether the configuration space information of connected devices meets the specified configuration requirements (and the type of connected devices). If a discrepancy is found, a specific command (such as a specified command) can be triggered to generate a specific command to trigger resource reconfiguration.
[0048] Optionally, during the startup process of the electronic device, in-situ device identification can be performed to identify multiple connected devices. Specifically, the basic input / output system can be used to traverse all physical interfaces on the motherboard of the electronic device to read the status register corresponding to each physical interface, and based on the status register, determine whether a connected device exists.
[0049] In this embodiment of the application, during the startup process of an electronic device, a set of designated registers indicated by the configuration space information of multiple connected devices are parsed to obtain the resource information of the connected devices. These connected devices are devices connected to the electronic device through designated interfaces, and the resource information of the connected devices indicates the resource requirements of the corresponding connected devices. Resource configuration information is then obtained, configured by the basic input / output system in response to a designated command forwarded by the management controller. This resource configuration information indicates the resource configuration strategy of the connected devices among the multiple connected devices, and the designated command is issued by the management controller. The command executed by the processor triggers a specified interrupt procedure, which instructs the processor to pause processing and save the execution state when the processor pauses processing. Based on resource configuration information and resource information of multiple connected devices, specified resources are allocated to the connected devices among the multiple connected devices. This enables the basic input / output system to flexibly adjust the resource allocation strategy through the intervention of the management controller, even if the device firmware declaration is incorrect. This solves the problem of resource allocation mismatch caused by misidentification of firmware information in related technologies, improves the accuracy of resource allocation, and improves the stability of the system by avoiding device function limitation caused by improper resource allocation.
[0050] In one exemplary embodiment, before obtaining resource configuration information, the method further includes: responding to a configuration command, performing preliminary verification processing on the configuration command through a management controller to obtain a preliminary verification result; if the preliminary verification result indicates that the configuration command is valid, executing a specified interrupt procedure and forwarding the configuration command to the basic input / output system; performing verification processing on the configuration command through the basic input / output system; if the configuration command passes verification, updating the configuration indication information of the connected device indicated by the configuration command based on the configuration command to update the resource configuration information.
[0051] It should be noted that configuration commands can refer to commands used to instruct adjustments to the MMIO resource allocation mode of connected devices. In this embodiment, configuration commands can refer to IPMI commands customized by the Original Equipment Manufacturer (OEM).
[0052] Optionally, upon receiving a configuration command, the management controller can perform preliminary validation by detecting the format of the configuration command. Alternatively, the management controller can perform preliminary validation by detecting the header of the configuration command. If the preliminary validation passes, the management controller can trigger the execution of a specified interrupt procedure and forward the validated configuration command to the basic input / output system. If the preliminary validation fails, feedback information can be triggered to indicate the termination of the configuration instruction; for example, returning an error status value of 01 or 02 to inform the management software that the command is invalid or the data is non-compliant.
[0053] Optionally, the Elementary Input / Output System (Elementary Input / Output System) can further validate the configuration commands to ensure that the device identifiers and resource requirements in the commands are consistent with the current hardware configuration and resource availability in the Elementary Input / Output System. Only configuration commands that pass the validation can be executed, thereby updating the resource allocation information.
[0054] Configuration instruction information can refer to parameters and settings used to guide the basic input / output system in allocating resources to connected devices, and can be a configuration information within the resource configuration information.
[0055] It should be noted that the specified command can be a configuration command that has passed the management controller's verification. The specified command can also be a query command or a recovery command. The initial verification method for query commands, recovery commands, and configuration commands in the management controller can be the same. The verification method for query commands and configuration commands in the basic input / output system can be the same.
[0056] This embodiment demonstrates how the collaborative operation of the management controller and the basic input / output system (PIS) can dynamically adjust resource allocation strategies based on actual device requirements. This addresses the resource allocation mismatch issue caused by firmware misidentification in related technologies, improving the accuracy of resource allocation and effectively preventing allocation failures due to configuration errors, thus ensuring the normal functioning of the device. Furthermore, the management controller's preliminary verification of configuration commands ensures that the command format and content meet expectations, preventing invalid or erroneous configuration instructions from being executed by the PIS and enhancing system security.
[0057] In an exemplary embodiment, the configuration command is initially validated by the management controller to obtain an initial validation result. This includes: parsing the start identifier of the configuration command to obtain the category information of the configuration command; and validating the configuration command if the category information of the configuration command meets specified conditions to obtain an initial validation result of the configuration command.
[0058] It should be noted that the start identifier can refer to an instruction used to identify whether a command is related to the allocation of a specified resource, and can be used to indicate the category information of the configuration instruction. In this embodiment, the start identifier can refer to the information header of the configuration command, such as MMIO, which can be used to quickly identify whether the configuration command is related to MMIO resource allocation.
[0059] The specified conditions can refer to the instruction type corresponding to the type of resource to be allocated. If the category information of the configuration command meets the specified conditions (such as corresponding to the type of resource to be allocated), the configuration command is validated to obtain the preliminary validation result of the configuration command.
[0060] Optionally, validating configuration commands may involve checking whether the parameters in the configuration command conform to predefined rules, such as whether the values of different parameters are within a valid range. Predefined rules may include system hardware and software constraints.
[0061] In one example, a configuration command is sent to the BMC via the IPMI protocol. The start identifier of this command is MMIO. The BMC parses the header, confirms that this is an MMIO resource allocation command, and after confirming the type of configuration command, begins to verify the specific parameters in the configuration command to perform validity verification processing, obtaining the preliminary verification result of the configuration command.
[0062] This embodiment utilizes the identification of the start identifier of configuration commands to quickly pinpoint command types, effectively filtering irrelevant commands and preventing invalid commands from consuming system resources, thus improving resource allocation efficiency. Furthermore, the initial verification mechanism acts as an additional firewall, effectively blocking illegal or erroneous configuration commands and enhancing system security.
[0063] In an exemplary embodiment, the configuration command includes multiple specified fields, which are ordered in a specified order. The configuration command is subjected to validity verification to obtain a preliminary verification result, including: parsing and verifying the specified fields in the configuration command in the specified order; and determining that the configuration command is initially valid if all specified fields in the multiple specified fields meet the specified configuration conditions.
[0064] It should be noted that configuration commands can include multiple specified fields, and these fields can include a start identifier. The specified fields are ordered according to a specified sequence, where the start identifier can be the first field among the specified fields.
[0065] Upon receiving a configuration command, the management controller will sequentially parse and verify the specified fields in the configuration command. If all specified fields meet the specified configuration conditions, the configuration command is deemed initially valid. Specified configuration conditions can include field value ranges, field types, etc.
[0066] Optionally, a specified field from multiple specified fields can be sequentially selected as the current specified field, and the specified configuration condition corresponding to the current specified field can be selected as the current specified configuration condition. Preliminary validity verification is then performed sequentially: if the current specified field satisfies the current specified configuration condition, the current specified field is determined to be valid, and the verification of the next specified field is performed, until the verification of multiple specified fields is completed. The verification of multiple specified fields can be considered complete if all specified fields have passed preliminary verification, or if one specified field has failed preliminary verification.
[0067] This embodiment effectively intercepts illegal or erroneous resource requests by parsing and verifying specified fields in configuration commands in sequence, thereby improving the processing efficiency of configuration commands and ensuring the correctness of resource allocation.
[0068] In one exemplary embodiment, the specified order of the multiple specified fields is, in sequence, a processor field, a specified port field, and a bandwidth field, wherein the specified port indicated in the specified port field is a port connected to the processor in the electronic device; the specified fields in the configuration command are parsed and verified sequentially according to the specified order, including: identifying first specified data of the electronic device through the management controller, wherein the first specified data includes a first set of processor numbers, a first set of specified port numbers, and a first bandwidth level range; determining that the processor field is valid if the processor number indicated by the processor field belongs to the first set of processor numbers; determining that the specified port field is valid if the specified port number indicated by the specified port field belongs to the first set of specified port numbers; and determining that the bandwidth field is valid if the bandwidth level indicated by the bandwidth field is within the first bandwidth level range.
[0069] It should be noted that the specified fields include a processor field, a specified port field, and a bandwidth field. The order in which these fields are specified can be processor field, specified port field, and bandwidth field, respectively. The processor field can refer to the number of the processor involved in the configuration command, such as the CPU number. The specified port field can refer to the number of the specified port directly connected to the processor, such as the PCIe Port number. The bandwidth field indicates the bandwidth group index of the specified port, such as the PCIe bandwidth group index, which can be represented by the Index field.
[0070] Optionally, after receiving the configuration command, the management controller will parse and verify each field in the order of processor field, specified port field, and bandwidth field.
[0071] After initial verification of the configuration commands, the management controller can identify the electronic device using first specified data. This first specified data can indicate the actual hardware configuration information of the electronic device identified by the management controller. The first specified data may include a first processor number set, a first specified port number set, and a first bandwidth level range. The first processor number set can indicate the range of processor numbers actually present in the electronic device; the first specified port number set can indicate the numbering information of the specified ports corresponding to the processors actually present in the electronic device; and the first bandwidth level range can indicate the identifiable value range of the bandwidth group index of the connected device (such as a PCIe device).
[0072] For example, if the electronic device's system supports a maximum of 8 processors, the BMC will read the first set of processor numbers from 0 to 7 to determine whether the Socket field in subsequent configuration commands points to the actual CPU in place. Alternatively, it can read the first set of processor numbers consisting of the numbers of the identifiable processors.
[0073] In one example, the received configuration command contains a Socket value of 0x02, a PEPort value of 0x04, and an Index value of 0x06. The BMC compares these values with the first set of processor numbers (0 to 7), the first set of specified port numbers (0 to 5), and the first bandwidth level range (0 to 7) to ensure that each field value is within the valid range, thereby verifying the validity of the configuration command.
[0074] Of course, in this embodiment, in addition to configuration commands, the management controller can also receive other commands, such as query commands and reset commands. The query command can be used to instruct the querying of resource configuration information for connected devices, and the reset command can be used to instruct the restoration of the default configuration information for connected devices. In practice, the basic input / output system still records resource configuration information for connected devices. This resource configuration record information is used to record the historical and default resource configuration information of connected devices based on their identification information. Similarly, to ensure system security, the query command can also perform preliminary verification by the management controller and the verification process of the basic input / output system. Specifically, refer to the implementation process of the configuration command.
[0075] Optionally, after the management controller completes the comparison of multiple specified fields with the first specified data, it can return a status value indicating whether the configuration command is valid based on the result, such as 00 indicating success, 01 indicating header error, 02 indicating invalid data, and 03 indicating interaction error.
[0076] This embodiment enhances system security by verifying the validity of configuration command fields, preventing illegal or erroneous command attempts. Furthermore, by specifying the parsing order and validity verification process for fields, the processing efficiency of configuration commands is optimized, reducing the processing time for invalid commands.
[0077] In one exemplary embodiment, the configuration command is validated via a basic input / output system, including: identifying second specified data of an electronic device via the basic input / output system, wherein the second specified data includes a second processor number set and a second specified port number set; determining that the processor field is valid if the processor number indicated by the processor field belongs to the second processor number set; and determining that the specified port field is valid if the specified port number indicated by the specified port field belongs to the second specified port number set, thereby determining that the configuration command is valid.
[0078] It should be noted that during system startup, the Basic Input / Output System reads records from a designated memory (such as NVRAM) to identify a second designated data set, which is the set of CPU numbers actually available in the current system (second processor number set) and the set of PCIe port numbers connected to these CPUs (second designated port number set).
[0079] Optionally, if the processor number indicated by the processor field does not belong to the second set of processor numbers, the processor field is determined to be invalid; if the specified port number indicated by the specified port field belongs to the second set of specified port numbers, the specified port field is determined to be invalid.
[0080] In one example, assume the system is currently configured with 4 CPUs, each supporting 3 PCIe ports. The BIOS will recognize the second processor number set as {0, 1, 2, 3} and the second specified port number set as {0, 1, 2}. If the processor field value in the configuration command is 0x02, the BIOS will check if 0x02 is within the range {0, 1, 2, 3} to confirm its validity. If the specified port field value in the configuration command is 0x01, the BIOS will check if 0x01 is within the range {0, 1, 2} to further confirm the validity of this field, thus determining that the configuration naming is valid.
[0081] Through this embodiment, the accuracy and validity of configuration commands can be ensured by further verification of the basic input / output system. It also strengthens the system's control over hardware resources, avoids the execution of illegal commands, and thus improves the stability and security of the entire system.
[0082] In one exemplary embodiment, a set of designated registers includes a set of base address registers. Parsing the set of designated registers indicated by the configuration space information of the connected devices among the multiple connected devices to obtain the resource information of the connected devices among the multiple connected devices includes: parsing the set of base address registers of the connected devices among the multiple connected devices to obtain the initial configuration information of the set of base address registers; and summarizing the initial configuration information of the set of base address registers of the connected devices among the multiple connected devices according to resource attributes to obtain the resource information of the connected devices among the multiple connected devices.
[0083] It should be noted that the configuration space of a connected device records a set of base address registers. Based on these base address registers, the base addresses of the connected device's I / O ports or Memory Mapped I / O (MMIO) resources can be indicated. The base address registers define the mapping range of the connected device's resources (such as I / O space and MMIO space) in system memory. The connected device can access the corresponding I / O or MMIO resources in system memory through these base addresses. In this embodiment, upon system startup, the Basic Input / Output System (PIOS) reads the values of the base address registers in the configuration space of the connected device. Based on the values of the base address registers and the latest resource configuration information, it allocates specified resources to the connected device. After allocation, the base addresses stored in the base address registers are updated to reflect the actual resource location and type.
[0084] Optionally, the basic input / output system can poll the connected devices, access the configuration space of each connected device, extract the initial configuration information of a set of base address registers (BARs), and summarize each base address register in the set of base address registers according to resource attributes to form the resource requirements of the device.
[0085] Optionally, the configuration space of connected devices can also record other configuration information of the connected devices, which may include product ID (Device ID, or DID), vendor ID (VID), device type, etc. Based on this other configuration information, identification information for the connected devices can be constructed for identification in the requirements database deployed on the management controller.
[0086] Optionally, the field at the first specified location in the base address register (e.g., the lower four bits) can be used to determine the type of the required resource (e.g., I / O or memory). The field at the second specified location in the base address register (e.g., the higher four bits) can be used to determine the resource's bit width and prefetch mode. Based on the resource attribute information parsed from the base address register, the resource information indicated in a set of base address registers of the connected devices is classified and summarized to obtain the resource information of the connected devices. Resource attributes may include resource type, resource bit width, and whether prefetching is required, etc.
[0087] For example, suppose three PCIe devices are connected to the server: a graphics card, a network card, and a storage controller. The BIOS will traverse the configuration space of these three devices, reading their BARs information. This information contains important parameters such as the starting address range of the resources required by the devices. Based on the initial configuration information read in the previous step, the BIOS will classify the resources indicated by the base address register according to their attributes, such as distinguishing between I / O resources and MMIO resources, and whether they are prefetchable. The BIOS analyzes the BARs of the graphics card, network card, and storage controller to identify the I / O resources (such as the I / O ports of the graphics card) and MMIO resources (such as the memory-mapped I / O addresses of the storage controller) of each device. It further distinguishes between prefetchable and non-prefetchable resources and stores the parsed resource types into the corresponding variables or data structures, such as BarIO16 (16-bit I / O base address), BarIO32 (32-bit I / O base address), BarMmio32 (32-bit non-prefetch memory-mapped I / O base address), BarMmio32pf (32-bit prefetch memory-mapped I / O base address), BarMmio64 (64-bit non-prefetch memory-mapped I / O base address), and BarMmio64pf (64-bit prefetch memory-mapped I / O base address).
[0088] In one example, to better understand the verification process of the embodiments of this application, an example is given, such as... Figure 3As shown, the BMC receives a specified command (such as an OEM IPMI command), parses the start flag (such as the header) of the specified command, and parses the fields (such as multiple specified fields) of the specified command in sequence if the start flag meets the specified conditions (such as MMIO). If the management controller determines that the specified command is valid, it forwards the specified command to the basic input / output system through the management controller (such as the BMC) and triggers an interrupt handling process. The management controller receives the return result from the basic input / output system and determines whether the return result is 00 (i.e., configuration successful), that is, the return status value (i.e., 00) + current option value + default value; if the return result is 10 (i.e., the BIOS recognizes the command is invalid), it returns 02, i.e., data invalid; if the return result is not 10, it returns 03, i.e., interaction error. If the start flag does not meet the specified conditions (such as MMIO), it returns 01, i.e., header error; if the management controller confirms that the instruction indication of the specified command is invalid, it returns 02, i.e., data invalid.
[0089] Through the above embodiments, the BMC, via the newly added OEM IPMI command, allows for remote configuration of MMIO resource allocation modes, enabling flexible adjustment of resource allocation strategies for corresponding PCIe ports to adapt to the needs of different devices. By distinguishing between CPU number, interface number, and PCIe bandwidth group index, the BMC can set resource allocation modes for specific ports and bandwidth groups of specific devices, achieving highly granular control. The BMC communicates with the BIOS via the IPMI protocol, simplifying the process of setting device resource allocation modes. By setting the MMIO allocation mode on the BMC side, compatibility issues caused by incorrect resource attribute settings in device firmware can be overcome, ensuring that all devices, regardless of their firmware maturity, can obtain the correct MMIO resources as needed, thereby enhancing the overall functionality of the system. By avoiding operating system-level problems caused by resource attribute mismatches, such as resource conflicts and data transmission verification errors, system stability and device operational reliability are improved.
[0090] In this embodiment, by summarizing the initial configuration information of the base address register according to resource attributes, the resource requirements of the device can be formed, which facilitates the formulation of resource allocation strategies and ensures the accuracy of resource allocation.
[0091] In one exemplary embodiment, the resource configuration information includes a resource configuration mode for connected devices. Based on the resource configuration information and the resource information of connected devices among multiple connected devices, allocating specified resources to connected devices among multiple connected devices includes: when the resource configuration mode is a first mode, configuring specified resources for connected devices among multiple connected devices based on the resource information of connected devices among multiple connected devices; when the resource configuration mode is a second mode, updating the resource information of connected devices among multiple connected devices according to the resource configuration information to obtain updated resource information of connected devices among multiple connected devices, and configuring specified resources for connected devices among multiple connected devices.
[0092] It should be noted that resource configuration information refers to the set of rules used in the basic input / output system to allocate resources to connected devices, which can be implemented through a specific option value, such as the MMIO Set Mode option value.
[0093] The first mode can be the default value mode. When the resource configuration mode is in the first mode, configuring specified resources for multiple connected devices based on their resource information can include: comparing the specified default value with the resource attributes (such as prefetching) in the resource information of the multiple connected devices; if differences exist in resource attributes, updating the resource information of the differing connected devices with the specified default value, thereby allocating the specified resources to the connected devices according to the specified default value. The specified default value can be determined based on a demand database deployed on the management controller.
[0094] Optionally, in the first mode, the size of the specified resource that the resource information indicates prefetching is greater than the size of the specified resource that the resource information indicates is not prefetched. The specified resource can be an MMIO resource.
[0095] The second mode can be a non-default mode, which can allocate resources through the management controller and the basic input / output system, and can allocate resources to specified connected devices based on actual experience.
[0096] Optionally, the basic input / output system can read specified option values from a specified storage area to determine the resource allocation mode for each connected device. Specifically, a specified array can be added, and a specified function (such as the getVariable function) can be used to retrieve the current value of the specified option for each interface recorded in the specified accessor, and that value can be assigned to a specified numeric value.
[0097] This embodiment demonstrates how different resource configuration modes can be differentiated to flexibly address the resource needs of different devices, thereby improving the flexibility and efficiency of resource allocation.
[0098] In one exemplary embodiment, the resource configuration information further includes a configuration strategy corresponding to the resource configuration mode; the second mode includes a third mode and a fourth mode; updating the resource information of the connected devices of the multiple connected devices according to the resource configuration information includes: when the resource configuration mode is the third mode, extracting first specified resource information from the resource information of the connected devices of the multiple connected devices; using the configuration strategy corresponding to the third mode to reduce the base address space indicated by the first specified resource information to update the base address information indicated by the first specified resource information; when the resource configuration mode is the fourth mode, extracting second specified resource information from the resource information of the connected devices of the multiple connected devices, and using the configuration strategy corresponding to the fourth mode to increase the base address space indicated by the second specified resource information to update the base address information indicated by the second specified resource information.
[0099] It should be noted that the resource configuration information may include not only mode identifiers but also resource configuration strategies corresponding to different modes. The second mode may include the third and fourth modes. In the third mode, the base address space indicated by the first specified resource information is reduced to decrease the size of the specified resource allocated by the first specified resource information; in the fourth mode, the base address space indicated by the second specified resource information is increased to increase the size of the specified resource allocated by the second specified resource information. The first and second specified resource information can be resources to be updated in the resource information of connected devices. Optionally, in practice, when the resource configuration mode is the third mode, some information in the resource information of the connected device may conform to the third mode; therefore, resource information that does not conform to the third mode can be extracted to obtain the first specified resource information. Similarly, when the resource configuration mode is the fourth mode, some information in the resource information of the connected device may conform to the fourth mode; therefore, resource information that does not conform to the fourth mode can be extracted to obtain the second specified resource information.
[0100] Optionally, in the third mode (such as MMIOL mode), if the resource information of a connected device includes BarMmio64 and BarMmio64pf (i.e., the first specified resource information), BarMmio64 can be updated to BarMmio32, and BarMmio64pf can be updated to BarMmio32pf. Specifically, the base address information indicated by the first specified resource information is updated by reducing the base address space corresponding to the first specified resource information.
[0101] Similarly, in the fourth mode (such as MMIOH mode), if the resource information of a connected device includes BarMmio32 and BarMmio32pf (i.e., the second specified resource information), BarMmio32 can be updated to BarMmio64, and BarMmio32pf can be updated to BarMmio64pf. Specifically, this is achieved by increasing the base address space corresponding to the second specified resource information, thereby updating the base address information indicated by the second specified resource information.
[0102] Optionally, a resource lookup table can be set up, which can contain the correspondence between resource information indicated by different base address registers and resource sizes, to allocate specified resources of corresponding sizes to connected devices. Specifically, BarMmio32 can be configured to request MMIO resources within a first specified range, and BarMmio64 can be configured to request MMIO resources within a second specified range. The maximum value of the first specified range is less than or equal to the minimum value of the second specified range. For example, the maximum value of the first specified range can be 4G (e.g., 1-4G); the minimum value of the second specified range can be 4G.
[0103] Optionally, a performance requirement model for external devices can be deployed on the electronic device. This model can be a pre-trained machine learning model, such as a decision tree, neural network, or support vector machine. The model can be trained based on the identification information of connected devices and their actual performance requirements across different types of electronic devices. The trained performance requirement model is then deployed to the electronic device. The identification information of the connected devices, the type of the electronic device, and the historical performance data of the connected devices (i.e., their previous performance data on that electronic device) are input into the pre-trained performance requirement model to determine the resource requirements of the same connected device (which may have the same device identifier or be of the same type). This updates the resource configuration information for use the next time the electronic device starts. Furthermore, the performance requirement model is updated based on the real-time performance data of the connected devices after resource adjustments, thereby improving the accuracy of resource allocation for connected devices.
[0104] Alternatively, the performance requirement model can be deployed in an electronic device, or in the basic input / output system of the electronic device, or in a management controller.
[0105] Of course, a priority order can be set, with resource configuration information triggered by resource requirements output by a pre-trained performance requirement model having a lower priority than configuration commands executed via the management controller. Alternatively, it can also have a lower priority than configuration directly through the configuration interface of the basic input / output system.
[0106] Through this embodiment, resource allocation can be adjusted on demand by updating resource information based on configuration strategies, thereby improving the flexibility and efficiency of resource allocation.
[0107] In one exemplary embodiment, before obtaining resource configuration information, the above method further includes:
[0108] In response to the configuration information update command, the resource configuration information is updated. The configuration information modification command is generated by modifying the option values of the resource configuration in the specified directory of the configuration page of the basic input / output system, or by generating it through an external configuration tool based on the identifier corresponding to the option value of the resource configuration.
[0109] Optionally, when the electronic device is powered on, a basic input / output system configuration interface (such as the BIOS SETUP interface) can be accessed. This interface allows setting a specific directory (e.g., starting with socket configuration, delving into MMIO configuration, and then refining to the specific configuration of each socket to determine the configuration of specific ports and resources under a particular processor), and finding a specific option under that target (e.g., a specified resource setting option, MMIO Set Mode). By adjusting this option value, the corresponding resource configuration information (e.g., resource configuration mode) can be changed. Of course, this option value can also include the corresponding processor number, the corresponding specified port number, and the corresponding bandwidth number.
[0110] A unique identifier can be formed by setting each corresponding numeric type in the option value to an adjustable array, such as the corresponding naming format MMIOSetModeXXX, where XXX is (n+1)*(n1+1)*(index+1), n+1 can represent the corresponding processor number, n1+1 can represent the corresponding specified port number, and index+1 can represent the corresponding bandwidth number.
[0111] Alternatively, option values can be modified using a command-line tool (System Configuration Editor, SCE) within the electronic device's operating system or shell environment. Alternatively, the option value can be read from the BMC and modified using a remote device management tool (such as Redfish, a standard or interface for data center device management). After modifying the option value, restarting the electronic device's system will make the changes take effect.
[0112] In this embodiment, the MMIO Set Mode option in the server BIOS is modified through three main methods to adapt to the resource allocation requirements of different PCIe devices: manual modification directly in the BIOS SETUP interface, suitable for direct on-site operation; modification using the SCE tool in the operating system or shell environment, supporting remote command-line operation and automated deployment; and adjustment via the Redfish tool in a web interface, providing a remote graphical management method for intuitive operation.
[0113] In one example, to better understand the processing flow between modules in the electronic device in the embodiments of this application, you can refer to... Figure 4 This illustrates a schematic diagram of the processing interaction of an optional resource in an embodiment of this application. For example... Figure 4 As shown, the electronic device includes a management controller (such as a BMC), a basic input / output system (such as a BIOS), a first interface (such as an IPMI interface), a second interface (such as a RESTful API interface), a communication medium, a communication interface layer, a communication protocol layer (such as a protocol layer for IPMI commands), and management software (such as IPMI management software).
[0114] Specifically, when the IPMI management software receives a configuration instruction indicating that the server's BIOS options need to be modified, it converts the configuration instruction into a configuration command (based on the instructions generated by IPMI) through the communication protocol layer.
[0115] Upon receiving the configuration command, the BMC parses it to determine if it meets expectations. If so, it forwards the parsed command to the BIOS, communicating via the BIOS's IPMI interface. The BIOS, upon receiving the command, performs corresponding resource allocation policy adjustments or queries based on the command content. This process may involve reading and writing option values from NVRAM. The BIOS returns the processing result to the BMC, which then feeds back the command execution results to the IPMI management software, allowing the user to view the modified or queried results.
[0116] It should be noted that specified commands can also be generated and sent to the Basic Input / Output System (BMC) via the second interface to update option values. To more accurately parse configuration commands transmitted through the communication interface layer, an IPMI command can be registered according to the communication protocol specification for IPMI interaction. Alternatively, the second interface can also receive specified commands from the BMC via the first interface.
[0117] Through the above embodiments, the interaction between the BMC and BIOS enables flexible configuration of MMIO resource attributes for different types of PCIe devices. Even if the device firmware contains incorrect resource attribute declarations, it ensures that the device correctly obtains the required MMIO resources in the system, thereby improving device compatibility and stability. The introduction of IPMI-based management software, along with support for the first and second interfaces, enables remote management and automated configuration of MMIO resources, improving the efficiency of large-scale management in data centers or server clusters. By saving and transmitting settings through the BMC, the MMIO resource allocation strategy is not lost even when devices are replaced or the BIOS is upgraded, reducing the cost and time of repeated settings and lowering maintenance complexity.
[0118] The resource processing method in the embodiments of this application will be explained below with reference to optional examples. In this optional example, Figure 5 This is a flowchart illustrating the resource processing method in this optional example, such as... Figure 5 As shown, taking an electronic device as an example, the process of processing this resource can include the following steps:
[0119] Step 1: Power on the server;
[0120] Specifically, the BIOS begins the self-test and configuration process.
[0121] Step 2: Create a specific array;
[0122] Specifically, the BIOS creates and initializes an array to store the MMIO Set Mode option values. The corresponding format can be MMIOSetModeXXX, where XXX is (n+1)*(n1+1)*(index+1). n+1 can represent the corresponding processor number, n1+1 can represent the corresponding specified port number, and index+1 can represent the corresponding bandwidth number.
[0123] Step 3: Get the current value of the option and assign the current value of the option to the feature array;
[0124] Specifically, the BIOS reads the current value of MMIO SetMode for each PCIe Port from NVRAM using the getVariable function and assigns it to the feature array.
[0125] Step 4: Scan connected devices (such as PCIe devices);
[0126] Step 5: Obtain device information;
[0127] Step 6: parse the device's base address register (BAR register).
[0128] Specifically, all PCIe devices are polled and monitored to read the device's configuration space information, including DID, VID, device type, and initial configuration of the BAR register. Each BAR register is parsed to determine the resource type (I / O or MMIO) and its subtype (e.g., 32-bit or 64-bit, prefetch or non-prefetch).
[0129] Step 7: Determine whether the allocation mode of the connected device is the first mode based on the option value (e.g., whether MMIOSetMode[i] is 0).
[0130] Specifically, if it is the first mode, proceed to step 8; otherwise, proceed to step 9.
[0131] Step 8: Poll the base address register of the connected devices to record the resource type;
[0132] Step 9: Determine whether the allocation mode of the connected device is the third mode (e.g., whether MMIOSetMode[i] is 1).
[0133] Specifically, if it is the third mode, proceed to step 10; if it is not the third mode, proceed to step 11.
[0134] Step 10: Poll the first specified resource information indicated by the base address register of the connected device to update the first specified resource information;
[0135] Specifically, the first specified resource information is recorded as MMIOL type (i.e., the base address space indicated by the first specified resource information is reduced, such as the expected allocation of MMIO resources below 4G).
[0136] Step 11: Poll the second specified resource information indicated by the base address register of the connected device to update the second specified resource information.
[0137] Specifically, the first specified resource information is recorded as MMIOH type (i.e., the base address space indicated by the second specified resource information is increased, such as the expected allocation of more than 4G of MMIO resources).
[0138] Step 12: Allocate corresponding system memory space for each base address register and write the corresponding base address back into the base address register.
[0139] Through this optional example, the B1OS client can intelligently allocate MMIO resources based on the MMIO resource allocation policy of each PCIe port during server startup, improving the optimization of resource allocation. By dynamically parsing and adapting to the base address register information of different devices, the BIOS can intelligently adjust the resource type, resolving compatibility issues caused by incorrect resource attribute settings in device firmware. This effectively avoids system-level problems caused by improper resource allocation, such as resource conflicts, data transmission errors, or device malfunctions, thereby improving the overall system stability and reliability.
[0140] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0141] According to another aspect of the embodiments of this application, a resource processing apparatus is also provided, which can be used to implement the resource processing method provided in the above embodiments, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0142] Embodiments of this application also provide a resource processing apparatus, such as... Figure 6 As shown, the device includes:
[0143] The parsing module 602 is used to parse a set of specified registers indicated by the configuration space information of the connected devices among multiple connected devices during the startup process of the electronic device, so as to obtain the resource information of the connected devices of the multiple connected devices. The multiple connected devices are devices connected to the electronic device through specified interfaces, and the resource information of the connected devices of the multiple connected devices is used to indicate the resource requirements of the corresponding connected devices.
[0144] The acquisition module 604 is used to acquire resource configuration information, wherein the resource configuration information is configured by the basic input / output system in response to a specified command forwarded by the management controller. The resource configuration information is used to indicate the resource configuration policy of the connected devices among multiple connected devices. The specified command is a command executed by the management controller to trigger a specified interrupt process. The specified interrupt process is used to instruct the processor to suspend processing and save the execution state when the processor suspends processing.
[0145] The allocation module 606 is used to allocate specified resources to the connected devices among multiple connected devices based on resource configuration information and resource information of the connected devices among multiple connected devices.
[0146] It should be noted that the parsing module 602 in this embodiment can be used to execute the above step S202, the acquisition module 604 in this embodiment can be used to execute the above step S204, and the allocation module 606 in this embodiment can be used to execute the above step S206.
[0147] Through the embodiments provided in this application, during the startup process of an electronic device, a set of designated registers indicated by the configuration space information of the connected devices among multiple connected devices are parsed to obtain the resource information of the connected devices. The multiple connected devices are devices connected to the electronic device through designated interfaces, and the resource information of the connected devices is used to indicate the resource requirements of the corresponding connected devices. Resource configuration information is obtained, wherein the resource configuration information is configured by the basic input / output system in response to a designated command forwarded by the management controller. The resource configuration information is used to indicate the resource configuration strategy of the connected devices among the multiple connected devices, and the designated command is issued by the management controller. The controller executes commands to trigger specified interrupt procedures, which instruct the processor to pause processing and save the execution state at the time of pause. Based on resource configuration information and resource information of multiple connected devices, specified resources are allocated to the connected devices among the multiple connected devices. This enables the basic input / output system to flexibly adjust resource allocation strategies through the intervention of the management controller, even if the device firmware declaration is incorrect. This solves the problem of resource allocation mismatch caused by misidentification of firmware information in related technologies, improves the accuracy of resource allocation, and enhances system stability by avoiding device function limitations caused by improper resource allocation.
[0148] In one exemplary embodiment, the resource processing apparatus further includes: a first verification module, configured to, in response to a configuration command, perform preliminary verification processing on the configuration command through a management controller to obtain a preliminary verification result before obtaining resource configuration information; a forwarding module, configured to, if the preliminary verification result indicates that the configuration command is valid, execute a specified interruption process and forward the configuration command to the basic input / output system; a second verification module, configured to perform verification processing on the configuration command through the basic input / output system; and an update module, configured to, based on the configuration command, update the configuration indication information of the connected device indicated by the configuration command, so as to update the resource configuration information, if the configuration command verification passes.
[0149] In an exemplary embodiment, the first verification module is further configured to: parse the start identifier of the configuration command through the management controller to obtain the category information of the configuration command; and perform validity verification on the configuration command if the category information of the configuration command meets the specified conditions to obtain the preliminary verification result of the configuration command.
[0150] In an exemplary embodiment, the configuration command includes multiple specified fields, which are ordered in a specified order; the first verification module is further configured to: parse and verify the specified fields in the configuration command sequentially in the specified order; and determine that the configuration command is initially valid if all specified fields in the multiple specified fields meet the specified configuration conditions.
[0151] In one exemplary embodiment, the specified order of the multiple specified fields is, in sequence, a processor field, a specified port field, and a bandwidth field, wherein the specified port indicated in the specified port field is a port connected to the processor in the electronic device; the first verification module is further configured to: identify first specified data of the electronic device through a management controller, wherein the first specified data includes a first processor number set, a first specified port number set, and a first bandwidth level range; determine that the processor field is valid if the processor number indicated by the processor field belongs to the first processor number set; determine that the specified port field is valid if the specified port number indicated by the specified port field belongs to the first specified port number set; and determine that the bandwidth field is valid if the bandwidth level indicated by the bandwidth field is within the first bandwidth level range.
[0152] In one exemplary embodiment, the second verification module is further configured to: identify second specified data of an electronic device via a basic input / output system, wherein the second specified data includes a second set of processor numbers and a second set of specified port numbers; determine that the processor field is valid if the processor number indicated by the processor field belongs to the second set of processor numbers; and determine that the specified port field is valid if the specified port number indicated by the specified port field belongs to the second set of specified port numbers, thereby determining that the configuration command is valid.
[0153] In one exemplary embodiment, a set of designated registers includes a set of base address registers. The parsing module 602 is further configured to: parse the set of base address registers of the connected devices among the plurality of connected devices to obtain initial configuration information of the set of base address registers; and summarize the initial configuration information of the set of base address registers of the connected devices among the plurality of connected devices according to resource attributes to obtain resource information of the connected devices among the plurality of connected devices.
[0154] In one exemplary embodiment, the resource configuration information includes the resource configuration mode of the connected devices. The allocation module 606 is further configured to, when the resource configuration mode is a first mode, configure specified resources for the connected devices among the multiple connected devices based on the resource information of the connected devices; and when the resource configuration mode is a second mode, update the resource information of the connected devices among the multiple connected devices according to the resource configuration information to obtain updated resource information of the connected devices among the multiple connected devices, and then configure specified resources for the connected devices among the multiple connected devices.
[0155] In one exemplary embodiment, the resource configuration information further includes a configuration strategy corresponding to the resource configuration mode; the second mode includes a third mode and a fourth mode. The allocation module 606 is further configured to: extract first specified resource information from the resource information of connected devices of multiple connected devices when the resource configuration mode is the third mode; reduce the base address space indicated by the first specified resource information using the configuration strategy corresponding to the third mode to update the base address information indicated by the first specified resource information; and extract second specified resource information from the resource information of connected devices of multiple connected devices when the resource configuration mode is the fourth mode; increase the base address space indicated by the second specified resource information using the configuration strategy corresponding to the fourth mode to update the base address information indicated by the second specified resource information.
[0156] For a description of the features in the embodiment corresponding to the resource processing apparatus, please refer to the relevant description in the embodiment corresponding to the resource processing method, which will not be repeated here.
[0157] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above-described resource processing method embodiments.
[0158] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described resource processing method embodiments at runtime.
[0159] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0160] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described resource processing method embodiments.
[0161] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described resource processing method embodiments.
[0162] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0163] The resource processing method and electronic device provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A method for processing resources, characterized in that, include: During the startup process of an electronic device, a set of designated registers indicated by the configuration space information of the connected devices among multiple connected devices are parsed to obtain the resource information of the connected devices of the multiple connected devices. The multiple connected devices are devices connected to the electronic device through a designated interface, and the resource information of the connected devices of the multiple connected devices is used to indicate the resource requirements of the corresponding connected devices. Obtain resource configuration information, wherein the resource configuration information is configured by the basic input / output system in response to a specified command forwarded by the management controller, the resource configuration information is used to indicate the resource configuration policy of the connected devices among the plurality of connected devices, the specified command is a command executed by the management controller to trigger a specified interrupt process, the specified interrupt process is used to instruct the processor to suspend processing and save the execution state of the processor when it suspends processing; Based on the resource configuration information and the resource information of the connected devices among the multiple connected devices, the specified resources are allocated to the connected devices among the multiple connected devices; The resource configuration information includes the resource configuration mode of connected devices. The step of allocating specified resources to connected devices among the multiple connected devices based on the resource configuration information and the resource information of the multiple connected devices includes: When the resource configuration mode is the first mode, the specified resource is configured for the connected device among the multiple connected devices based on the resource information of the connected devices among the multiple connected devices; When the resource configuration mode is the second mode, the resource information of the connected devices of the plurality of connected devices is updated according to the resource configuration information to obtain the updated resource information of the connected devices among the plurality of connected devices, so as to configure the specified resource for the connected devices among the plurality of connected devices.
2. The method according to claim 1, characterized in that, Before obtaining the resource configuration information, the method further includes: In response to the configuration command, the management controller performs a preliminary verification process on the configuration command to obtain a preliminary verification result. If the preliminary verification result indicates that the configuration command is valid, the specified interrupt procedure is executed, and the configuration command is forwarded to the basic input / output system; The configuration command is validated using the basic input / output system. If the configuration command passes verification, the configuration indication information of the connected device indicated by the configuration command is updated based on the configuration command, so as to update the resource configuration information.
3. The method according to claim 2, characterized in that, The preliminary verification process of the configuration command through the management controller to obtain the preliminary verification result includes: The management controller parses the start identifier of the configuration command to obtain the category information of the configuration command. If the category information of the configuration command meets the specified conditions, the configuration command is subjected to validity verification processing to obtain the preliminary verification result of the configuration command.
4. The method according to claim 3, characterized in that, The configuration command includes multiple specified fields, and the specified fields are sorted in a specified order. The step of performing validity verification on the configuration command to obtain a preliminary verification result of the configuration command includes: The specified fields in the configuration command are parsed and verified sequentially according to the specified order. If all specified fields among the specified fields meet the specified configuration conditions, the configuration command is determined to be initially effective.
5. The method according to claim 4, characterized in that, The specified order of the plurality of specified fields is, in order, processor field, specified port field, and bandwidth field, wherein the specified port indicated in the specified port field is the port connected to the processor in the electronic device; The step of parsing and verifying the specified fields in the configuration command in the specified order includes: The management controller identifies first specified data of the electronic device, wherein the first specified data includes a first processor number set, a first specified port number set, and a first bandwidth level range; If the processor number indicated by the processor field belongs to the first set of processor numbers, the processor field is determined to be valid; If the specified port number indicated by the specified port field belongs to the first specified port number set, the specified port field is determined to be valid; If the bandwidth level indicated by the bandwidth field is within the range of the first bandwidth level, the bandwidth field is determined to be valid.
6. The method according to claim 5, characterized in that, The step of verifying the configuration command through the basic input / output system includes: The basic input / output system identifies second specified data of the electronic device, wherein the second specified data includes a second processor number set and a second specified port number set; If the processor number indicated by the processor field belongs to the second set of processor numbers, the processor field is determined to be valid; If the specified port number indicated by the specified port field belongs to the second specified port number set, the specified port field is determined to be valid, thereby determining that the configuration command is valid.
7. The method according to claim 1, characterized in that, The set of designated registers includes a set of base address registers. Parsing the set of designated registers indicated by the configuration space information of the connected devices among the multiple connected devices yields the resource information of the connected devices, including: The initial configuration information of the set of base address registers of the connected devices among the plurality of connected devices is obtained by parsing the set of base address registers. The initial configuration information of the set of base address registers of the connected devices among the plurality of connected devices is summarized according to resource attributes to obtain the resource information of the connected devices among the plurality of connected devices.
8. The method according to claim 1, characterized in that, The resource configuration information also includes the configuration strategy corresponding to the resource configuration mode; the second mode includes a third mode and a fourth mode; The step of updating the resource information of the connected devices of the plurality of connected devices according to the resource configuration information includes: When the resource configuration mode is the third mode, first specified resource information is extracted from the resource information of the connected devices of the plurality of connected devices; the configuration strategy corresponding to the third mode is used to reduce the base address space indicated by the first specified resource information in order to update the base address information indicated by the first specified resource information. When the resource configuration mode is the fourth mode, the second specified resource information is extracted from the resource information of the connected devices of the plurality of connected devices; the configuration strategy corresponding to the fourth mode is used to increase the base address space indicated by the second specified resource information to update the base address information indicated by the second specified resource information.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the processing method for the resource as claimed in any one of claims 1 to 8.
Citation Information
Patent Citations
Information processing method and device, electronic equipment and storage medium
CN117687695A
Resource configuration method and device
CN118450517A