Rate This Document
Findability
Accuracy
Completeness
Readability

User Guide

Basic Usage

This section describes the usage and command parameters of the CMF command line tool.

Go to the build/uapi folder where the command line tool is located and run the --help command to view all parameters.

./devcman --help

Table 1 describes the devcman command parameters.

Table 1 devcman command parameters

Parameter Range Default Value Description
-h/--help - - Prints the usage information about all parameters.
-m/--mode l2-restrict l2-restrict (Mandatory) Only l2-restrict is valid for this parameter. If other modes are specified, error logs are printed.
-s/--start_cpu Visible core ID, which is not greater than end_cpu. - (Mandatory) Indicates the start core ID. Ensure that the value range between start_cpu and end_cpu is within the configured CPU core range.
-e/--end_cpu Visible core ID, which is not less than start_cpu. - (Mandatory) Indicates the end core ID. Ensure that the value range between start_cpu and end_cpu is within the configured CPU core range.
--reset - - If this parameter is added, feature reset is performed based on the specified mode (which can only be l2-restrict) and CPU cores.
--d-mask Hexadecimal string ranging from 0x0 to 0x3ff 0x0 Indicates the L2 D-cache mask.
--i-mask Hexadecimal string ranging from 0x0 to 0x3ff 0x0 Indicates the L2 I-cache mask.

Querying the L2 I-Cache/D-Cache Configuration of CPU Cores<

Use the CMF command line tool to query the L2 I-cache/D-cache configuration of the corresponding CPU cores.

  • If --reset, --i-mask, and --d-mask are not specified, the command operates in query mode. In this case, the CPU core sequence must be specified. For example, to query the configuration of CPU cores 80 to 119, run the following command:

    ./devcman -m l2-restrict --start_cpu 80 --end_cpu 119
  • To query the configuration of a single CPU core, set both start_cpu and end_cpu to the target core ID. For example, run the following command to query the configuration of CPU core 1:

    ./devcman -m l2-restrict --start_cpu 1 --end_cpu 1

Setting the L2 I-Cache/D-Cache Configuration of CPU Cores

Use the CMF command line tool to set the L2 I-cache/D-cache configuration of the corresponding CPU cores.

If --reset is not specified but --i-mask and --d-mask are specified in a command, the command is a setting command. In this case, the core IDs must be specified.

The new Kunpeng 920 processor model has a 10-way set associative L2 cache. The value of both --i-mask and --d-mask ranges from 0x0 to 0x3FF. If the value of a bit is 0, scheduling is allowed on the way. Otherwise, scheduling is not allowed. When setting the L2 I-cache/D-cache, ensure that at least two bits of --i-mask and --d-mask are 0.

For example, you can run the following command to configure the L2 I-cache and L2 D-cache of CPU cores 80 and 81 to be 8-way set associative (with six ways shared between them and two ways exclusively allocated to each core). The binary representation of 0x300 is 001100000000, indicating that data can be scheduled on the last eight ways. The binary representation of 0x3 is 000000000011, indicating that instructions can be scheduled on the first eight ways.

./devcman -m l2-restrict --start_cpu 80 --end_cpu 81 --d-mask 0x300 --i-mask 0x3

--start_cpu and --end_cpu indicate the start and end CPU core IDs, respectively. If the value of --start_cpu is the same as that of --end_cpu, the configuration is valid only for the CPU core whose ID is --start_cpu.

Reset

To use the reset function, specify the --reset parameter in the CMF command line tool.

  • Run the following command to perform reset for all CPU cores:

    ./devcman -m l2-restrict --reset --start_cpu 0 --end_cpu $(($(nproc) -1))
  • To perform reset for a sequence of CPU cores, use --start_cpu and --end_cpu to specify the core ID range. For example, run the following command to perform reset for CPU cores 80 to 119:

    ./devcman -m l2-restrict --reset --start_cpu 80 --end_cpu 119
  • To perform reset for a single CPU core, set both start_cpu and end_cpu to the target CPU core ID. For example, run the following command to perform reset for CPU core 1.

    ./devcman -m l2-restrict --reset --start_cpu 1 --end_cpu 1