Register control method, system, device, computer equipment and storage medium

Controlling the CPU pin to enter SMM mode through the BMC allows the BIOS to modify all registers under SMM, solving the problem of inflexible server register access, improving register modification and control efficiency, and being independent of the operating system.

CN114168196BActive Publication Date: 2024-09-17SUMA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111375350.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2024-09-17
Estimated Expiration
2041-11-19

AI Technical Summary

Technical Problem

In the existing technology, the server's access mechanism to different registers is inflexible, resulting in low efficiency of register modification and control. In particular, the MCA register can only be accessed in BIOS through SMM mode, and the operating system cannot directly access it, and the access permissions of different registers are inconsistent. , affecting the overall performance of the server.

Method used

Receive register operation instructions through the BMC, control the pin level status between the CPU and the BMC to enter the SMM mode, allowing the BIOS to modify the target register under SMM, achieving flexible access and control of all registers, independent of the operating system.

Benefits of technology

It achieves flexible access and control of all registers, ensuring that registers can be accessed even when the operating system is abnormal, improving the efficiency of register modification and control of the server, and reducing dependence on the operating system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114168196B
    Figure CN114168196B
Patent Text Reader

Abstract

The present application relates to a register control method, system, device, computer equipment and storage medium. The method includes: BMC receives register operation instructions, wherein the register operation instruction carries the identification of the target register, and when the operation instruction is a modification instruction, BMC controls the level state of the connection pin between BMC and CPU to open the system management mode SMM, and when in SMM, BMC sends a register modification instruction carrying the identification of the target register to BIOS, so that BIOS performs corresponding modification operations on the target register according to the identification of the target register. In this scheme, BMC triggers the server to enter the system management mode SMM by controlling the pin level, so that in SMM mode, direct modification of ordinary registers and / or MCA registers is realized, and the control of all registers is more flexible, and does not rely on the operating system OS, so that it can ensure that the registers can be accessed when the OS fails to log in due to an abnormality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a register control method, system, device, computer equipment and storage medium. Background Art

[0002] There are a large number of registers in server hardware, which are roughly divided into CPU internal registers and peripheral registers according to type. These registers are used to control the behavior of the hardware. The CPU internal registers are stored inside the CPU and can be divided into Machine Check Architecture (MCA) registers and other CPU registers. The server enables the Platform First Error Handling (PFEH) function by default. Under this function, the MCA registers can only be accessed by the Basic Input Output System (BIOS) in System Management Mode (SMM) mode, and SMM is invisible to the operating system. Therefore, in SMM mode, the operating system (OS) cannot access the MCA registers. However, other CPU registers and peripheral registers can be accessed without entering SMM mode, so both BIOS and OS can access them.

[0003] The access restrictions of the above-mentioned MCA registers, as well as the inconsistency of the access rights of the MCA registers with other CPU registers and peripheral registers, will cause many problems in the scenario of register modification. For example, if you want to modify the MCA registers, you need to have the BIOS actively trigger the System Management Interrupt (SMI) during the server startup process to enter the SMM mode to modify the MCA registers. If the server is fully powered on and enters the OS, the MCA registers cannot be modified; or, for example, if you want to modify peripheral registers or other CPU registers, you need to wait until the server is fully powered on and enters the OS before you can modify them through the corresponding tools in the OS.

[0004] The access mechanism of different registers in the prior art makes it inflexible and inconvenient for the server to access different registers, thereby affecting the efficiency of the server in modifying and controlling the registers. Summary of the invention

[0005] Based on this, it is necessary to provide a register control method, system, device, computer equipment and storage medium for flexibly accessing different types of registers in response to the above technical problems.

[0006] In a first aspect, a register control method is provided, the method comprising:

[0007] The BMC receives a register operation instruction; the register operation instruction carries an identifier of a target register;

[0008] When the operation instruction is a modification instruction, the BMC turns on the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU;

[0009] In the case of SMM, the BMC sends a register modification instruction carrying an identifier of a target register to the BIOS, so that the BIOS performs a corresponding modification operation on the target register according to the identifier of the target register.

[0010] In this embodiment, the BMC triggers the server to enter the system management mode SMM by controlling the pin level, so that in the SMM mode, both the ordinary registers and the MCA registers can be directly modified, making the control of all registers more flexible, and the control of the registers does not depend on the operating system OS, so that the registers can be accessed even if the OS fails to log in due to an abnormality.

[0011] In one of the optional embodiments, when the operation instruction is a modification instruction, the BMC starts the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU, including:

[0012] The BMC sets a level of a target pin connected to the CPU to a preset level to turn on the SMM; the target pin is connected to a pin of the BMC.

[0013] In this embodiment, by connecting the designated pin of the BMC to the target pin of the CPU, the BMC can control the level state of the target pin of the CPU. Since the BIOS can pre-set the target pin of the CPU to trigger the start of SMM through the level state, the BMC can start SMM by controlling the level state of the target pin of the CPU, thereby realizing access to all registers in the SMM mode, making the access to the registers more flexible.

[0014] In one of the optional embodiments, if the modification instruction includes a target value of the target register, the method further includes:

[0015] According to the identifier and the target value of the target register, the current value of the target register in the register information table in the BMC is updated to obtain an updated register information table.

[0016] In this embodiment, the BMC can implement local modification and reading of register information based on the register information table, thereby optimizing the control operation of the register.

[0017] In one of the optional embodiments, the method further comprises:

[0018] According to the identifier of the target register, the update flag bit of the target register in the register flag table in the BMC is set to a first value to obtain an updated register flag table; the first value is used to indicate that the register is in a modifiable state.

[0019] In this embodiment, whether the register is modifiable is indicated based on the register flag table, so that the current status of all registers can be centrally and conveniently indicated, the control process of the registers can be optimized, and the interaction resources between the BIOS and the BMC can be reduced.

[0020] In one of the optional embodiments, when in SMM, the BMC sends a register modification instruction carrying an identifier of a target register to the BIOS, so that the BIOS performs a corresponding modification operation on the target register according to the identifier of the target register, including:

[0021] In the case of SMM, the BMC sends register modification instructions to the BIOS;

[0022] In response to a first acquisition request sent by the BIOS after receiving the register modification instruction, sending a register flag table to the BIOS so that the BIOS determines a target register according to the register flag table;

[0023] In response to a second acquisition request sent after the BIOS determines the target register, sending a target value of the target register to the BIOS, so that the BIOS modifies the target register according to the target value and obtains an actual value of the target register;

[0024] Receive the actual value of the target register returned by the BIOS, and update the current value of the target register in the register information table according to the actual value;

[0025] Returns a register modification completion response to the BIOS.

[0026] In this embodiment, after entering the SMM mode, the BMC can independently interact with the operating system OS and the BIOS to implement register modification operations through the BIOS, making access to all registers more flexible.

[0027] In one of the optional embodiments, the method further comprises:

[0028] In response to the BIOS receiving the register flag reset request sent in the register modification completion response, all update flag bits in the register flag table are set to a second value, where the second value indicates that the register is in an unmodifiable state.

[0029] In this embodiment, after the BIOS modifies the register, the update flag bits in the register flag table in the BMC are reset in time, so that it can be determined in time that the current register modification operation has been completed, so as to release the corresponding control resources and storage space.

[0030] In one of the optional embodiments, the method further comprises:

[0031] When the operation instruction is a read instruction, according to the identifier of the target register in the read instruction, the current value corresponding to the target register is obtained from the register information table;

[0032] Display the current value of the target register in the user interface.

[0033] In this embodiment, the BMC can implement local modification and reading of register information based on the register information table, thereby optimizing the control operation of the register.

[0034] In one of the optional embodiments, the method further comprises:

[0035] Receive the actual value of the register of the preset type sent by BIOS;

[0036] A register information table is constructed based on the actual value of each register and the identifier of each register.

[0037] In this embodiment, the BMC can construct a register information table according to the actual value of each register sent by the BIOS for use when modifying local information, thereby improving the convenience of register modification.

[0038] In a second aspect, a register control method is provided, the method comprising:

[0039] The BIOS receives the register modification instruction sent by the BMC; the register modification instruction is an instruction sent by the BMC to start the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU after receiving the register operation instruction and determining that the operation instruction is a modification instruction;

[0040] The BIOS determines a target register according to the register modification instruction and performs a modification operation on the target register.

[0041] In this embodiment, the BMC triggers the server to enter the system management mode SMM by controlling the pin level. In the SMM mode, the BMC can interact with the BIOS to directly modify both the ordinary registers and the MCA registers, making the control of all registers more flexible. Moreover, the control of the registers does not depend on the operating system OS, so that the registers can be accessed even if the OS fails to log in due to an abnormality.

[0042] In one of the optional embodiments, after the BIOS receives the register modification instruction sent by the BMC, the method further includes:

[0043] If the BIOS determines that the pin at the preset level is the target pin of the CPU, the steps of determining the target register according to the register modification instruction and performing a modification operation on the target register are executed.

[0044] In this embodiment, the BIOS performs secondary verification on the pins at the preset level to further confirm that the target pins are at the preset level state, thereby triggering interaction with the BMC to implement the register modification operation, thereby improving the accuracy of register control.

[0045] In one of the optional embodiments, the BIOS determines the target register according to the register modification instruction, and performs a modification operation on the target register, including:

[0046] In response to the register modification instruction, the BIOS sends a register flag table acquisition request to the BMC;

[0047] receiving a register flag table returned by the BMC in response to a request to obtain a register flag table, and determining a target register according to the register flag table;

[0048] A request to obtain a target value carrying the identifier of the target register is sent to the BMC;

[0049] The target value returned by the BMC in response to the target value acquisition request is received, and the target register is modified according to a preset register mapping table to obtain the modified actual value of the target register; the preset register mapping table is constructed according to the actual value of the register, the preset register access address, and the preset register access method.

[0050] In this embodiment, after entering the SMM mode, the BMC can independently interact with the operating system OS and the BIOS to implement register modification operations through the BIOS, making access to all registers more flexible.

[0051] In one of the optional embodiments, the method further comprises:

[0052] Get the actual value of the target register and send the actual value to the BMC.

[0053] In this embodiment, the BIOS can read the actual value of the register and send it to the BMC in various scenarios. The BMC can update the value of the register in the local storage space according to the actual value of the register obtained, thereby optimizing the control process of the BMC register and making the access to the register more flexible.

[0054] In one of the optional embodiments, determining the target register according to the register flag table includes:

[0055] The register flag table is traversed to determine that the register whose update flag bit is the first value in the register flag table is the target register; the first value indicates that the register is in a modifiable state.

[0056] In this embodiment, the BIOS determines the target register by traversing the register flag table, and can quickly determine the number and serial number of the registers that need to be modified, thereby obtaining the corresponding target value based on the determined target register, and can achieve rapid access modification to the register.

[0057] In one of the optional embodiments, the method further comprises:

[0058] receiving a register modification completion response sent by the BMC after modifying the register information table according to the actual value;

[0059] A register flag reset request is sent to the BMC, so that the BMC sets all update flag bits in the register flag table in the BMC to a second value; the second value indicates that the register is in an unmodifiable state.

[0060] In this embodiment, after the BIOS modifies the register, the update flag bits in the register flag table in the BMC are reset in time, so that it can be determined in time that the current register modification operation has been completed, so as to release the corresponding control resources and storage space.

[0061] In one of the optional embodiments, the method further comprises:

[0062] After sending a register flag reset request to the BMC, exit SMM.

[0063] In this embodiment, after the BIOS sends a register flag reset request to the BMCBMC, if it is determined that there is no register that needs to be modified, the SMM is exited in time, so that the corresponding register control resources and computing resources can be released.

[0064] In one of the optional embodiments, the method further comprises:

[0065] The target pin of the CPU connected to the BMC is set to trigger the start of the system management mode SMM when it is at a preset level.

[0066] In this embodiment, the BIOS triggers the start of SMM when setting the target pin of the CPU to a preset level, so that the BMC can trigger the server to enter SMM by controlling the level state of the target pin of the CPU, thereby achieving access to all types of registers, making the access to registers no longer limited and more flexible.

[0067] In a third aspect, a register control system is provided, which is applied to a server, and the system includes a CPU and a BMC;

[0068] The first target pin of the CPU is used as an input terminal; the second target pin of the BMC is used as an output terminal; the first target pin is connected to the second target pin; and the first target pin triggers the server to start the system management mode SMM at a preset level.

[0069] In a fourth aspect, a register control device is provided, the device comprising:

[0070] A receiving module, used for receiving a register operation instruction; the register operation instruction carries an identifier of a target register;

[0071] The control module is used to start the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU when the operation instruction is a modification instruction;

[0072] The sending module is used to send a register modification instruction carrying an identifier of a target register to the BIOS when in SMM, so that the BIOS performs a corresponding modification operation on the target register according to the identifier of the target register.

[0073] In a fifth aspect, a register control device is provided, the device comprising:

[0074] The receiving module is used to receive the register modification instruction sent by the BMC; the register modification instruction is an instruction sent by the BMC to start the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU after receiving the register operation instruction and determining that the operation instruction is a modification instruction;

[0075] The processing module is used to determine the target register according to the register modification instruction and perform a modification operation on the target register.

[0076] In a sixth aspect, a computer device is provided, comprising a basic input system BIOS, a baseboard management controller BMC, a central processing unit CPU and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, any method described in the first aspect or the second aspect is implemented.

[0077] In a seventh aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in any one of the first and second aspects above is implemented.

[0078] In the register control method, device, computer equipment and storage medium, the BMC receives the register operation instruction, wherein the register operation instruction carries the identifier of the target register. When the operation instruction is a modification instruction, the BMC controls the level state of the connection pin between the BMC and the CPU to open the system management mode SMM. When in SMM, the BMC sends a register modification instruction carrying the identifier of the target register to the BIOS, so that the BIOS performs the corresponding modification operation on the target register according to the identifier of the target register. In this solution, the BMC triggers the server to enter the system management mode SMM by controlling the pin level, so that in the SMM mode, the BMC can interact with the BIOS to realize direct modification of both ordinary registers and MCA registers, making the control of all registers more flexible, and the control of the registers does not depend on the operating system OS, so that it can ensure that the registers can be accessed when the OS fails to log in due to an abnormality. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] Figure 1 An application environment diagram of a register control method in an embodiment;

[0080] Figure 2 is a flow chart of a register control method in another embodiment;

[0081] Figure 3 is a flow chart of a register control method in another embodiment;

[0082] Figure 4 is a flow chart of a register control method in another embodiment;

[0083] Figure 5 is a flow chart of a register control method in another embodiment;

[0084] Figure 6 is a flow chart of a register control method in another embodiment;

[0085] Figure 7A schematic diagram of the interaction flow between BIOS and BMC in a register control method in another embodiment;

[0086] Figure 8 A schematic diagram of a flow chart of a register control system in one embodiment;

[0087] Fig. 9 is a structural block diagram of a register control device in another embodiment;

[0088] Fig.10 is a structural block diagram of a register control device in another embodiment;

[0089] Fig.11 is a structural block diagram of a register control device in another embodiment;

[0090] Fig.12 is a structural block diagram of a register control device in another embodiment;

[0091] Fig.13 is a structural block diagram of a register control device in another embodiment;

[0092] Fig.14 is a structural block diagram of a register control device in another embodiment;

[0093] Fig.15 is a structural block diagram of a register control device in another embodiment;

[0094] Fig.16 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0095] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0096] The register control method provided in this application can be applied to Figure 1In the application environment shown in the figure, the Basic Input Output System (BIOS) communicates with the Baseboard Management Controller (BMC) through the Keyboard Controller Style (KCS) interface protocol. BIOS is the first program after the computer system is started, responsible for the computer system self-test (Power On Self Test, POST), and initializing the CPU, memory, high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCIE), hard disk and other devices. BIOS can collect the server's asset information, including detailed model parameters of devices such as CPU, memory, PCIE, and hard disk. BMC is a dedicated chip integrated on the motherboard. The BMC firmware runs on the BMC chip and is a small operating system independent of the server system. The server uses BMC for large-scale unattended operations, including remote management, monitoring, installation, and restart of the server. BMC usually supports a visual WEB UI, which can display the server's asset information to users on the WEB UI, including detailed model parameters of devices such as CPU, memory, PCIE, and hard disk. Users can easily understand the configuration of the server by viewing the WEB UI. The BIOS and BMC interact through the IPMI interface. The BIOS collects the asset information data of the server and then sends the asset information data to the BMC through the IPMI interface.

[0097] The present application provides the register control method based on the above technical background. First, the first pin of the BMC is set to be connected to the specific GPIO Pin of the CPU. The first pin of the BMC refers to a designated pin among the many GPIO Pins of the BMC, and the connection with the specific GPIO Pin of the CPU is realized based on the designated pin. After the server is turned on and enters the operating system (OS), if the hardware register needs to be modified, a command is sent to the BMC through the debugging host. After receiving the command, the BMC briefly pulls down a specific GPIO Pin of the CPU, thereby triggering a system management interrupt (System Management Interrupt, SMI). In the system management mode (System Management Mode, SMM), the SMI interrupt handler SMI Handler is responsible for modifying the designated register, so that all registers can be modified while the server remains powered on.

[0098] The following will explain in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems through embodiments and in combination with the accompanying drawings. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. It should be noted that the present application Figure 2-Figure 5 The register control method provided in the embodiment is executed by a BMC or a register control device, which can be part or all of the BMC through software, hardware or a combination of software and hardware. In the following method embodiments, the execution subject is BMC as an example for description.

[0099] In one embodiment, Figure 2 As shown, a register control method is provided, comprising the following steps:

[0100] S201. The BMC receives a register operation instruction; the register operation instruction carries an identifier of a target register.

[0101] The register operation instruction may be sent from the debugging host to the BMC, or may be an operation instruction received by the BMC and triggered by the user based on the display interface of the debugging host. The operation instruction may be a register read instruction or a register write instruction, and the write instruction includes a write instruction, a modify instruction, a delete instruction, etc.

[0102] In this embodiment, the register operation instruction carries the identifier of the target register. For example, when the BMC receives a register read instruction, the BMC can read the value of the target register according to the identifier of the target register and feed the value back to the user or the debugging host. Optionally, the operation instruction can also be a register modification instruction. The BMC can modify the value of the target register according to the identifier of the target register, thereby completing the register modification operation, which is not limited in this embodiment.

[0103] S202: When the operation instruction is a modification instruction, the BMC starts the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU.

[0104] The modification instruction refers to the need to modify the value in the target register. Before executing the register control method, a pin in the BMC needs to be connected to a target pin in the CPU, where the target pin of the CPU can be a designated general purpose input / output interface pin (GPIO Pin). The target pin of the CPU can start the server's system management mode SMM in a certain level state and trigger the system management interrupt (SMI) mechanism.

[0105] In this embodiment, when the BMC receives the register modification instruction, the BMC can turn on the system management mode SMM of the server by controlling the connection pin between the BMC and the CPU, that is, controlling the level state of the target pin of the CPU. Optionally, the BMC controls the level state of the target pin of the CPU so that the CPU triggers SMI and switches the server from the protection mode to the SMM mode, so that the BIOS executes the preset modification script SMI Handler. For example, if the target pin is preset to turn on the SMM mode at a low level, the BMC will pull down the level of the target pin of the CPU, and the CPU will trigger SMI when the target pin is at a low level, switching the server from the protection mode to the SMM mode; if the target pin is preset to turn on the SMM mode at a high level, the BMC will pull up the level of the target pin of the CPU, and the CPU will trigger SMI when the target pin is at a high level, switching the server from the protection mode to the SMM mode, which is not limited in this embodiment.

[0106] Further, when the BMC determines that the received instruction is a modification instruction, that is, the debugging host sends the modification instruction to the BMC through the IPMITool, optionally, the instruction of the IPMITool may include at least one of the register modification request SetRegister Command, the sender ID, the target register number, and the target value value corresponding to the target register. Among them, the target register number and the target value may be one or more, so that the BMC modifies the value of the register corresponding to the local register information table according to the target value of the target register. Optionally, the BMC determines that the debug host sends a request Get Register Command to obtain the register value according to the sender ID, and the BMC also needs to modify the value of the update flag bit of the target register in the register flag table according to the target value of the target register.

[0107] S203: In the case of being in SMM, the BMC sends a register modification instruction carrying an identifier of a target register to the BIOS, so that the BIOS performs a corresponding modification operation on the target register according to the identifier of the target register.

[0108] Among them, the register modification instruction sent by the BMC to the BIOS is an instruction for instructing the BIOS to modify the value of the target register. In this embodiment, when the server is in SMM, the purpose of BMC and BIOS interacting to modify the target register is achieved by executing the modification script SMIHandler through BIOS. In the SMI Handler, the BMC will respond to the acquisition request sent by the BIOS and send a register modification instruction carrying the identifier of the target register to the BIOS. After receiving the register modification instruction, the BIOS obtains the identifier of the target register from the BMC according to the instruction, thereby modifying the value of the target register and returning the modified value to the BMC. This embodiment does not limit this.

[0109] In the above register control method, the BMC receives the register operation instruction, wherein the register operation instruction carries the identifier of the target register. When the operation instruction is a modification instruction, the BMC controls the level state of the connection pin between the BMC and the CPU to open the system management mode SMM. When in SMM, the BMC sends a register modification instruction carrying the identifier of the target register to the BIOS, so that the BIOS performs the corresponding modification operation on the target register according to the identifier of the target register. In this solution, the BMC triggers the server to enter the system management mode SMM by controlling the pin level, so that in the SMM mode, it can realize direct modification of both ordinary registers and MCA registers, making the control of all registers more flexible, and the control of registers does not rely on the operating system OS, so that it can ensure that the registers can be accessed when the OS fails to log in due to an abnormality.

[0110] The BMC controls the level state of the pin to trigger the SMM mode. In one optional embodiment, when the operation instruction is a modification instruction, the BMC controls the level state of the connection pin between the BMC and the CPU to start the system management mode SMM, including:

[0111] The BMC sets a level of a target pin connected to the CPU to a preset level to turn on the SMM; the target pin is connected to a pin of the BMC.

[0112] The preset level may be a high level or a low level. In this embodiment, the mechanism for the CPU target level to trigger the start of SMM in a preset level state may be set by the BIOS in the initialization phase, so that the BMC can achieve the purpose of triggering the start of SMM by controlling the level state of the CPU target pin. For example, if the preset level is a low level, the BMC only needs to pull down the level of the CPU target pin to trigger the start of SMM. If the preset level is a high level, the BMC needs to pull up the level of the CPU target pin to trigger SMM.

[0113] In this embodiment, by connecting the designated pin of the BMC to the target pin of the CPU, the BMC can control the level state of the target pin of the CPU. Since the BIOS can pre-set the target pin of the CPU to trigger the start of SMM through the level state, the BMC can start SMM by controlling the level state of the target pin of the CPU, thereby realizing access to all registers in the SMM mode, making the access to the registers more flexible.

[0114] After receiving the register modification instruction, the BMC may modify the current value in the locally stored register information table according to the target value of the register. In one optional embodiment, if the modification instruction includes the target value of the target register, the method further includes:

[0115] According to the identifier and the target value of the target register, the current value of the target register in the register information table in the BMC is updated to obtain an updated register information table.

[0116] Optionally, in one embodiment, the register information table is constructed in the following manner:

[0117] The actual value of the register of the preset type sent by the BIOS is received, and a register information table is constructed according to the actual value of each register and the identifier of each register.

[0118] In this embodiment, the BMC constructs a register information table according to the actual value of each register sent by the BIOS and the number of each register. Exemplarily, the register information table may include two types of fields: a register identifier and a value of a register corresponding to the register. The format of the register information table may refer to the following Table 1:

[0119] Table 1

[0120] Register ID 1 value Register ID 2 value Register ID 3 value ...

[0121] In this embodiment, after constructing the register information table, the BMC can store the register information table in the local storage space. After receiving the register modification instruction, the current value of the target register in the register information table is modified according to the target value of the target register carried in the instruction to update the register information table.

[0122] Optionally, when the BMC receives a register read instruction, Figure 3 As shown, in one of the optional embodiments, the method further includes:

[0123] S301. When the operation instruction is a read instruction, obtain a current value corresponding to the target register from a register information table according to an identifier of the target register in the read instruction.

[0124] In the case where the BMC receives a register read instruction, the BMC can obtain the current value corresponding to the target register from the register information table in the local storage space according to the identifier of the target register. Optionally, the user can send a Get Register Command command to the BMC through the IPMI Tool on the debugging host to obtain the register value, and the BMC obtains the corresponding value from the register information table according to the identifier of the target register. In the Get Register Command request, the identifier of the target register can be carried, and the identifier can be a number.

[0125] Optionally, the BMC can receive a Get Register Command request from the debugging host and return the value of the corresponding target register to the debugging host; the BMC can also receive a Get Register Command request from the BIOS and respond to the request by returning the value of the corresponding target register to the BIOS. Exemplarily, the BMC's response instruction can carry a Completion Code indicating whether the operation is successful and the value of the target register.

[0126] S302: Display the current value of the target register on the user interface.

[0127] In this embodiment, after the BMC obtains the value corresponding to the target register, it returns the value to the debugging host for display in the user interface.

[0128] In this embodiment, the BMC can implement local modification and reading of register information based on the register information table, thereby optimizing the control operation of the register.

[0129] After the BMC determines the target register to be modified, it also needs to update the register flag table according to the target register. In one optional embodiment, the method further includes:

[0130] According to the identifier of the target register, the update flag bit of the target register in the register flag table in the BMC is set to a first value to obtain an updated register flag table; the first value is used to indicate that the register is in a modifiable state.

[0131] The register flag table refers to a table constructed by the BMC during the initialization phase to store the register number and whether the register is modifiable. For example, the register flag table includes each register identifier and the update flag corresponding to each register. The register flag table can be shown in Table 2 below:

[0132] Table 2

[0133] No. 1 No. 2 No. 3 No. 4 No. 5 ... 0 1 0 0 1 ...

[0134] In the register flag table, corresponding to each register identifier (number) is the update flag of each register, wherein each flag can be set to a first value or a second value, wherein the first value can be 1, used to indicate that the register corresponding to the flag is in a modifiable state, or in a state that needs to be modified. The second value can be 0, used to indicate that the register corresponding to the flag is in an unmodifiable state, or in a state that does not need to be modified. Optionally, the register flag table may not include the register identifier. In an achievable manner, according to the byte order in the register flag table, a correspondence between each register number and a byte is formed, thereby obtaining a correspondence between the update flag under each byte and the register under each byte. For example, the values ​​in bit0-7 of the first byte in the register flag table correspond to the update flag of the register with register numbers 0-7, respectively, and the values ​​in bit0-7 of the second byte correspond to the update flag of the register with register numbers 8-15, respectively, and so on. This embodiment does not limit the specific value of the flag.

[0135] In this embodiment, after the BMC modifies the value in the register information table according to the target register, the BMC modifies the value of the corresponding flag bit in the register flag table to the first value according to the identifier of the target register to indicate that the target register needs to be modified, which is not limited in this embodiment.

[0136] In this embodiment, whether the register is modifiable is indicated based on the register flag table, so that the current status of all registers can be centrally and conveniently indicated, the control process of the registers can be optimized, and the interaction resources between the BIOS and the BMC can be reduced.

[0137] In the process of modifying registers, the interaction between BMC and BIOS is as follows Figure 4 As shown, in one of the optional embodiments, when in SMM, the BMC sends a register modification instruction carrying an identifier of a target register to the BIOS, so that the BIOS performs a corresponding modification operation on the target register according to the identifier of the target register, including:

[0138] S401, when in SMM, the BMC sends a register modification instruction to the BIOS;

[0139] S402, in response to a first acquisition request sent by the BIOS after receiving the register modification instruction, sending a register flag table to the BIOS, so that the BIOS determines a target register according to the register flag table;

[0140] S403, in response to a second acquisition request sent by the BIOS after determining the target register, sending a target value of the target register to the BIOS, so that the BIOS modifies the target register according to the target value and obtains an actual value of the target register;

[0141] S404, receiving the actual value of the target register returned by the BIOS, and updating the current value of the target register in the register information table according to the actual value;

[0142] S305: Return a register modification completion response to the BIOS.

[0143] In this embodiment, when the SMM mode is turned on, the BMC triggers the BIOS to execute the script SMI Handler and sends a register modification instruction to the BIOS. In response to receiving the register modification instruction, the BIOS sends a first acquisition request to the BMC, that is, the BMC receives the first acquisition request Get Update Flag Command sent by the BIOS to obtain the register flag table, and returns the register flag table to the BIOS.

[0144] The BMC responds to the BIOS's acquisition request and returns a response instruction to the BIOS. Optionally, the response instruction may carry a response identifier Completion Code indicating whether the operation is successful and an update flag bit of each register in the register flag table.

[0145] The BIOS determines the target register according to the register flag table, and sends a second acquisition request to the BMC to obtain the value of the target register, wherein the data of the second acquisition request can refer to the content in Table 2. The BMC returns the value of the target register to the BIOS according to the second acquisition request, so that the BIOS modifies and obtains the actual value of the target register, and then the BMC updates the current value of the target register in the register information table according to the actual value, and returns a register modification completion response to the BIOS, which is not limited in this embodiment.

[0146] In this embodiment, after entering the SMM mode, the BMC can interact with the BIOS independently of the operating system OS, and implement register modification operations through the BIOS, making access to all registers more flexible.

[0147] After completing the modification of the register, in one of the optional embodiments, the method further includes:

[0148] In response to the BIOS receiving the register flag reset request sent in the register modification completion response, all update flag bits in the register flag table are set to a second value, where the second value indicates that the register is in an unmodifiable state.

[0149] Among them, when all registers that need to be modified have been modified, the BIOS sends a register flag reset request Set Update Flag Command to the BMC. After receiving the register flag reset request, the BMC sets all update flag bits in the register flag table to the second value according to the register flag reset request. Here, the second value can be 0 or 1.

[0150] In this embodiment, after the BIOS modifies the register, the update flag bits in the register flag table in the BMC are reset in time, so that it can be determined in time that the current register modification operation has been completed, so as to release the corresponding control resources and storage space.

[0151] The following will explain in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems through embodiments and in combination with the accompanying drawings. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. It should be noted that the present application Figure 5-Figure 6 The register control method provided in the embodiment is executed by BIOS or a register control device, which can be part or all of BIOS through software, hardware or a combination of software and hardware. In the following method embodiments, the execution subject is BIOS as an example for description.

[0152] In one embodiment, Figure 5As shown, a register control method is provided, comprising the following steps:

[0153] S501. BIOS receives a register modification instruction sent by BMC.

[0154] The register modification instruction is an instruction sent by the BMC in the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU after receiving the register operation instruction and determining that the operation instruction is a modification instruction.

[0155] The BIOS receives the register modification instruction sent by the BMC, wherein the register modification instruction is an instruction generated by the BMC after processing the register operation instruction sent by the user. For details, please refer to the above Figure 2 Embodiment: This embodiment will not be described in detail.

[0156] Optionally, before receiving the register modification instruction sent by the BMC, the BIOS further includes an initialization phase for the server. In one embodiment, the BIOS may set a target pin of the CPU connected to the BMC to trigger the start of the system management mode SMM when it is at a preset level.

[0157] Among them, during the boot process, the BIOS can set the target pin of the CPU connected to the designated pin of the BMC to trigger the start of SMM at a preset level. The target pin can be any pin in the CPU that can trigger the execution script SMI Handler, and the preset level can be a low level or a high level. Furthermore, the BIOS can also register an execution script SMI Handler associated with the target pin. When the target pin is pulled low, the execution script SMI Handler will be triggered.

[0158] S502: BIOS determines a target register according to the register modification instruction, and performs a modification operation on the target register.

[0159] The target register is the register to be modified. In this embodiment, after receiving the register modification instruction sent by the BMC, the BIOS can optionally obtain the target value of the target register from the BMC, thereby modifying the register according to the target value. Alternatively, the BIOS can also obtain a register flag table from the BMC, thereby determining the target register to be modified according to the update flag bit of the register in the register flag table, and then obtain the target value of the target register from the BMC to modify the target register, which is not limited in this embodiment.

[0160] In the above register control method, the BMC triggers the server to enter the system management mode SMM by controlling the pin level. In the SMM mode, the BMC can interact with the BIOS to directly modify both the ordinary registers and the MCA registers, making the control of all registers more flexible. Moreover, the control of the registers does not depend on the operating system OS, so that the registers can be accessed even if the OS fails to log in due to an abnormality.

[0161] After triggering the SMM according to the pin level status, the BIOS may further perform secondary verification on the pins at the preset level. In one optional embodiment, after the BIOS receives the register modification instruction sent by the BMC, the method further includes:

[0162] If the BIOS determines that the pin at the preset level is the target pin of the CPU, the steps of determining the target register according to the register modification instruction and performing a modification operation on the target register are executed.

[0163] In this embodiment, for example, the preset level is a low level, and when in SMM, the BIOS executes the script SMIHandler, obtains the pin identifier of the low level, determines whether the pin is the target pin, and under the condition that the pin that pulls the level low is determined to be the target pin, determines the target register according to the register modification instruction, and performs a modification operation on the target register.

[0164] In this embodiment, the BIOS performs secondary verification on the pins at the preset level to further confirm that the target pins are at the preset level state, thereby triggering interaction with the BMC to implement the register modification operation, thereby improving the accuracy of register control.

[0165] After receiving the register modification instruction, the BIOS Figure 6 As shown, in one of the optional embodiments, the BIOS determines the target register according to the register modification instruction, and performs a modification operation on the target register, including:

[0166] S601, in response to the register modification instruction, the BIOS sends a request to obtain a register flag table to the BMC;

[0167] S602, receiving a register flag table returned by the BMC in response to a request to obtain a register flag table, and determining a target register according to the register flag table;

[0168] S603, sending a target value acquisition request carrying the identifier of the target register to the BMC;

[0169] S604: Receive the target value returned by the BMC in response to the request to obtain the target value, and modify the target register according to a preset register mapping table to obtain the actual value of the target register after modification.

[0170] The preset register mapping table is constructed according to the actual value of the register, the preset access address of the register, and the preset access mode of the register.

[0171] In this embodiment, when the SMM mode is turned on, the BIOS executes the script SMI Handler to receive the register modification instruction sent by the BMC. In response to receiving the register modification instruction, the BIOS sends a register flag table Get Update Flag Command request to the BMC.

[0172] After receiving the register flag table, the BMC may, optionally, in one embodiment, traverse the register flag table to determine that the register whose update flag bit in the register flag table is a first value is the target register; the first value indicates that the register is in a modifiable state.

[0173] The BIOS determines that the register whose update flag bit is marked as modifiable is the target register by traversing the register flag table, and the target register may be one or more. Optionally, the first value may be 1 or 0, which is not limited in this embodiment.

[0174] After the target register is determined, a request GetRegister Command for obtaining a register value may be sent to the BMC according to the target register, wherein the request for obtaining the target value carries an identifier of the target register.

[0175] The BIOS receives the target value of the target register returned by the BMC in response to the target value acquisition request, and modifies the value of the target register according to the target value and the access mode and access address of the target register in the register mapping table. Optionally, after modifying the target register, the BIOS can obtain the actual value of the target register and store the actual value in a specified storage space. This embodiment does not limit this.

[0176] Optionally, the BIOS may obtain current values ​​of various registers, and construct and store a register mapping table according to the current values ​​of various registers, access addresses of the registers, and access modes of the registers.

[0177] In this embodiment, the BIOS can obtain the values ​​of all registers during the server initialization phase, and build a register mapping table based on the values, numbers, access addresses and access methods of preset types or specified registers. In the process of modifying the target register, the target register can be modified directly according to the access address or access method in the register mapping table and the target value of the received target register.

[0178] The register mapping table can be found in the following table:

[0179] Table 3

[0180] register serial number Functional Description Recommended value Register A 0 Used to control CPU frequency Register B 1 Used to control the enable of a specified peripheral Register C 2 Threshold Count used to control MCA ...... ... ......

[0181] In this embodiment, the interface data format is defined in the register mapping table. The user only needs to specify the number and value of the register to be modified, and then send a command to the BMC. The BMC sends a modification instruction to the BIOS, and the BIOS can modify the corresponding register according to the register mapping table, thereby improving convenience.

[0182] In this embodiment, after entering the SMM mode, the BIOS and the BMC can interact independently of the operating system, so that the register modification operation is implemented through the BIOS, making the access to all registers more flexible.

[0183] After the BIOS finishes modifying the value of the register, in one of the optional embodiments, the method further includes:

[0184] Get the actual value of the target register and send the actual value to the BMC.

[0185] In this embodiment, after modifying the value of the target register, the BIOS can send the actual value of the target register obtained to the BMC. For example, the BIOS can send a register modification request Set Register Command to the BMC, which carries at least one of the target register identifier, the value of the target register, and the sender ID. Here, the sender ID can be the BIOS ID or other identifiers of the BIOS. Similar to step 202, after receiving the request to modify the register value and determining that it is a modification instruction sent by the BIOS according to the sender ID, the BMC only needs to modify the value of the corresponding register in the local register information table according to the actual value of the target register carried in the Set Register Command request. The difference here from step 202 is that when the BMC determines that the sender is the BIOS, it does not modify the value of the update flag in the register flag table.

[0186] Optionally, in addition to sending the actual value of the target register to the BMC after modifying the value of the target register, the BIOS also obtains the values ​​of all registers during the initialization phase, that is, the boot phase of the server, and sends the values ​​of the registers to the BMC, so that the BMC builds a register mapping table according to the values ​​of the registers or performs operations such as storing and reading the values ​​of the registers. This embodiment does not limit this.

[0187] In this embodiment, the BIOS can read the actual value of the register and send it to the BMC in various scenarios. The BMC can update the value of the register in the local storage space according to the actual value of the register obtained, thereby optimizing the control process of the BMC register and making the access to the register more flexible.

[0188] After the BIOS sends the modified actual value of the register to the BMC, in one of the optional embodiments, the method further includes:

[0189] receiving a register modification completion response sent by the BMC after modifying the register information table according to the actual value;

[0190] A register flag reset request is sent to the BMC, so that the BMC sets all update flag bits in the register flag table in the BMC to a second value; the second value indicates that the register is in an unmodifiable state.

[0191] In this embodiment, after the BIOS receives the register modification completion response sent by the BMC, that is, after determining that all the registers that currently need to be modified have been modified, in this case, the BIOS can send a register flag reset request Set Update Flag Command to the BMC, so that the BMC sets all the update flags in the register flag table to the second value, that is, resets all the flags. Optionally, the second value here can be 0 or 1.

[0192] Optionally, during the initialization phase, that is, during the booting process of the server, after sending the current values ​​of all registers to the BMC, the BIOS may also send a register flag reset request Set Update Flag Command to the BMC, so that the BMC sets all update flag bits in the register flag table to the second value.

[0193] In this embodiment, after the BIOS modifies the register, the update flag bits in the register flag table in the BMC are reset in time, so that it can be determined in time that the current register modification operation has been completed, so as to release the corresponding control resources and storage space.

[0194] After implementing the reset update of the register update flag table, in one of the optional embodiments, the method further includes:

[0195] After sending a register flag reset request to the BMC, exit SMM.

[0196] In this embodiment, after the BIOS sends a register flag reset request to the BMC, the script execution is terminated, and when it is determined that there is no register that needs to be modified, the SMM is exited in time, so that the corresponding register control resources and computing resources can be released.

[0197] In order to better illustrate the above method, Figure 7 As shown, this embodiment provides a register control method for interaction between BIOS and BMC, which specifically includes:

[0198] S101, BIOS obtains an actual value of a register of a preset type;

[0199] S102, BIOS sends the actual value of the register to the BMC, so that the BMC builds a register information table according to the actual value of the register;

[0200] S103, BIOS builds and stores a register mapping table according to the actual value of the register, the access address of the register, and the access mode of the register;

[0201] S104, BIOS sets the target pin of the CPU connected to the BMC to be at a preset level to trigger the start of the system management mode SMM;

[0202] S105, BIOS sends a register flag reset request to the BMC, so that the BMC clears all update flag bits in the register flag table in the BMC;

[0203] S106, BMC receives the operation instruction of the register;

[0204] S107, if the operation instruction is a read instruction, the BMC obtains the current value corresponding to the target register from the register information table according to the identifier of the target register in the read instruction;

[0205] S108, if the operation instruction is a modification instruction, the BMC sets the level of the target pin connected to the CPU to a preset level to enable SMM;

[0206] S109, under SMM, triggering BIOS to execute the script SMI Handler;

[0207] S110, when the BIOS determines that the pin at the preset level is the target pin of the CPU, sending a request to obtain a register flag table to the BMC;

[0208] S111, BMC responds to the request to obtain the register flag table and sends the register flag table to BIOS;

[0209] S112, BIOS receives the register flag table returned by the BMC, and determines the target register according to the register flag table;

[0210] S113, BIOS sends a target value acquisition request carrying the identifier of the target register to the BMC;

[0211] S114, the BMC responds to the request to obtain the target value and sends the target value of the target register to the BIOS;

[0212] S115, the BIOS receives the target value returned by the BMC in response to the request to obtain the target value, and modifies the target register based on the register mapping table to obtain the actual value of the target register after modification;

[0213] S116, BIOS sends the actual value to BMC;

[0214] S117, BMC updates the current value of the target register in the register information table according to the actual value;

[0215] S118, BMC returns a register modification completion response to BIOS;

[0216] S119, BIOS sends a register flag reset request to BMC;

[0217] S120, the BMC responds to the register flag reset request sent by the BIOS and clears all update flag bits in the register flag table;

[0218] S121. After sending a register flag reset request to the BMC, the BIOS ends the running of the SMI Handler script and exits the SMM.

[0219] In this embodiment, the BMC triggers the BIOS to run the script SMI Handler by controlling the pin level and enables the CPU of the server to enter the system management mode SMM. In this way, the BMC can interact with the BIOS in the SMM mode to achieve direct modification of both ordinary registers and MCA registers, making the control of all registers more flexible. Moreover, the control of the registers does not depend on the operating system OS, so that the registers can be accessed even if the OS fails to log in due to an abnormality.

[0220] The implementation principle and technical effect of the register control method provided in the above embodiment are similar to those of the above method embodiment, and will not be repeated here.

[0221] It should be understood that although Figure 2-7The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-7 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0222] In one embodiment, Figure 8 As shown, a register control system is provided, which is applied to a server, and the system includes a CPU and a BMC;

[0223] The first target pin of the CPU is used as an input terminal; the second target pin of the BMC is used as an output terminal; the first target pin is connected to the second target pin; and the first target pin triggers the server to start the system management mode SMM at a preset level.

[0224] The first target pin of the CPU may be a GPIO pin, and the second target pin of the BMC may be any designated pin. Optionally, the GPIO pin may be a pin that can trigger the server to enter the SMM mode and execute the script SMI Handler at a high level or a low level. In this embodiment, the interaction process between the BMC and the BIOS may refer to Fig. 9 The embodiments given here will not be described in detail in this embodiment.

[0225] In this embodiment, the BMC triggers the server to enter the system management mode SMM by controlling the pin level. In the SMM mode, the BMC can interact with the BIOS to directly modify both the ordinary registers and the MCA registers, making the control of all registers more flexible. Moreover, the control of the registers does not depend on the operating system OS, so that the registers can be accessed even if the OS fails to log in due to an abnormality.

[0226] In one embodiment, Fig. 9 As shown, a register control device is provided, comprising:

[0227] The receiving module 01 is used to receive a register operation instruction; the register operation instruction carries an identifier of a target register;

[0228] The control module 02 is used to start the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU when the operation instruction is a modification instruction;

[0229] The sending module 03 is used to send a register modification instruction carrying the identifier of the target register to the BIOS when in SMM, so that the BIOS performs a corresponding modification operation on the target register according to the identifier of the target register.

[0230] In one of the optional embodiments, the control module 02 is used to set the level of a target pin connected to the CPU to a preset level to enable the SMM; the target pin is connected to a pin of the BMC.

[0231] In one of the optional embodiments, if the modification instruction includes a target value of the target register, such as Fig.10 As shown, the device also includes an updating module 04, which is used to update the current value of the target register in the register information table in the BMC according to the identifier and the target value of the target register to obtain an updated register information table.

[0232] In one of the optional embodiments, the update module 04 is also used to set the update flag of the target register in the register flag table in the BMC to a first value according to the identifier of the target register, so as to obtain an updated register flag table; the first value is used to indicate that the register is in a modifiable state.

[0233] In one of the optional embodiments, the sending module 03 is used to send a register modification instruction to the BIOS when in SMM; in response to a first acquisition request sent by the BIOS after receiving the register modification instruction, send a register flag table to the BIOS, so that the BIOS determines the target register according to the register flag table; in response to a second acquisition request sent after the BIOS determines the target register, send a target value of the target register to the BIOS, so that the BIOS modifies the target register according to the target value and obtains the actual value of the target register; receive the actual value of the target register returned by the BIOS, and update the current value of the target register in the register information table according to the actual value; and return a register modification completion response to the BIOS.

[0234] In one of the optional embodiments, the update module 04 is also used to set all update flag bits in the register flag table to a second value in response to the BIOS receiving a register flag reset request sent in response to completing the register modification, and the second value indicates that the register is in an unmodifiable state.

[0235] In one of the optional embodiments, Fig.11As shown, the device also includes an acquisition module 05, which is used to obtain the current value corresponding to the target register from the register information table according to the identifier of the target register in the read instruction when the operation instruction is a read instruction; and a display module 06, which is used to display the current value of the target register on the user interface.

[0236] In one of the optional embodiments, Fig.12 As shown, the device also includes a building module 07;

[0237] The receiving module 01 is also used to receive the actual value of the register of the preset type sent by the BIOS;

[0238] The construction module 07 is used to construct a register information table according to the actual value of each register and the identifier of each register.

[0239] In one embodiment, Fig.13 As shown, a register control device is provided, comprising:

[0240] The receiving module 11 is used to receive the register modification instruction sent by the BMC; the register modification instruction is an instruction sent by the BMC to start the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU after receiving the register operation instruction and determining that the operation instruction is a modification instruction;

[0241] The processing module 12 is used to determine the target register according to the register modification instruction and perform a modification operation on the target register.

[0242] In one of the optional embodiments, after the BIOS receives the register modification instruction sent by the BMC, the processing module 12 is used to determine that the pin at a preset level is the target pin of the CPU, execute the steps of determining the target register according to the register modification instruction, and modifying the target register.

[0243] In one of the optional embodiments, the processing module 12 is used to send a register flag table acquisition request to the BMC in response to a register modification instruction; receive the register flag table returned by the BMC in response to the register flag table acquisition request, and determine the target register according to the register flag table; send a target value acquisition request carrying the identifier of the target register to the BMC; receive the target value returned by the BMC in response to the target value acquisition request, and modify the target register according to a preset register mapping table to obtain the actual value of the target register after modification; the preset register mapping table is constructed according to the actual value of the register, the preset register access address, and the preset register access method.

[0244] In one of the optional embodiments, Fig.14As shown, the device further includes a sending module 13, which is used to obtain the actual value of the target register and send the actual value to the BMC.

[0245] In one of the optional embodiments, the processing module 12 is used to traverse the register flag table and determine that the register whose update flag bit is a first value in the register flag table is the target register; the first value indicates that the register is in a modifiable state.

[0246] In one of the optional embodiments, the receiving module 11 is also used to receive a register modification completion response sent by the BMC after the register information table is modified according to the actual value; the sending module 13 is also used to send a register flag reset request to the BMC so that the BMC sets all update flag bits in the register flag table in the BMC to a second value; the second value indicates that the register is in an unmodifiable state.

[0247] In one optional embodiment, the processing module 12 is further configured to exit the SMM after sending a register flag reset request to the BMC.

[0248] In one of the optional embodiments, Fig.15 As shown, the device further includes a setting module 14, which is used to set a target pin of the CPU connected to the BMC to trigger the start of the system management mode SMM when it is at a preset level.

[0249] For the specific definition of the register control device, please refer to the definition of the register control method above, which will not be repeated here. Each module in the above register control device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0250] In one embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Fig.16As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a register control method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0251] Those skilled in the art will understand that Fig.16 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0252] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0253] The BMC receives a register operation instruction; the register operation instruction carries an identifier of a target register;

[0254] When the operation instruction is a modification instruction, the BMC turns on the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU;

[0255] In the case of SMM, the BMC sends a register modification instruction carrying an identifier of a target register to the BIOS, so that the BIOS performs a corresponding modification operation on the target register according to the identifier of the target register.

[0256] The implementation principle and technical effect of the computer device provided in the above embodiment are similar to those of the above method embodiment, and will not be repeated here.

[0257] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0258] The BIOS receives the register modification instruction sent by the BMC; the register modification instruction is an instruction sent by the BMC to start the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU after receiving the register operation instruction and determining that the operation instruction is a modification instruction;

[0259] The BIOS determines a target register according to the register modification instruction and performs a modification operation on the target register.

[0260] The implementation principle and technical effect of the computer device provided in the above embodiment are similar to those of the above method embodiment, and will not be repeated here.

[0261] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0262] The BMC receives a register operation instruction; the register operation instruction carries an identifier of a target register;

[0263] When the operation instruction is a modification instruction, the BMC turns on the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU;

[0264] In the case of SMM, the BMC sends a register modification instruction carrying an identifier of a target register to the BIOS, so that the BIOS performs a corresponding modification operation on the target register according to the identifier of the target register.

[0265] The computer-readable storage medium provided in the above embodiment has similar implementation principles and technical effects as those of the above method embodiment, and will not be described in detail here.

[0266] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0267] The BIOS receives the register modification instruction sent by the BMC; the register modification instruction is an instruction sent by the BMC to start the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU after receiving the register operation instruction and determining that the operation instruction is a modification instruction;

[0268] The BIOS determines a target register according to the register modification instruction and performs a modification operation on the target register.

[0269] The computer-readable storage medium provided in the above embodiment has similar implementation principles and technical effects as those of the above method embodiment, and will not be described in detail here.

[0270] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0271] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0272] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A register control method, characterized in that: The method comprises: The BMC receives an operation instruction of a register; the operation instruction of the register carries an identifier of a target register; In the case where the operation instruction is a modification instruction, the BMC turns on the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU; When in the SMM, the BMC sends the register modification instruction to the BIOS; In response to a first acquisition request sent by the BIOS after receiving the register modification instruction, sending a register flag table to the BIOS, so that the BIOS determines the target register according to the register flag table; In response to a second acquisition request sent by the BIOS after determining the target register, sending a target value of the target register to the BIOS, so that the BIOS modifies the target register according to the target value and obtains an actual value of the target register; receiving the actual value of the target register returned by the BIOS, and updating the current value of the target register in the register information table according to the actual value; A completion register modification response is returned to the BIOS.

2. The method according to claim 1, characterized in that When the operation instruction is a modification instruction, the BMC starts the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU, including: The BMC sets the level of a target pin connected to the CPU to a preset level to turn on the SMM; the target pin is connected to a pin of the BMC.

3. The method according to claim 2, characterized in that If the modification instruction includes the target value of the target register, the method further includes: According to the identifier of the target register and the target value, the current value of the target register in the register information table in the BMC is updated to obtain an updated register information table.

4. The method according to claim 3, characterized in that The method further comprises: According to the identifier of the target register, the update flag bit of the target register in the register flag table in the BMC is set to a first value to obtain an updated register flag table; the first value is used to indicate that the register is in a modifiable state.

5. A register control method, characterized in that: The method comprises: The BIOS receives a register modification instruction sent by the BMC; the register modification instruction is an instruction sent by the BMC to start the system management mode SMM by controlling the level state of the connection pin between the BMC and the CPU after the BMC receives the register operation instruction and determines that the operation instruction is a modification instruction; In response to the register modification instruction, the BIOS sends a register flag table acquisition request to the BMC; receiving a register flag table returned by the BMC in response to the register flag table acquisition request, and determining a target register according to the register flag table; A request for obtaining a target value, carrying an identifier of the target register, is sent to the BMC; Receive the target value returned by the BMC in response to the request to obtain the target value, and modify the target register according to a preset register mapping table to obtain the modified actual value of the target register; the preset register mapping table is constructed according to the actual value of the register, the preset access address of the register, and the preset access method of the register.

6. The method according to claim 5, characterized in that After the BIOS receives the register modification instruction sent by the BMC, the method further includes: If the BIOS determines that the pin at the preset level is the target pin of the CPU, the steps of determining the target register according to the register modification instruction and performing a modification operation on the target register are executed.

7. The method according to claim 5 or 6, characterized in that: The method further comprises: The target pin of the CPU connected to the BMC is set to be at a preset level to trigger the start of a system management mode SMM.

8. A register control system, characterized in that: Applied in a server, the system includes a CPU and a BMC; The first target pin of the CPU is used as an input terminal; the second target pin of the BMC is used as an output terminal; the first target pin is connected to the second target pin; the first target pin triggers the server to start the system management mode SMM at a preset level; In the case of being in the SMM, the BMC performs the following steps: receiving a register operation instruction; the register operation instruction carries an identifier of a target register; sending the register modification instruction to the BIOS; in response to a first acquisition request sent by the BIOS after receiving the register modification instruction, sending a register flag table to the BIOS, so that the BIOS determines the target register according to the register flag table; In response to a second acquisition request sent by the BIOS after determining the target register, a target value of the target register is sent to the BIOS, so that the BIOS modifies the target register according to the target value and obtains the actual value of the target register; the actual value of the target register returned by the BIOS is received, and the current value of the target register in the register information table is updated according to the actual value; and a register modification completion response is returned to the BIOS.

9. A computer device, comprising a basic input system BIOS, a baseboard management controller BMC, a central processing unit CPU and a memory, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.