From 503b71a16e9c050281547210a9c36b63bf144a6c Mon Sep 17 00:00:00 2001 From: Jason Chen CJ Date: Thu, 27 Jun 2019 20:28:40 +0800 Subject: [PATCH] doc: add guideline for RTVM workload design a quick guideline document help RTOS designer/developer to design RT workload based on RTVM Signed-off-by: Jason Chen CJ --- .../rtvm_workload_design_guideline.rst | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 doc/tutorials/rtvm_workload_design_guideline.rst diff --git a/doc/tutorials/rtvm_workload_design_guideline.rst b/doc/tutorials/rtvm_workload_design_guideline.rst new file mode 100644 index 000000000..f2c7b4a70 --- /dev/null +++ b/doc/tutorials/rtvm_workload_design_guideline.rst @@ -0,0 +1,45 @@ +.. _rtvm_workload_guideline: + +Real time VM application design guidelines +########################################## + +An RTOS developer must be aware of the differences between running applications on a native +platform and a real time virtual machine (RTVM), especially issues impacting real time +performance. For example, a real time thread should avoid triggering any VM-Exit. If a VM-Exit +is triggered, the developer must account for an additional margin of CPU cycles for the +incremental runtime overhead. + +This document provides some application design guidelines when using an RTVM within the ACRN hypervisor. + +Run RTVM with dedicated resources/devices +***************************************** + +For best practice, ACRN allocates dedicated CPU, memory resources, and cache resources (using Intel +Cache Allocation Technology, aka CAT) to RTVMs. For best real time performance of I/O devices, +we recommend using dedicated (pass-thru) PCIe devices to avoid VM-Exit at run time. + +.. note:: + The configuration space for pass-thru PCI devices is still emulated and the accessing it will + trigger a VM-Exit. + +RTVM with virtio PMD (Polling Mode Driver) for I/O sharing +********************************************************** + +If the RTVM must use shared devices, we recommend using PMD drivers that can eliminate the +unpredictable latency caused by guest I/O trap-and-emulate access. The RTVM application must be +aware that the packets in the PMD driver may arrive or be sent later than expected. + +RTVM with HV Emulated Device +**************************** + +ACRN uses hypervisor emulated virtual UART (vUART) devices for inter-VM synchronization such as +logging output, or command send/receive. Currently, the vUART only works in polling mode, but +may be extended to support interrupt mode in a future release. In the meantime, for better RT +behavior, the RT application using the vUART shall reserve a margin of CPU cycles to accommodate +for the additional latency introduced by the VM-Exit to the vUART I/O registers (~2000--3000 cycles +per register access). + +DM emulated device (Except PMD) +******************************* + +We recommend **not** using DM-emulated devices in a RTVM.