-
Notifications
You must be signed in to change notification settings - Fork 105
[6.6] Support Hygon TKM (Trusted Key Management) virtualization #386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[6.6] Support Hygon TKM (Trusted Key Management) virtualization #386
Conversation
…rnel space hygon inclusion category: feature --------------------------- Add a self-defined mutex to support concurrent psp access between kernel space and user space. Signed-off-by: xiongmengbiao <xiongmengbiao@hygon.cn>
hygon inclusion category: feature --------------------------- Add ioctl interface to control the state of self-defined mutex in user and kernel space. By default, when psp user-mode driver is not used, the self-defined mutex is disabled, and the kernel's native private lock is utilized instead. Signed-off-by: xiongmengbiao <xiongmengbiao@hygon.cn>
hygon inclusion category: feature --------------------------- Support the PSP virtualization basic framework. The guest uses the vmmcall instruction to interact with KVM, which then forwards the data to the PSP device driver and sends it to the PSP hardware. Signed-off-by: niuyongwen <niuyongwen@hygon.cn>
hygon inclusion category: feature --------------------------- Allow the guest to execute Trusted Key Management (TKM) commands in user mode. Each TKM command data block is transferred to KVM using the vmmcall instruction and processed through the following three steps: 1. Obtain the VM command and preprocess the pointer mapping table information in the command buffer 2. The command that has been converted will interact with the channel of the psp through the driver and try to obtain the execution result 3. The executed command data is recovered according to the multilevel pointer of the mapping table, and then returned to the VM Signed-off-by: niuyongwen <niuyongwen@hygon.cn>
hygon inclusion category: feature --------------------------- Add `vpsp_add_vid` and `vpsp_del_vid` to receive VID information in host user mode. Generally, these ioctl calls should be initiated from the QEMU process. When sending data to the PSP hardware, place the VID in the bit 56 to bit 63 range of the physical address. The PSP hardware will then access different key spaces based on the VID. Signed-off-by: xiongmengbiao <xiongmengbiao@hygon.cn>
hygon inclusion category: feature --------------------------- If the guest does not explicitly specify a VID via `vpsp_add_vid`, VID 0 will be used by default, sharing the key space with the host. A `vpsp_set_default_vid_permission` ioctl call has been added to control the behavior of the default VID. If the default VID permission is set to "not allowed," any guest that does not explicitly specify a VID will be denied access to the TKM function. Signed-off-by: xiongmengbiao <xiongmengbiao@hygon.cn>
… module hygon inclusion category: feature --------------------------- Because the KVM module calls certain interfaces from the ccp module, such as vpsp_try_do_cmd, it is necessary to load the ccp module before loading kvm. However, on CPUs other than Hygon, the ccp module might not be loaded, which would prevent the kvm module from loading. Therefore, we use function hooks to call functions from the ccp module. Now the module dependencies are as follows: [root@centos-7-8 ~]# lsmod | grep kvm kvm_amd 200704 0 kvm 1339392 1 kvm_amd ccp 352256 1 kvm_amd irqbypass 12288 2 vfio_pci_core,kvm Signed-off-by: xiongmengbiao <xiongmengbiao@hygon.cn>
…emmory for tkm hygon inclusion category: bugfix --------------------------- When deleting a VID, `memcpy` is used to move data within the array and overwrite the deleted VID entry. However, `memcpy` does not handle overlapping memory regions correctly within the array. Therefore, `memmove` should be used instead. Signed-off-by: niuyongwen <niuyongwen@hygon.cn>
|
Hi @Amannix. Thanks for your PR. 😃 |
|
Hi @Amannix. Thanks for your PR. I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Description:
When qemu is started, it can access different key spaces by specifying vid (virtual ID).
When the guest accesses the TKM, it will notify KVM through hypercall call, and KVM will send the guest's command data to the PSP for processing.
Related qemu PR: 支持海光可信密钥管理(TKM)的密钥隔离功能