2018-12-14 07:19:14 +08:00
|
|
|
.. _partition-mode-hld:
|
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
Partition Mode
|
2018-12-14 07:19:14 +08:00
|
|
|
##############
|
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
ACRN is a type 1 hypervisor that supports running multiple guest operating
|
2020-03-30 06:37:33 +08:00
|
|
|
systems (OS). Typically, the platform BIOS/bootloader boots ACRN, and
|
2018-12-14 07:19:14 +08:00
|
|
|
ACRN loads single or multiple guest OSes. Refer to :ref:`hv-startup` for
|
|
|
|
details on the start-up flow of the ACRN hypervisor.
|
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
ACRN supports two modes of operation: sharing mode and partition mode.
|
|
|
|
This document describes ACRN's high-level design for partition mode
|
2018-12-14 07:19:14 +08:00
|
|
|
support.
|
|
|
|
|
|
|
|
.. contents::
|
|
|
|
:depth: 2
|
|
|
|
:local:
|
|
|
|
|
|
|
|
Introduction
|
|
|
|
************
|
|
|
|
|
|
|
|
In partition mode, ACRN provides guests with exclusive access to cores,
|
|
|
|
memory, cache, and peripheral devices. Partition mode enables developers
|
2020-03-30 06:37:33 +08:00
|
|
|
to dedicate resources exclusively among the guests. However, there is no
|
2018-12-14 07:19:14 +08:00
|
|
|
support today in x86 hardware or in ACRN to partition resources such as
|
2021-11-13 03:15:39 +08:00
|
|
|
peripheral buses (e.g., PCI). On x86 platforms that support Cache
|
|
|
|
Allocation Technology (CAT) and Memory Bandwidth Allocation (MBA), developers
|
|
|
|
can partition Level 2 (L2) cache, Last Level Cache (LLC), and memory bandwidth
|
|
|
|
among the guests. Refer to
|
2020-03-26 12:20:08 +08:00
|
|
|
:ref:`hv_rdt` for more details on ACRN RDT high-level design and
|
|
|
|
:ref:`rdt_configuration` for RDT configuration.
|
|
|
|
|
2018-12-14 07:19:14 +08:00
|
|
|
|
|
|
|
ACRN expects static partitioning of resources either by code
|
|
|
|
modification for guest configuration or through compile-time config
|
|
|
|
options. All the devices exposed to the guests are either physical
|
2021-11-13 03:15:39 +08:00
|
|
|
resources or are emulated in the hypervisor. There is no need for a
|
|
|
|
Device Model and Service VM. :numref:`pmode2vms` shows a partition mode
|
2018-12-14 07:19:14 +08:00
|
|
|
example of two VMs with exclusive access to physical resources.
|
|
|
|
|
|
|
|
.. figure:: images/partition-image3.png
|
|
|
|
:align: center
|
|
|
|
:name: pmode2vms
|
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
Partition Mode Example with Two VMs
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
Guest Info
|
2018-12-14 07:19:14 +08:00
|
|
|
**********
|
|
|
|
|
2020-03-30 06:37:33 +08:00
|
|
|
ACRN uses multi-boot info passed from the platform bootloader to know
|
2018-12-14 07:19:14 +08:00
|
|
|
the location of each guest kernel in memory. ACRN creates a copy of each
|
|
|
|
guest kernel into each of the guests' memory. Current implementation of
|
|
|
|
ACRN requires developers to specify kernel parameters for the guests as
|
2021-11-13 03:15:39 +08:00
|
|
|
part of the guest configuration. ACRN picks up kernel parameters from the guest
|
2018-12-14 07:19:14 +08:00
|
|
|
configuration and copies them to the corresponding guest memory.
|
|
|
|
|
|
|
|
.. figure:: images/partition-image18.png
|
|
|
|
:align: center
|
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
Guest Info
|
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
ACRN Setup for Guests
|
2020-09-26 07:24:35 +08:00
|
|
|
*********************
|
2018-12-14 07:19:14 +08:00
|
|
|
|
|
|
|
Cores
|
|
|
|
=====
|
|
|
|
|
|
|
|
ACRN requires the developer to specify the number of guests and the
|
2020-03-30 06:37:33 +08:00
|
|
|
cores dedicated for each guest. Also, the developer needs to specify
|
2021-11-13 03:15:39 +08:00
|
|
|
the physical core used as the bootstrap processor (BSP) for each guest. As
|
2018-12-14 07:19:14 +08:00
|
|
|
the processors are brought to life in the hypervisor, it checks if they are
|
2021-11-13 03:15:39 +08:00
|
|
|
configured as BSP for any of the guests. If a processor is the BSP of any of
|
2018-12-14 07:19:14 +08:00
|
|
|
the guests, ACRN proceeds to build the memory mapping for the guest,
|
|
|
|
mptable, E820 entries, and zero page for the guest. As described in
|
|
|
|
`Guest info`_, ACRN creates copies of guest kernel and kernel
|
|
|
|
parameters into guest memory. :numref:`partBSPsetup` explains these
|
|
|
|
events in chronological order.
|
|
|
|
|
|
|
|
.. figure:: images/partition-image7.png
|
|
|
|
:align: center
|
|
|
|
:name: partBSPsetup
|
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
Event Order for Processor Setup
|
2021-04-22 05:00:59 +08:00
|
|
|
|
2018-12-14 07:19:14 +08:00
|
|
|
Memory
|
|
|
|
======
|
|
|
|
|
|
|
|
For each guest in partition mode, the ACRN developer specifies the size of
|
|
|
|
memory for the guest and the starting address in the host physical
|
|
|
|
address in the guest configuration. There is no support for HIGHMEM for
|
|
|
|
partition mode guests. The developer needs to take care of two aspects
|
|
|
|
for assigning host memory to the guests:
|
|
|
|
|
|
|
|
1) Sum of guest PCI hole and guest "System RAM" is less than 4GB.
|
|
|
|
|
|
|
|
2) Pick the starting address in the host physical address and the
|
2020-03-30 06:37:33 +08:00
|
|
|
size so that it does not overlap with any reserved regions in
|
2018-12-14 07:19:14 +08:00
|
|
|
host E820.
|
|
|
|
|
|
|
|
ACRN creates EPT mapping for the guest between GPA (0, memory size) and
|
|
|
|
HPA (starting address in guest configuration, memory size).
|
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
E820 and Zero Page Info
|
2018-12-14 07:19:14 +08:00
|
|
|
=======================
|
|
|
|
|
|
|
|
A default E820 is used for all the guests in partition mode. This table
|
|
|
|
shows the reference E820 layout. Zero page is created with this
|
2021-11-13 03:15:39 +08:00
|
|
|
E820 info for all the guests.
|
2018-12-14 07:19:14 +08:00
|
|
|
|
|
|
|
+------------------------+
|
|
|
|
| RAM |
|
|
|
|
| |
|
|
|
|
| 0 - 0xEFFFFH |
|
|
|
|
+------------------------+
|
|
|
|
| RESERVED (MPTABLE) |
|
|
|
|
| |
|
|
|
|
| 0xF0000H - 0x100000H |
|
|
|
|
+------------------------+
|
|
|
|
| RAM |
|
|
|
|
| |
|
|
|
|
| 0x100000H - LOWMEM |
|
|
|
|
+------------------------+
|
|
|
|
| RESERVED |
|
|
|
|
+------------------------+
|
|
|
|
| PCI HOLE |
|
|
|
|
+------------------------+
|
|
|
|
| RESERVED |
|
|
|
|
+------------------------+
|
|
|
|
|
2021-02-23 20:06:29 +08:00
|
|
|
Platform Info - mptable
|
2018-12-14 07:19:14 +08:00
|
|
|
=======================
|
|
|
|
|
|
|
|
ACRN, in partition mode, uses mptable to convey platform info to each
|
2020-03-30 06:37:33 +08:00
|
|
|
guest. Using this platform information, number of cores used for each
|
2018-12-14 07:19:14 +08:00
|
|
|
guest, and whether the guest needs devices with INTX, ACRN builds
|
|
|
|
mptable and copies it to the guest memory. In partition mode, ACRN uses
|
|
|
|
physical APIC IDs to pass to the guests.
|
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
I/O - Virtual Devices
|
2018-12-14 07:19:14 +08:00
|
|
|
=====================
|
|
|
|
|
|
|
|
Port I/O is supported for PCI device config space 0xcfc and 0xcf8, vUART
|
|
|
|
0x3f8, vRTC 0x70 and 0x71, and vPIC ranges 0x20/21, 0xa0/a1, and
|
2020-03-30 06:37:33 +08:00
|
|
|
0x4d0/4d1. MMIO is supported for vIOAPIC. ACRN exposes a virtual
|
2018-12-14 07:19:14 +08:00
|
|
|
host-bridge at BDF (Bus Device Function) 0.0:0 to each guest. Access to
|
|
|
|
256 bytes of config space for virtual host bridge is emulated.
|
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
I/O - Passthrough Devices
|
2020-06-19 02:38:09 +08:00
|
|
|
=========================
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
ACRN, in partition mode, supports passing through PCI devices on the
|
2020-06-19 02:38:09 +08:00
|
|
|
platform. All the passthrough devices are exposed as child devices under
|
2021-11-13 03:15:39 +08:00
|
|
|
the virtual host bridge. ACRN does not support either passing through
|
2020-06-19 02:38:09 +08:00
|
|
|
bridges or emulating virtual bridges. Passthrough devices should be
|
2018-12-14 07:19:14 +08:00
|
|
|
statically allocated to each guest using the guest configuration. ACRN
|
|
|
|
expects the developer to provide the virtual BDF to BDF of the
|
2020-06-19 02:38:09 +08:00
|
|
|
physical device mapping for all the passthrough devices as part of each guest
|
2020-03-30 06:37:33 +08:00
|
|
|
configuration.
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
Runtime ACRN Support for Guests
|
2020-03-30 06:37:33 +08:00
|
|
|
*******************************
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
ACRN, in partition mode, supports an option to pass through LAPIC of the
|
2018-12-14 07:19:14 +08:00
|
|
|
physical CPUs to the guest. ACRN expects developers to specify if the
|
2021-11-13 03:15:39 +08:00
|
|
|
guest needs LAPIC passthrough using guest configuration. When the guest
|
2018-12-14 07:19:14 +08:00
|
|
|
configures vLAPIC as x2APIC, and if the guest configuration has LAPIC
|
2021-11-13 03:15:39 +08:00
|
|
|
passthrough enabled, ACRN passes the LAPIC to the guest. The guest can access
|
2018-12-14 07:19:14 +08:00
|
|
|
the LAPIC hardware directly without hypervisor interception. During
|
|
|
|
runtime of the guest, this option differentiates how ACRN supports
|
|
|
|
inter-processor interrupt handling and device interrupt handling. This
|
|
|
|
will be discussed in detail in the corresponding sections.
|
|
|
|
|
|
|
|
.. figure:: images/partition-image16.png
|
|
|
|
:align: center
|
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
LAPIC Passthrough
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
Guest SMP Boot Flow
|
2018-12-14 07:19:14 +08:00
|
|
|
===================
|
|
|
|
|
|
|
|
The core APIC IDs are reported to the guest using mptable info. SMP boot
|
|
|
|
flow is similar to sharing mode. Refer to :ref:`vm-startup`
|
2021-11-13 03:15:39 +08:00
|
|
|
for guest SMP boot flow in ACRN. Partition mode guests startup is the same as
|
2020-04-11 01:44:30 +08:00
|
|
|
the Service VM startup in sharing mode.
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
Inter-Processor Interrupt (IPI) Handling
|
2018-12-14 07:19:14 +08:00
|
|
|
========================================
|
|
|
|
|
2021-02-23 20:06:29 +08:00
|
|
|
Guests Without LAPIC Passthrough
|
|
|
|
--------------------------------
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2020-06-19 02:38:09 +08:00
|
|
|
For guests without LAPIC passthrough, IPIs between guest CPUs are handled in
|
2020-03-30 06:37:33 +08:00
|
|
|
the same way as sharing mode in ACRN. Refer to :ref:`virtual-interrupt-hld`
|
2018-12-14 07:19:14 +08:00
|
|
|
for more details.
|
|
|
|
|
2021-02-23 20:06:29 +08:00
|
|
|
Guests With LAPIC Passthrough
|
|
|
|
-----------------------------
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2020-06-19 02:38:09 +08:00
|
|
|
ACRN supports passthrough if and only if the guest is using x2APIC mode
|
|
|
|
for the vLAPIC. In LAPIC passthrough mode, writes to the Interrupt Command
|
2021-11-13 03:15:39 +08:00
|
|
|
Register (ICR) x2APIC MSR are intercepted. The guest writes the IPI info,
|
2020-03-30 06:37:33 +08:00
|
|
|
including vector, and destination APIC IDs to the ICR. Upon an IPI request
|
|
|
|
from the guest, ACRN does a sanity check on the destination processors
|
|
|
|
programmed into the ICR. If the destination is a valid target for the guest,
|
|
|
|
ACRN sends an IPI with the same vector from the ICR to the physical CPUs
|
|
|
|
corresponding to the destination processor info in the ICR.
|
2018-12-14 07:19:14 +08:00
|
|
|
|
|
|
|
.. figure:: images/partition-image14.png
|
|
|
|
:align: center
|
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
IPI Handling for Guests With LAPIC Passthrough
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
Passthrough Device Support
|
2020-06-19 02:38:09 +08:00
|
|
|
==========================
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
Configuration Space Access
|
2018-12-14 07:19:14 +08:00
|
|
|
--------------------------
|
|
|
|
|
|
|
|
ACRN emulates Configuration Space Address (0xcf8) I/O port and
|
|
|
|
Configuration Space Data (0xcfc) I/O port for guests to access PCI
|
|
|
|
devices configuration space. Within the config space of a device, Base
|
|
|
|
Address registers (BAR), offsets starting from 0x10H to 0x24H, provide
|
|
|
|
the information about the resources (I/O and MMIO) used by the PCI
|
|
|
|
device. ACRN virtualizes the BAR registers and for the rest of the
|
|
|
|
config space, forwards reads and writes to the physical config space of
|
2020-06-19 02:38:09 +08:00
|
|
|
passthrough devices. Refer to the `I/O`_ section below for more details.
|
2018-12-14 07:19:14 +08:00
|
|
|
|
|
|
|
.. figure:: images/partition-image1.png
|
|
|
|
:align: center
|
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
Configuration Space Access
|
2018-12-14 07:19:14 +08:00
|
|
|
|
|
|
|
DMA
|
|
|
|
---
|
|
|
|
|
2020-06-19 02:38:09 +08:00
|
|
|
ACRN developers need to statically define the passthrough devices for each
|
2018-12-14 07:19:14 +08:00
|
|
|
guest using the guest configuration. For devices to DMA to/from guest
|
2020-06-19 02:38:09 +08:00
|
|
|
memory directly, ACRN parses the list of passthrough devices for each
|
2018-12-14 07:19:14 +08:00
|
|
|
guest and creates context entries in the VT-d remapping hardware. EPT
|
|
|
|
page tables created for the guest are used for VT-d page tables.
|
|
|
|
|
|
|
|
I/O
|
|
|
|
---
|
|
|
|
|
2020-06-19 02:38:09 +08:00
|
|
|
ACRN supports I/O for passthrough devices with two restrictions.
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2020-03-30 06:37:33 +08:00
|
|
|
1) Supports only MMIO. Thus, this requires developers to expose I/O BARs as
|
2018-12-14 07:19:14 +08:00
|
|
|
not present in the guest configuration.
|
|
|
|
|
|
|
|
2) Supports only 32-bit MMIO BAR type.
|
|
|
|
|
2020-03-30 06:37:33 +08:00
|
|
|
As the guest PCI sub-system scans the PCI bus and assigns a Guest Physical
|
|
|
|
Address (GPA) to the MMIO BAR, ACRN maps the GPA to the address in the
|
2020-06-19 02:38:09 +08:00
|
|
|
physical BAR of the passthrough device using EPT. The following timeline chart
|
2021-11-13 03:15:39 +08:00
|
|
|
explains how PCI devices are assigned to the guest and how BARs are mapped upon
|
2018-12-14 07:19:14 +08:00
|
|
|
guest initialization.
|
|
|
|
|
|
|
|
.. figure:: images/partition-image13.png
|
|
|
|
:align: center
|
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
I/O for Passthrough Devices
|
2018-12-14 07:19:14 +08:00
|
|
|
|
|
|
|
Interrupt Configuration
|
|
|
|
-----------------------
|
|
|
|
|
2020-06-19 02:38:09 +08:00
|
|
|
ACRN supports both legacy (INTx) and MSI interrupts for passthrough
|
2018-12-14 07:19:14 +08:00
|
|
|
devices.
|
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
INTx Support
|
2018-12-14 07:19:14 +08:00
|
|
|
~~~~~~~~~~~~
|
|
|
|
|
|
|
|
ACRN expects developers to identify the interrupt line info (0x3CH) from
|
2020-06-19 02:38:09 +08:00
|
|
|
the physical BAR of the passthrough device and build an interrupt entry in
|
2021-11-13 03:15:39 +08:00
|
|
|
the mptable for the corresponding guest. As the guest configures the vIOAPIC
|
2018-12-14 07:19:14 +08:00
|
|
|
for the interrupt RTE, ACRN writes the info from the guest RTE into the
|
2020-03-30 06:37:33 +08:00
|
|
|
physical IOAPIC RTE. Upon the guest kernel request to mask the interrupt,
|
2018-12-14 07:19:14 +08:00
|
|
|
ACRN writes to the physical RTE to mask the interrupt at the physical
|
2021-11-13 03:15:39 +08:00
|
|
|
IOAPIC. When the guest masks the RTE in vIOAPIC, ACRN masks the interrupt
|
2018-12-14 07:19:14 +08:00
|
|
|
RTE in the physical IOAPIC. Level triggered interrupts are not
|
|
|
|
supported.
|
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
MSI Support
|
2018-12-14 07:19:14 +08:00
|
|
|
~~~~~~~~~~~
|
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
The guest reads/writes to the PCI configuration space to configure MSI
|
|
|
|
interrupts using an address. Data and control registers are passed through to
|
2020-06-19 02:38:09 +08:00
|
|
|
the physical BAR of the passthrough device. Refer to `Configuration
|
2021-11-13 03:15:39 +08:00
|
|
|
Space Access`_ for details on how the PCI configuration space is emulated.
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
Virtual Device Support
|
2018-12-14 07:19:14 +08:00
|
|
|
======================
|
|
|
|
|
|
|
|
ACRN provides read-only vRTC support for partition mode guests. Writes
|
|
|
|
to the data port are discarded.
|
|
|
|
|
|
|
|
For port I/O to ports other than vPIC, vRTC, or vUART, reads return 0xFF and
|
|
|
|
writes are discarded.
|
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
Interrupt Delivery
|
2018-12-14 07:19:14 +08:00
|
|
|
==================
|
|
|
|
|
2021-02-23 20:06:29 +08:00
|
|
|
Guests Without LAPIC Passthrough
|
|
|
|
--------------------------------
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
In ACRN partition mode, interrupts stay disabled after a vmexit. The
|
2018-12-14 07:19:14 +08:00
|
|
|
processor does not take interrupts when it is executing in VMX root
|
|
|
|
mode. ACRN configures the processor to take vmexit upon external
|
|
|
|
interrupt if the processor is executing in VMX non-root mode. Upon an
|
|
|
|
external interrupt, after sending EOI to the physical LAPIC, ACRN
|
2021-11-13 03:15:39 +08:00
|
|
|
injects the vector into the vLAPIC of the vCPU currently running on the
|
|
|
|
processor. Guests using a Linux kernel use vectors less than 0xECh
|
2018-12-14 07:19:14 +08:00
|
|
|
for device interrupts.
|
|
|
|
|
|
|
|
.. figure:: images/partition-image20.png
|
|
|
|
:align: center
|
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
Interrupt Delivery for Guests Without LAPIC Passthrough
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2021-02-23 20:06:29 +08:00
|
|
|
Guests With LAPIC Passthrough
|
|
|
|
-----------------------------
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2020-06-19 02:38:09 +08:00
|
|
|
For guests with LAPIC passthrough, ACRN does not configure vmexit upon
|
2018-12-14 07:19:14 +08:00
|
|
|
external interrupts. There is no vmexit upon device interrupts and they are
|
|
|
|
handled by the guest IDT.
|
|
|
|
|
2021-02-13 08:27:24 +08:00
|
|
|
Hypervisor IPI Service
|
2018-12-14 07:19:14 +08:00
|
|
|
======================
|
|
|
|
|
|
|
|
ACRN needs IPIs for events such as flushing TLBs across CPUs, sending virtual
|
2021-11-13 03:15:39 +08:00
|
|
|
device interrupts (e.g., vUART to vCPUs), and others.
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2021-02-23 20:06:29 +08:00
|
|
|
Guests Without LAPIC Passthrough
|
|
|
|
--------------------------------
|
2018-12-14 07:19:14 +08:00
|
|
|
|
|
|
|
Hypervisor IPIs work the same way as in sharing mode.
|
|
|
|
|
2021-02-23 20:06:29 +08:00
|
|
|
Guests With LAPIC Passthrough
|
|
|
|
-----------------------------
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
Since external interrupts are passed through to the guest IDT, IPIs do not
|
2018-12-14 07:19:14 +08:00
|
|
|
trigger vmexit. ACRN uses NMI delivery mode and the NMI exiting is
|
|
|
|
chosen for vCPUs. At the time of NMI interrupt on the target processor,
|
|
|
|
if the processor is in non-root mode, vmexit happens on the processor
|
|
|
|
and the event mask is checked for servicing the events.
|
|
|
|
|
|
|
|
Debug Console
|
|
|
|
=============
|
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
For details on how the hypervisor console works, refer to
|
2018-12-14 07:19:14 +08:00
|
|
|
:ref:`hv-console`.
|
|
|
|
|
|
|
|
For a guest console in partition mode, ACRN provides an option to pass
|
2020-03-30 06:37:33 +08:00
|
|
|
``vmid`` as an argument to ``vm_console``. vmid is the same as the one
|
|
|
|
developers use in the guest configuration.
|
2018-12-14 07:19:14 +08:00
|
|
|
|
2021-02-23 20:06:29 +08:00
|
|
|
Guests Without LAPIC Passthrough
|
|
|
|
--------------------------------
|
2018-12-14 07:19:14 +08:00
|
|
|
|
|
|
|
Works the same way as sharing mode.
|
|
|
|
|
|
|
|
Hypervisor Console
|
|
|
|
==================
|
|
|
|
|
2020-03-30 06:37:33 +08:00
|
|
|
ACRN uses the TSC deadline timer to provide a timer service. The hypervisor
|
2018-12-14 07:19:14 +08:00
|
|
|
console uses a timer on CPU0 to poll characters on the serial device. To
|
2021-11-13 03:15:39 +08:00
|
|
|
support LAPIC passthrough, the TSC deadline MSR is passed through and the local
|
2020-03-30 06:37:33 +08:00
|
|
|
timer interrupt is also delivered to the guest IDT. Instead of the TSC
|
|
|
|
deadline timer, ACRN uses the VMX preemption timer to poll the serial device.
|
2018-12-14 07:19:14 +08:00
|
|
|
|
|
|
|
Guest Console
|
|
|
|
=============
|
|
|
|
|
2021-11-13 03:15:39 +08:00
|
|
|
ACRN exposes vUART to partition mode guests. vUART uses vPIC to inject an
|
|
|
|
interrupt to the guest BSP. If the guest has more than one core,
|
2020-03-30 06:37:33 +08:00
|
|
|
during runtime, vUART might need to inject an interrupt to the guest BSP from
|
2021-11-13 03:15:39 +08:00
|
|
|
another core (other than BSP). As mentioned in section `Hypervisor IPI
|
|
|
|
Service`_, ACRN uses NMI delivery mode for notifying the CPU running the BSP
|
2018-12-14 07:19:14 +08:00
|
|
|
of the guest.
|