Search

CN-121996607-A - Chip function configuration, certificate generation method, related device, medium, and program

CN121996607ACN 121996607 ACN121996607 ACN 121996607ACN-121996607-A

Abstract

The embodiment of the application provides a chip function configuration method, a certificate generation method, a related device, a medium and a program, wherein the chip function configuration method is applied to a chip, the chip function configuration method comprises the steps of obtaining a certificate to be imported, wherein the certificate comprises a verification field written with verification information and a plurality of function setting fields configured with switch state values, one function setting field corresponds to one chip function, the switch state value of the function setting field represents the switch state of the chip function corresponding to the function setting field, verifying whether the certificate passes or not according to the verification information, importing the certificate if the certificate passes, and configuring the switch state of the chip function corresponding to the function setting field in the chip according to the switch state value of the function setting field in the certificate. The embodiment of the application can flexibly provide the chip with the function adapted to the user requirement, and improves the flexibility of the chip function configuration under the condition of meeting the user requirement.

Inventors

  • FENG HAO
  • YING ZHIWEI
  • LIU ZIXING

Assignees

  • 海光信息技术股份有限公司

Dates

Publication Date
20260508
Application Date
20241101

Claims (20)

  1. 1. A method for configuring a chip function, the method being applied to a chip, the method comprising: Acquiring a certificate to be imported, wherein the certificate comprises a verification field written with verification information and a plurality of function setting fields configured with switch state values, one function setting field corresponds to one chip function, and the switch state value of the function setting field represents the switch state of the chip function corresponding to the function setting field; verifying whether the certificate passes or not according to the verification information; If the certificate passes verification, the certificate is imported, and the on-off state of the chip function corresponding to the function setting field in the chip is configured according to the on-off state value of the function setting field in the certificate.
  2. 2. The method of claim 1, wherein the obtaining the certificate to be imported comprises: Selecting one preset certificate from a plurality of preset certificates of the chip, wherein the one preset certificate of the chip is pre-generated based on one preset function requirement information of the chip, the one preset function requirement information of the chip comprises preset requirement switch states of a plurality of chip functions, and the preset requirement switch states of the plurality of chip functions indicated by different preset function requirement information of the chip are different; Or alternatively The method comprises the steps of obtaining a specified certificate of a chip, wherein the specified certificate of the chip is generated based on specified function requirement information provided by a user, and the specified function requirement information comprises specified requirement switch states of a plurality of chip functions specified by the user.
  3. 3. The method of claim 1, wherein the switch states of the chip functions are divided into an active state and an off state, and wherein configuring the switch states of the chip functions corresponding to the function setting fields in the chip according to the switch state values of the function setting fields in the certificate comprises: and maintaining the activated chip function of the chip, determining a function setting field of which the switch state value represents the activation state in the certificate, and activating the chip function corresponding to the function setting field of which the switch state value represents the activation state.
  4. 4. The method of claim 1, wherein configuring the switch state of the chip function in the chip corresponding to the function setting field according to the switch state value of the function setting field in the certificate comprises: Determining a function setting field of which the switch state value represents an activated state and a function setting field of which the switch state value represents a closed state in the certificate; activating the chip function corresponding to the function setting field of which the switch state value represents the activation state, and closing the chip function corresponding to the function setting field of which the switch state value represents the closing state.
  5. 5. The method of claim 4, wherein activating the chip function corresponding to the function setting field whose switch state value indicates the active state comprises: Setting the on-off state of the chip function corresponding to the function setting field with the on-off state value being the first value as the active state, wherein the on-off state value of the function setting field is the first value, and the corresponding chip function is indicated as the active state; the closing the chip function corresponding to the function setting field of the switch state value representing the closing state includes: And setting the on-off state of the chip function corresponding to the function setting field with the on-off state value of the third value as the off state, wherein the on-off state value of the function setting field is the third value, and the on-off state of the corresponding chip function is the off state.
  6. 6. The method of claim 5, wherein the configuration register of the processor of the chip has bits corresponding to the processor functions, and at least one bit of the configuration register corresponds to one processor function, wherein the values of the bits corresponding to the processor functions in the configuration register are used to control the on-off state of the hardware circuitry of the processor functions; The setting the switch state of the chip function corresponding to the function setting field with the switch state value being the first value to the active state includes: setting a first value in a configuration register for a function setting field having a switch state value of the first value, the first value corresponding to a processor function corresponding to the function setting field, so as to control a hardware circuit of the processor function corresponding to the function setting field to be in an active state; the setting the on-off state of the chip function corresponding to the function setting field having the on-off state value of the third value to the off state includes: and setting a first value in a bit corresponding to the processor function corresponding to the function setting field in the configuration register for the function setting field with the switch state value being the first value, so as to control a hardware circuit of the processor function corresponding to the function setting field to be in a closed state.
  7. 7. The method of claim 1, wherein the verification field written with verification information comprises a chip identification field written with chip identification information and a certificate signature field written with certificate signature information, wherein the certificate signature information is a digital signature of a certificate obtained by using a private key of a chip manufacturer; Said verifying whether said certificate passes according to said verification information comprises: verifying whether the certificate signature information passes or not by using a public key of a chip manufacturer; if the certificate signature information is verified to be not passed, verifying that the certificate is not passed; If the certificate signature information is verified to pass, checking whether the chip identification information is matched with the chip or not; if the chip identification information is checked to be not matched with the chip, verifying that the certificate does not pass; And if the chip identification information is checked to be matched with the chip, verifying that the certificate passes.
  8. 8. The method of any one of claims 1-7, further comprising: After the on-off state of the chip function corresponding to the function setting field in the configuration chip, at least recording the currently activated chip function of the chip in the function support data; Performing security protection on the function support data to obtain the function support data after security protection, and writing the function support data after security protection into a nonvolatile memory of the chip; after the chip is powered down and restarted, the function support data after the safety protection is read from the nonvolatile memory; Recovering the function support data after safety protection to obtain the function support data; And activating corresponding chip functions in the chip according to the activated chip functions of the function support data record so as to keep the activated chip functions in the chip consistent with those before power failure.
  9. 9. The method of claim 8, wherein securing the function support data to obtain the secured function support data comprises: encrypting the function support data according to the chip key of the chip to obtain encrypted function support data; Integrity protection is carried out on the encrypted functional support data, and integrity protection information is obtained; Wherein, the encrypted function support data and the integrity protection information form function support data after security protection; the reading the function support data after the security protection from the nonvolatile memory comprises the following steps: Reading the encrypted function support data and the integrity protection information from the nonvolatile memory; the recovering the function support data after the safety protection, and obtaining the function support data comprises the following steps: According to the read integrity protection information, carrying out integrity check on the encrypted function support data; And if the integrity check is passed, decrypting the encrypted function support data according to the chip key of the chip to obtain decrypted function support data.
  10. 10. A method of certificate generation, for use with a vendor device, the method comprising: determining function requirement information of a chip, wherein the function requirement information comprises requirement switch states of a plurality of chip functions; According to the on-off states of the demands of the plurality of chip functions, the on-off state values of the plurality of function setting fields of the certificate are configured so that the on-off state values of the plurality of function setting fields correspond to the on-off states of the demands of the plurality of chip functions, wherein one function setting field corresponds to one chip function; and determining the verification information of the chip, and writing the verification information into a verification field of the certificate.
  11. 11. The method of claim 10, wherein determining functional requirement information of the chip comprises: determining any one piece of preset function requirement information from a plurality of pieces of preset function requirement information preset by a chip, wherein one piece of preset function requirement information of the chip comprises preset requirement switch states of a plurality of chip functions, the preset requirement switch states of the plurality of chip functions indicated by different preset function requirement information of the chip are different, and one piece of preset function requirement information of the chip correspondingly generates one piece of preset certificate of the chip; Or alternatively Determining specified function requirement information provided by a user, wherein the specified function requirement information comprises specified requirement switch states of a plurality of chip functions specified by the user, the specified function requirement information corresponds to a specified certificate of a generated chip, and the specified function requirement information is carried in the user requirement information provided by the user.
  12. 12. The method of claim 11, wherein the chip authentication information includes chip identification information of the chip and certificate signature information of the certificate, and wherein the certificate authentication field includes a chip identification field and a certificate signature field; determining the verification information of the chip, and writing the verification information into a verification field of the certificate comprises: determining chip identification information of the chip, and writing the chip identification information of the chip into a chip identification field of the certificate; And determining certificate signature information by using a private key of a chip manufacturer according to the chip identification information written in the chip identification field of the certificate and the switch state values of the plurality of function setting fields, and writing the certificate signature information into the certificate signature field of the certificate.
  13. 13. The method of claim 12, wherein determining chip identification information of a chip comprises: If the function requirement information of the chip is preset function requirement information, determining chip identification information of the chip during chip production and manufacturing; if the function requirement information of the chip is the specified function requirement information, the chip identification information provided by the user is determined from the user requirement information provided by the user.
  14. 14. The method of any of claims 10-13, wherein the switch state value of the function setting field is divided into a first value and a zero-th value, wherein the switch state value is an active state for a required switch state of a chip function corresponding to the function setting field of the first value, and the switch state value is an off state for a required switch state of a chip function corresponding to the function setting field of the zero-th value.
  15. 15. A chip function configuration apparatus, comprising: The certificate acquisition module is used for acquiring a certificate to be imported, and the certificate comprises a verification field written with verification information and a plurality of function setting fields configured with switch state values, wherein one function setting field corresponds to one chip function, and the switch state value of the function setting field represents the switch state of the chip function corresponding to the function setting field; The verification module is used for verifying whether the certificate passes or not according to the verification information; And the function configuration module is used for importing the certificate if the certificate passes verification, and configuring the on-off state of the chip function corresponding to the function setting field in the chip according to the on-off state value of the function setting field in the certificate.
  16. 16. A certificate generation apparatus, comprising: the function requirement determining module is used for determining function requirement information of the chip, wherein the function requirement information comprises requirement switch states of a plurality of chip functions; The function setting field configuration module is used for configuring the switch state values of a plurality of function setting fields of the certificate according to the requirement switch states of a plurality of chip functions so that the switch state values of the plurality of function setting fields correspond to the requirement switch states of the plurality of chip functions, wherein one function setting field corresponds to one chip function; and the verification field configuration module is used for determining the verification information of the chip and writing the verification information into the verification field of the certificate.
  17. 17. A chip comprising processor firmware configured to perform the chip function configuration method of any one of claims 1-9.
  18. 18. A vendor device comprising a memory storing computer instructions and a processor invoking the computer instructions stored in the memory to perform the certificate generation method of any of claims 10-14.
  19. 19. A storage medium storing computer instructions which, when executed, implement a chip function configuration method according to any one of claims 1 to 9 or a certificate generation method according to any one of claims 10 to 14.
  20. 20. A computer program product comprising computer instructions which, when executed, implement a chip function configuration method as claimed in any one of claims 1 to 9 or a certificate generation method as claimed in any one of claims 10 to 14.

Description

Chip function configuration, certificate generation method, related device, medium, and program Technical Field The embodiment of the application relates to the technical field of chips, in particular to a chip function configuration method, a certificate generation method, a related device, a medium and a program. Background Chips such as processor chips and SOCs (System on chips) are widely used in the fields of games, artificial intelligence, terminal devices (e.g., mobile devices), servers (e.g., enterprise servers), and the like. Along with the diversification of the user demands, the chip functions need to be adjusted according to the user demands, for example, a chip providing function adaptation based on the specific demands of the user on the chip functions is needed. However, designing and producing chips with different functions separately for different user demands clearly greatly increases the chip manufacturing cost. Therefore, how to provide a technical solution to flexibly provide a chip with a function adapted to the needs of the user becomes a technical problem to be solved by those skilled in the art. Disclosure of Invention In view of this, the embodiments of the present application provide a chip function configuration method, a certificate generation method, a related device, a medium and a program, so as to flexibly provide a chip with a function adapted to a user's requirement. In order to achieve the above purpose, the embodiment of the present application provides the following technical solutions. In a first aspect, an embodiment of the present application provides a method for configuring a chip function, applied to a chip, where the method includes: Acquiring a certificate to be imported, wherein the certificate comprises a verification field written with verification information and a plurality of function setting fields configured with switch state values, one function setting field corresponds to one chip function, and the switch state value of the function setting field represents the switch state of the chip function corresponding to the function setting field; verifying whether the certificate passes or not according to the verification information; If the certificate passes verification, the certificate is imported, and the on-off state of the chip function corresponding to the function setting field in the chip is configured according to the on-off state value of the function setting field in the certificate. In a second aspect, an embodiment of the present application provides a certificate generation method, applied to vendor equipment, where the method includes: determining function requirement information of a chip, wherein the function requirement information comprises requirement switch states of a plurality of chip functions; According to the on-off states of the demands of the plurality of chip functions, the on-off state values of the plurality of function setting fields of the certificate are configured so that the on-off state values of the plurality of function setting fields correspond to the on-off states of the demands of the plurality of chip functions, wherein one function setting field corresponds to one chip function; and determining the verification information of the chip, and writing the verification information into a verification field of the certificate. In a third aspect, an embodiment of the present application provides a chip function configuration apparatus, including: The certificate acquisition module is used for acquiring a certificate to be imported, and the certificate comprises a verification field written with verification information and a plurality of function setting fields configured with switch state values, wherein one function setting field corresponds to one chip function, and the switch state value of the function setting field represents the switch state of the chip function corresponding to the function setting field; The verification module is used for verifying whether the certificate passes or not according to the verification information; And the function configuration module is used for importing the certificate if the certificate passes verification, and configuring the on-off state of the chip function corresponding to the function setting field in the chip according to the on-off state value of the function setting field in the certificate. In a fourth aspect, an embodiment of the present application provides a certificate generation apparatus, including: the function requirement determining module is used for determining function requirement information of the chip, wherein the function requirement information comprises requirement switch states of a plurality of chip functions; The function setting field configuration module is used for configuring the switch state values of a plurality of function setting fields of the certificate according to the requirement switch states of a plurality of chip functions so that