Commit be5ee944 authored by fangbaoshun's avatar fangbaoshun Committed by hanliyang
Browse files

driver/virt/coco: Add HYGON CSV Guest dirver.

hygon inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I98W95


CVE: NA

---------------------------

CSV firmware provides the guest a mechanism to communicate with
the PSP without risk from a malicious hypervisor who wishes to read,
alter, drop or replay the messages sent. The driver provides
userspace interface to communicate with the PSP to request the
attestation report and more.

Signed-off-by: default avatarfangbaoshun <fangbaoshun@hygon.cn>
Signed-off-by: default avatarhanliyang <hanliyang@hygon.cn>
parent 0f13b863
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0

===================================================================
CSV Guest API Documentation
===================================================================

1. General description
======================

The CSV guest driver exposes IOCTL interfaces via the /dev/csv-guest misc
device to allow userspace to get certain CSV guest-specific details.

2. API description
==================

In this section, for each supported IOCTL, the following information is
provided along with a generic description.

:Input parameters: Parameters passed to the IOCTL and related details.
:Output: Details about output data and return value (with details about
         the non common error values).

2.1 CSV_CMD_GET_REPORT
-----------------------

:Input parameters: struct csv_report_req
:Output: Upon successful execution, CSV_REPORT data is copied to
         csv_report_req.report_data and return 0. Return -EINVAL for invalid
         operands, -EIO on VMMCALL failure or standard error number on other
         common failures.

The CSV_CMD_GET_REPORT IOCTL can be used by the attestation software to get
the CSV_REPORT from the CSV module using VMMCALL[KVM_HC_VM_ATTESTATION].
+2 −0
Original line number Diff line number Diff line
@@ -54,4 +54,6 @@ source "drivers/virt/coco/sev-guest/Kconfig"

source "drivers/virt/coco/tdx-guest/Kconfig"

source "drivers/virt/coco/csv-guest/Kconfig"

endif
+1 −0
Original line number Diff line number Diff line
@@ -12,3 +12,4 @@ obj-$(CONFIG_ACRN_HSM) += acrn/
obj-$(CONFIG_EFI_SECRET)	+= coco/efi_secret/
obj-$(CONFIG_SEV_GUEST)		+= coco/sev-guest/
obj-$(CONFIG_INTEL_TDX_GUEST)	+= coco/tdx-guest/
obj-$(CONFIG_CSV_GUEST)		+= coco/csv-guest/
+12 −0
Original line number Diff line number Diff line
config CSV_GUEST
	tristate "HYGON CSV Guest driver"
	default m
	depends on HYGON_CSV
	help
	  CSV firmware provides the guest a mechanism to communicate with
	  the PSP without risk from a malicious hypervisor who wishes to read,
	  alter, drop or replay the messages sent. The driver provides
	  userspace interface to communicate with the PSP to request the
	  attestation report and more.

	  If you choose 'M' here, this module will be called csv-guest.
+2 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_CSV_GUEST) += csv-guest.o
Loading