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

@@ -232,46 +232,52 @@ DM Initialization
.. code-block:: c
vm_loop(struct vmctx *ctx)
{
int error;
vm_loop(struct vmctx *ctx)
{
int error;
ctx->ioreq_client = vm_create_ioreq_client(ctx);
assert(ctx->ioreq_client > 0);
ctx->ioreq_client = vm_create_ioreq_client(ctx);
if (ctx->ioreq_client < 0) {
pr_err("%s, failed to create IOREQ.\n", __func__);
return;
}
error = vm_run(ctx);
assert(error == 0);
if (vm_run(ctx) != 0) {
pr_err("%s, failed to run VM.\n", __func__);
return;
}
while (1) {
int vcpu_id;
struct vhm_request *vhm_req;
while (1) {
int vcpu_id;
struct acrn_io_request *io_req;
error = vm_attach_ioreq_client(ctx);
if (error)
break;
error = vm_attach_ioreq_client(ctx);
if (error)
break;
for (vcpu_id = 0; vcpu_id < 4; vcpu_id++) {
vhm_req = &vhm_req_buf[vcpu_id];
if ((atomic_load(&vhm_req->processed) == REQ_STATE_PROCESSING)
&& (vhm_req->client == ctx->ioreq_client))
handle_vmexit(ctx, vhm_req, vcpu_id);
}
for (vcpu_id = 0; vcpu_id < guest_ncpus; vcpu_id++) {
io_req = &ioreq_buf[vcpu_id];
if ((atomic_load(&io_req->processed) == ACRN_IOREQ_STATE_PROCESSING)
&& !io_req->kernel_handled)
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() ||
VM_SUSPEND_POWEROFF == vm_get_suspend_mode()) {
break;
}
}
if (VM_SUSPEND_SYSTEM_RESET == vm_get_suspend_mode()) {
vm_system_reset(ctx);
}
/* RTVM can't be reset */
if ((VM_SUSPEND_SYSTEM_RESET == vm_get_suspend_mode()) && (!is_rtvm)) {
vm_system_reset(ctx);
}
if (VM_SUSPEND_SUSPEND == vm_get_suspend_mode()) {
vm_suspend_resume(ctx);
}
}
printf("VM loop exit\n");
}
if (VM_SUSPEND_SUSPEND == vm_get_suspend_mode()) {
vm_suspend_resume(ctx);
}
}
pr_err("VM loop exit\n");
}
- **Mevent Dispatch Loop**: It's the final loop of the main acrn-dm
thread. mevent dispatch will do polling for potential async

View File

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

View File

@@ -265,23 +265,20 @@ Data Structures and 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
requests of different kinds.
.. doxygenstruct:: mmio_request
.. doxygenstruct:: acrn_mmio_request
:project: Project ACRN
.. doxygenstruct:: pio_request
.. doxygenstruct:: acrn_pio_request
:project: Project ACRN
.. doxygenstruct:: pci_request
.. doxygenstruct:: acrn_pci_request
:project: Project ACRN
.. doxygenunion:: vhm_io_request
:project: Project ACRN
.. doxygenstruct:: vhm_request
.. doxygenstruct:: acrn_io_request
:project: Project ACRN
For hypercalls related to I/O emulation, refer to `I/O Emulation in the Hypervisor`_.