All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yanteng Si <siyanteng@loongson.cn>
To: corbet@lwn.net, alexs@kernel.org, bobwxc@email.cn, seakeel@gmail.com
Cc: Yanteng Si <siyanteng@loongson.cn>,
	chenhuacai@kernel.org, jiaxun.yang@flygoat.com,
	linux-doc@vger.kernel.org, realpuyuwang@gmail.com,
	chenfeiyang@loongson.cn, chris.chenfeiyang@gmail.com,
	siyanteng01@gmail.com
Subject: [PATCH v2 7/8] docs/zh_CN: add virt acrn io-request translation
Date: Fri, 23 Jul 2021 10:45:43 +0800	[thread overview]
Message-ID: <7365c97d20503185d4a82a09e4ad82ce1ef72549.1627007853.git.siyanteng@loongson.cn> (raw)
In-Reply-To: <cover.1627007852.git.siyanteng@loongson.cn>

Translate Documentation/virt/acrn/io-request.rst into Chinese.

Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
---
 .../translations/zh_CN/virt/acrn/index.rst    |  3 +-
 .../zh_CN/virt/acrn/io-request.rst            | 99 +++++++++++++++++++
 2 files changed, 101 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/translations/zh_CN/virt/acrn/io-request.rst

diff --git a/Documentation/translations/zh_CN/virt/acrn/index.rst b/Documentation/translations/zh_CN/virt/acrn/index.rst
index 1daa0a187a7d..9c8bf5a9417c 100644
--- a/Documentation/translations/zh_CN/virt/acrn/index.rst
+++ b/Documentation/translations/zh_CN/virt/acrn/index.rst
@@ -21,9 +21,10 @@ ACRN管理平台
    :maxdepth: 1
 
    introduction
+   io-request
 
 TODOLIST:
 
 
-   io-request
+
    cpuid
diff --git a/Documentation/translations/zh_CN/virt/acrn/io-request.rst b/Documentation/translations/zh_CN/virt/acrn/io-request.rst
new file mode 100644
index 000000000000..54019be855d5
--- /dev/null
+++ b/Documentation/translations/zh_CN/virt/acrn/io-request.rst
@@ -0,0 +1,99 @@
+.. SPDX-License-Identifier: GPL-2.0
+.. include:: ../../disclaimer-zh_CN.rst
+
+:Original: Documentation/virt/acrn/io-request.rst
+
+:翻译:
+
+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
+
+:校译:
+
+
+
+.. _cn_virt_acrn_io-request:
+
+I/O请求处理
+===========
+
+客户虚拟机的I/O请求由管理平台构建,由ACRN管理平台服务模块分发到与I/O请求的地址范
+围相对应的I/O客户端。I/O请求处理的细节将在以下章节描述。
+
+1. I/O请求
+----------
+
+对于每个客户虚拟机,有一个共享的4KB字节的内存区域,用于管理平台和服务虚拟机之间的
+I/O请求通信。一个I/O请求是一个256字节的结构体缓冲区,它是 "acrn_io_request" 结构
+体,当客户虚拟机中发生被困的I/O访问时,由管理平台的I/O处理器填充。服务虚拟机中的
+ACRN用户空间首先分配一个4KB字节的页面,并将缓冲区的GPA(客户物理地址)传递给管理平
+台。缓冲区被用作16个I/O请求槽的数组,每个I/O请求槽为256字节。这个数组是按vCPU ID
+索引的。
+
+2. I/O客户端
+------------
+
+一个I/O客户端负责处理客户虚拟机的I/O请求,其访问的GPA在一定范围内。每个客户虚拟机
+可以关联多个I/O客户端。每个客户虚拟机都有一个特殊的客户端,称为默认客户端,负责处理
+所有不在其他客户端范围内的I/O请求。ACRN用户空间充当每个客户虚拟机的默认客户端。
+
+下面的图示显示了I/O请求共享缓冲区、I/O请求和I/O客户端之间的关系。
+
+::
+
+     +------------------------------------------------------+
+     |                                       服务VM         |
+     |+--------------------------------------------------+  |
+     ||      +----------------------------------------+  |  |
+     ||      | 共享页                 ACRN用户空间    |  |  |
+     ||      |    +-----------------+  +------------+ |  |  |
+     ||   +----+->| acrn_io_request |<-+  默认      | |  |  |
+     ||   |  | |  +-----------------+  | I/O客户端  | |  |  |
+     ||   |  | |  |       ...       |  +------------+ |  |  |
+     ||   |  | |  +-----------------+                 |  |  |
+     ||   |  +-|--------------------------------------+  |  |
+     ||---|----|-----------------------------------------|  |
+     ||   |    |                             内核        |  |
+     ||   |    |            +----------------------+     |  |
+     ||   |    |            | +-------------+  HSM |     |  |
+     ||   |    +--------------+             |      |     |  |
+     ||   |                 | | I/O客户端   |      |     |  |
+     ||   |                 | |             |      |     |  |
+     ||   |                 | +-------------+      |     |  |
+     ||   |                 +----------------------+     |  |
+     |+---|----------------------------------------------+  |
+     +----|-------------------------------------------------+
+          |
+     +----|-------------------------------------------------+
+     |  +-+-----------+                                     |
+     |  | I/O处理     |              ACRN管理平台           |
+     |  +-------------+                                     |
+     +------------------------------------------------------+
+
+3. I/O请求状态转换
+------------------
+
+一个ACRN I/O请求的状态转换如下。
+
+::
+
+   FREE -> PENDING -> PROCESSING -> COMPLETE -> FREE -> ...
+
+- FREE: 这个I/O请求槽是空的
+- PENDING: 在这个槽位上有一个有效的I/O请求正在等待
+- PROCESSING: 正在处理I/O请求
+- COMPLETE: 该I/O请求已被处理
+
+处于COMPLETE或FREE状态的I/O请求是由管理平台拥有的。HSM和ACRN用户空间负责处理其
+他的。
+
+4. I/O请求的处理流程
+--------------------
+
+a. 当客户虚拟机中发生被陷入的I/O访问时,管理平台的I/O处理程序将把I/O请求填充为
+   PENDING状态。
+b. 管理平台向服务虚拟机发出一个向上调用,这是一个通知中断。
+c. upcall处理程序会安排一个工作者来调度I/O请求。
+d. 工作者寻找PENDING I/O请求,根据I/O访问的地址将其分配给不同的注册客户,将其
+   状态更新为PROCESSING,并通知相应的客户进行处理。
+e. 被通知的客户端处理指定的I/O请求。
+f. HSM将I/O请求状态更新为COMPLETE,并通过hypercalls通知管理平台完成。
-- 
2.27.0


  parent reply	other threads:[~2021-07-23  2:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23  2:45 [PATCH v2 0/8] docs/zh_CN: add some virt docs translation Yanteng Si
2021-07-23  2:45 ` [PATCH v2 1/8] docs/zh_CN: add virt index translation Yanteng Si
2021-07-29 13:27   ` Alex Shi
2021-07-23  2:45 ` [PATCH v2 2/8] docs/zh_CN: add virt paravirt_ops translation Yanteng Si
2021-07-29 13:28   ` Alex Shi
2021-07-23  2:45 ` [PATCH v2 3/8] docs/zh_CN: add virt guest-halt-polling translation Yanteng Si
2021-07-29 13:26   ` Alex Shi
2021-07-23  2:45 ` [PATCH v2 4/8] docs/zh_CN: add virt ne_overview translation Yanteng Si
2021-07-29 13:29   ` Alex Shi
2021-07-23  2:45 ` [PATCH v2 5/8] docs/zh_CN: add virt acrn index translation Yanteng Si
2021-07-29 13:34   ` Alex Shi
2021-08-01  2:56     ` Alex Shi
2021-08-01  5:57       ` yanteng si
2021-07-23  2:45 ` [PATCH v2 6/8] docs/zh_CN: add virt acrn introduction translation Yanteng Si
2021-07-23  2:45 ` Yanteng Si [this message]
2021-07-23  2:45 ` [PATCH v2 8/8] docs/zh_CN: add virt acrn cpuid translation Yanteng Si

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7365c97d20503185d4a82a09e4ad82ce1ef72549.1627007853.git.siyanteng@loongson.cn \
    --to=siyanteng@loongson.cn \
    --cc=alexs@kernel.org \
    --cc=bobwxc@email.cn \
    --cc=chenfeiyang@loongson.cn \
    --cc=chenhuacai@kernel.org \
    --cc=chris.chenfeiyang@gmail.com \
    --cc=corbet@lwn.net \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=realpuyuwang@gmail.com \
    --cc=seakeel@gmail.com \
    --cc=siyanteng01@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.