Rate This Document
Findability
Accuracy
Completeness
Readability

Enabling SM Acceleration Hardware Passthrough

Kunpeng processors support SM cryptographic algorithms, including SM2, SM3, and SM4, for hardware-based encryption and decryption. This section describes how to use SM algorithms in cVMs.

Constraints

  • CCA hardware-based acceleration for SM algorithms is not compatible with stage 1 SMMU.

KAE Passthrough

For details, see Passing a Device Through to a VM. The XML configuration for KAE passthrough is the same as that for common PCIe device passthrough.

(Optional) KAE VF Passthrough

When KAE VF passthrough is enabled, the RME ACC driver needs to be loaded on the PF.

  1. Obtain the KAE driver.
    git clone https://gitee.com/confidential_computing/rme_acc.git
    cd rme_acc
    # Replace the KERNEL_DIR directory in Makefile with the current kernel source code directory.
    make
  2. Load the RME ACC driver on the PF.
    insmod ${RME_ACC_PATH}/rme_acc.ko
    echo rme_acc > /sys/bus/pci/devices/0000:09:00.0/driver_override
    echo 0000:09:00.0 > /sys/bus/pci/devices/0000:09:00.0/driver/unbind
    echo 0000:09:00.0 > /sys/bus/pci/drivers_probe
  3. Create VFs.
    echo ${NUM_OF_VF} > /sys/devices/pci0000:08/0000:08:00.0/0000:09:00.0/sriov_numvfs

Compiling and Deploying the KAE Driver Within a VM

For details, see the KAE Software Installation (KAE2.0) Source Code Installation.