doc: Adapt documents to new HSM driver

Tracked-On: #6282
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
This commit is contained in:
Shuo A Liu 2021-07-07 09:42:17 +08:00 committed by wenlingz
parent 4c9e9b9e4a
commit 7947b4dae8
5 changed files with 63 additions and 56 deletions

View File

@ -224,20 +224,7 @@ struct acrn_ioreq_notify {
#define ACRN_PLATFORM_LAPIC_IDS_MAX 64 #define ACRN_PLATFORM_LAPIC_IDS_MAX 64
/** /**
* struct acrn_platform_info - Information of a platform from hypervisor * @brief - Information of a platform from hypervisor
* @hw.cpu_num: Physical CPU number of the platform
* @hw.version: Version of this structure
* @hw.l2_cat_shift: Order of the number of threads sharing L2 cache
* @hw.l3_cat_shift: Order of the number of threads sharing L3 cache
* @hw.lapic_ids: IDs of LAPICs of all threads
* @hw.reserved: Reserved for alignment and should be 0
* @sw.max_vcpus_per_vm: Maximum number of vCPU of a VM
* @sw.max_vms: Maximum number of VM
* @sw.vm_config_size: Size of configuration of a VM
* @sw.vm_configss_addr: Memory address which user space provided to
* store the VM configurations
* @sw.max_kata_containers: Maximum number of VM for Kata containers
* @sw.reserved: Reserved for alignment and should be 0
* *
* If vm_configs_addr is provided, the driver uses a bounce buffer (kmalloced * If vm_configs_addr is provided, the driver uses a bounce buffer (kmalloced
* for continuous memory region) to fetch VM configurations data from the * for continuous memory region) to fetch VM configurations data from the
@ -245,19 +232,33 @@ struct acrn_ioreq_notify {
*/ */
struct acrn_platform_info { struct acrn_platform_info {
struct { struct {
/** Physical CPU number of the platform */
__u16 cpu_num; __u16 cpu_num;
/** Version of this structure */
__u16 version; __u16 version;
/** Order of the number of threads sharing L2 cache */
__u32 l2_cat_shift; __u32 l2_cat_shift;
/** Order of the number of threads sharing L3 cache */
__u32 l3_cat_shift; __u32 l3_cat_shift;
/** IDs of LAPICs of all threads */
__u8 lapic_ids[ACRN_PLATFORM_LAPIC_IDS_MAX]; __u8 lapic_ids[ACRN_PLATFORM_LAPIC_IDS_MAX];
/** Reserved for alignment and should be 0 */
__u8 reserved[52]; __u8 reserved[52];
} hw; } hw;
struct { struct {
/** Maximum number of vCPU of a VM */
__u16 max_vcpus_per_vm; __u16 max_vcpus_per_vm;
/** Maximum number of VM */
__u16 max_vms; __u16 max_vms;
/** Size of configuration of a VM */
__u32 vm_config_size; __u32 vm_config_size;
/** Memory address which user space provided to
* store the VM configurations
*/
void *vm_configs_addr; void *vm_configs_addr;
/** Maximum number of VM for Kata containers */
__u64 max_kata_containers; __u64 max_kata_containers;
__u8 reserved[104]; __u8 reserved[104];
} sw; } sw;

View File

@ -12,3 +12,6 @@
# #
^(?P<filename>[-._/\w]+/hld/[-._/\w]+.rst):(?P<lineno>[0-9]+): WARNING: Duplicate C[\+]* declaration, .* ^(?P<filename>[-._/\w]+/hld/[-._/\w]+.rst):(?P<lineno>[0-9]+): WARNING: Duplicate C[\+]* declaration, .*
^Declaration is .* ^Declaration is .*
#
^(?P<filename>[-._/\w]+/api/[-._/\w]+.rst):(?P<lineno>[0-9]+): WARNING: Duplicate C[\+]* declaration, .*
^Declaration is .*

View File

@ -237,24 +237,29 @@ DM Initialization
int error; int error;
ctx->ioreq_client = vm_create_ioreq_client(ctx); ctx->ioreq_client = vm_create_ioreq_client(ctx);
assert(ctx->ioreq_client > 0); if (ctx->ioreq_client < 0) {
pr_err("%s, failed to create IOREQ.\n", __func__);
return;
}
error = vm_run(ctx); if (vm_run(ctx) != 0) {
assert(error == 0); pr_err("%s, failed to run VM.\n", __func__);
return;
}
while (1) { while (1) {
int vcpu_id; int vcpu_id;
struct vhm_request *vhm_req; struct acrn_io_request *io_req;
error = vm_attach_ioreq_client(ctx); error = vm_attach_ioreq_client(ctx);
if (error) if (error)
break; break;
for (vcpu_id = 0; vcpu_id < 4; vcpu_id++) { for (vcpu_id = 0; vcpu_id < guest_ncpus; vcpu_id++) {
vhm_req = &vhm_req_buf[vcpu_id]; io_req = &ioreq_buf[vcpu_id];
if ((atomic_load(&vhm_req->processed) == REQ_STATE_PROCESSING) if ((atomic_load(&io_req->processed) == ACRN_IOREQ_STATE_PROCESSING)
&& (vhm_req->client == ctx->ioreq_client)) && !io_req->kernel_handled)
handle_vmexit(ctx, vhm_req, vcpu_id); handle_vmexit(ctx, io_req, vcpu_id);
} }
if (VM_SUSPEND_FULL_RESET == vm_get_suspend_mode() || if (VM_SUSPEND_FULL_RESET == vm_get_suspend_mode() ||
@ -262,7 +267,8 @@ DM Initialization
break; break;
} }
if (VM_SUSPEND_SYSTEM_RESET == vm_get_suspend_mode()) { /* RTVM can't be reset */
if ((VM_SUSPEND_SYSTEM_RESET == vm_get_suspend_mode()) && (!is_rtvm)) {
vm_system_reset(ctx); vm_system_reset(ctx);
} }
@ -270,7 +276,7 @@ DM Initialization
vm_suspend_resume(ctx); vm_suspend_resume(ctx);
} }
} }
printf("VM loop exit\n"); pr_err("VM loop exit\n");
} }
- **Mevent Dispatch Loop**: It's the final loop of the main acrn-dm - **Mevent Dispatch Loop**: It's the final loop of the main acrn-dm

View File

@ -26,7 +26,7 @@ Hypervisor module named CPU state table:
.. code-block:: c .. code-block:: c
struct cpu_px_data { struct cpu_pstate_data {
uint64_t core_frequency; /* megahertz */ uint64_t core_frequency; /* megahertz */
uint64_t power; /* milliWatts */ uint64_t power; /* milliWatts */
uint64_t transition_latency; /* microseconds */ uint64_t transition_latency; /* microseconds */
@ -35,7 +35,7 @@ Hypervisor module named CPU state table:
uint64_t status; /* success indicator */ uint64_t status; /* success indicator */
} __attribute__((aligned(8))); } __attribute__((aligned(8)));
struct acpi_generic_address { struct acrn_acpi_generic_address {
uint8_t space_id; uint8_t space_id;
uint8_t bit_width; uint8_t bit_width;
uint8_t bit_offset; uint8_t bit_offset;
@ -43,8 +43,8 @@ Hypervisor module named CPU state table:
uint64_t address; uint64_t address;
} __attribute__((aligned(8))); } __attribute__((aligned(8)));
struct cpu_cx_data { struct cpu_cstate_data {
struct acpi_generic_address cx_reg; struct acrn_acpi_generic_address cx_reg;
uint8_t type; uint8_t type;
uint32_t latency; uint32_t latency;
uint64_t power; uint64_t power;

View File

@ -265,23 +265,20 @@ Data Structures and Interfaces
External Interfaces External Interfaces
=================== ===================
The following structures represent an I/O request. *struct vhm_request* The following structures represent an I/O request. *struct acrn_io_request*
is the main structure and the others are detailed representations of I/O is the main structure and the others are detailed representations of I/O
requests of different kinds. requests of different kinds.
.. doxygenstruct:: mmio_request .. doxygenstruct:: acrn_mmio_request
:project: Project ACRN :project: Project ACRN
.. doxygenstruct:: pio_request .. doxygenstruct:: acrn_pio_request
:project: Project ACRN :project: Project ACRN
.. doxygenstruct:: pci_request .. doxygenstruct:: acrn_pci_request
:project: Project ACRN :project: Project ACRN
.. doxygenunion:: vhm_io_request .. doxygenstruct:: acrn_io_request
:project: Project ACRN
.. doxygenstruct:: vhm_request
:project: Project ACRN :project: Project ACRN
For hypercalls related to I/O emulation, refer to `I/O Emulation in the Hypervisor`_. For hypercalls related to I/O emulation, refer to `I/O Emulation in the Hypervisor`_.