Skip to content

Commit 1a277f7

Browse files
dbkinderwenlingz
authored andcommitted
doc: fix vuart-virt-hld errors
Fix "duplicate label" error (name of a figure collided with the name of a document). Also fixed very long lines, cleaned up some stray extra spaces that were breaking up words, and some grammar issues. Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
1 parent bbc228e commit 1a277f7

File tree

1 file changed

+58
-25
lines changed

1 file changed

+58
-25
lines changed

doc/developer-guides/hld/vuart-virt-hld.rst

Lines changed: 58 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@ vUART Virtualization
66
Architecture
77
************
88

9-
vUART is virtual 16550 uart implemented in hypervisor. It can work as a console or a communication port. Currently, the vuart is mapped to the traditional COM port address. Uart driver in kernel can auto detect the port base and irq.
9+
A vUART is a virtual 16550 UART implemented in the hypervisor. It can work as a
10+
console or a communication port. Currently, the vUART is mapped to the
11+
traditional COM port address. A UART driver in the kernel can auto detect the
12+
port base and IRQ.
1013

1114
.. figure:: images/uart-virt-hld-1.png
1215
:align: center
13-
:name: uart-arch
16+
:name: uart-arch-pic
1417

1518
UART virtualization architecture
1619

17-
Each vUART has two FIFOs, 8192 bytes Tx FIFO and 256 bytes Rx FIFO. Currently, we only provide 4 ports for use.
20+
Each vUART has two FIFOs: 8192 bytes Tx FIFO and 256 bytes Rx FIFO.
21+
Currently, we only provide 4 ports for use.
1822

1923
- COM1 (port base: 0x3F8, irq: 4)
2024

@@ -24,12 +28,20 @@ Each vUART has two FIFOs, 8192 bytes Tx FIFO and 256 bytes Rx FIFO. Currently,
2428

2529
- COM4 (port base: 0x2E8, irq: 7)
2630

27-
A VM can enable one console vuart and several communication vuarts.
31+
A VM can enable one console vUART and several communication vUARTs.
2832

2933
Console vUART
3034
*************
3135

32-
vUART can be used as a console port, and it can be activated by ``vm_console <vm_id>`` command in hypervisor console. From :numref:`console-uart-arch`, there is only one physical uart, but four console vuarts (green color blocks). A hypervisor console is implemented above the physical uart, and it works in polling mode. There is a timer in hv console, the timer handler dispatches the input from physical uart to the vuart or the hypervisor shell process and get data from vuart’s Tx FIFO and send to physical uart. The data in vuart’s FIFOs will be overwritten when it is not taken out intime.
36+
A vUART can be used as a console port, and it can be activated by
37+
a ``vm_console <vm_id>`` command in the hypervisor console. From
38+
:numref:`console-uart-arch`, there is only one physical UART, but four
39+
console vUARTs (green color blocks). A hypervisor console is implemented
40+
above the physical UART, and it works in polling mode. There is a timer
41+
in hv console. The timer handler dispatches the input from physical UART
42+
to the vUART or the hypervisor shell process and gets data from vUART's
43+
Tx FIFO and sends it to the physical UART. The data in vUART's FIFOs will be
44+
overwritten when it is not taken out in time.
3345

3446
.. figure:: images/uart-virt-hld-2.png
3547
:align: center
@@ -40,33 +52,37 @@ vUART can be used as a console port, and it can be activated by ``vm_console <v
4052
Communication vUART
4153
*******************
4254

43-
The communication vuart is used to transfer data between two VMs in low speed. For kernel driver, it is a general uart, can be detected and probed by 8250 serial driver. But in hypervisor, it has special process.
55+
The communication vUART is used to transfer data between two VMs in low
56+
speed. For kernel driver, it is a general UART, can be detected and
57+
probed by 8250 serial driver. But in hypervisor, it has special process.
4458

45-
From :numref:`communication-uart-arch`, the vuart in two VMs is connected according to the configuration in hypervisor. When user write a byte to the communication uart in VM0:
59+
From :numref:`communication-uart-arch`, the vUART in two VMs is
60+
connected according to the configuration in hypervisor. When user
61+
writes a byte to the communication UART in VM0:
4662

4763
Operations in VM0
4864

49-
- VM0 uart driver put the data to THR.
65+
- VM0 UART driver puts the data to THR.
5066

51-
- VM trap to hypervisor, and the vuart PIO handler is called.
67+
- VM traps to hypervisor, and the vUART PIO handler is called.
5268

53-
- Put the data to its target vuart’s Rx FIFO.
69+
- Puts the data to its target vUART's Rx FIFO.
5470

55-
- Inject a Data Ready interrupt to VM1.
71+
- Injects a Data Ready interrupt to VM1.
5672

57-
- If the target vuart’s FIFO is not full, inject a THRE interrupt to VM0.
73+
- If the target vUART's FIFO is not full, injects a THRE interrupt to VM0.
5874

59-
- Return.
75+
- Returns.
6076

6177
Operations in VM1
6278

63-
- Receive an interrupt, dispatch to uart driver.
79+
- Receives an interrupt, dispatches to UART driver.
6480

65-
- Read LSR register, find a Data Ready interrupt.
81+
- Reads LSR register, finds a Data Ready interrupt.
6682

67-
- Read data from Rx FIFO.
83+
- Reads data from Rx FIFO.
6884

69-
- If Rx FIFO is not full, inject THRE interrupt to VM0.
85+
- If Rx FIFO is not full, injects THRE interrupt to VM0.
7086

7187
.. figure:: images/uart-virt-hld-3.png
7288
:align: center
@@ -79,7 +95,11 @@ Usage
7995

8096
- For console vUART
8197

82-
To enable the console port for a VM, only need to change the port_base and irq in ``acrn-hypervi sor/hypervisor/scenarios/<scenario name>/vm_configurations.c``. If the irq number has been used in your system ( ``cat /proc/interrupt``), you can choose other IRQ number. Set the .irq =0, the vuart will work in polling mode.
98+
To enable the console port for a VM, change the
99+
port_base and IRQ in ``acrn-hypervisor/hypervisor/scenarios/<scenario
100+
name>/vm_configurations.c``. If the IRQ number has been used in your
101+
system ( ``cat /proc/interrupt``), you can choose other IRQ number. Set
102+
the .irq =0, the vUART will work in polling mode.
83103

84104
- COM1_BASE (0x3F8) + COM1_IRQ(4)
85105

@@ -97,16 +117,23 @@ Usage
97117
.irq = COM1_IRQ,
98118
}
99119

100-
The kernel bootargs ``console=ttySx`` should be the same with vuart[0], otherwise, the kernel co nsole log can not captured by hypervisor.Then, after bringup the system, you can switch the cons ole to the target VM by:
120+
The kernel bootargs ``console=ttySx`` should be the same with
121+
vuart[0], otherwise, the kernel console log can not captured by
122+
hypervisor. Then, after bringing up the system, you can switch the console
123+
to the target VM by:
101124

102125
.. code-block:: console
103-
126+
104127
ACRN:\>vm_console 0
105128
----- Entering VM 0 Shell -----
106129
107130
- For communication vUART
108-
109-
To enable the communication port, you should configure vuart[1] in the two VMs which want to com municate. The port_base and irq should not repeat with the vuart[0] in the same VM. t_vuart.vm_i d is the target VM's vm_id, start from 0 (0 means VM0). t_vuart.vuart_id is the target vuart ind ex in the target VM, start from 1 (1 means vuart[1]).
131+
132+
To enable the communication port, you should configure vuart[1] in
133+
the two VMs which want to communicate. The port_base and IRQ should
134+
not repeat with the vuart[0] in the same VM. t_vuart.vm_id is the
135+
target VM's vm_id, start from 0 (0 means VM0). t_vuart.vuart_id is the
136+
target vUART index in the target VM, start from 1 (1 means vuart[1]).
110137

111138
Example::
112139

@@ -130,7 +157,13 @@ Usage
130157
.t_vuart.vuart_id = 1U,
131158
},
132159

133-
.. note:: As the device mode also has virtual uart, and also use 0x3F8 and 0x2F8 as port base. If y ou add ``-s <slot>, lpc`` in launch script, the device model will create COM0 and COM1 for the p ost launched VM. It will also add the port info to ACPI table. This is useful for windows, vxwor ksas they probe driver according to ACPI table.
134-
135-
If user enable both the device model uart and hypervisor vuart in the same port address, the ac cess to the port address will be response by hypervisor vuart directly and will not pass to devi ce model.
160+
.. note:: The device mode also has a virtual UART, and also uses 0x3F8
161+
and 0x2F8 as port base. If you add ``-s <slot>, lpc`` in the launch
162+
script, the device model will create COM0 and COM1 for the post
163+
launched VM. It will also add the port info to the ACPI table. This is
164+
useful for Windows and vxworks as they probe the driver according to the ACPI
165+
table.
136166

167+
If user enables both the device model UART and hypervisor vUART at the
168+
same port address, access to the port address will be responded to
169+
by the hypervisor vUART directly, and will not pass to the device model.

0 commit comments

Comments
 (0)