Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

MINIBALL: add CPU virtualization docs #188

Merged

Conversation

yaoyinnan
Copy link
Contributor

Add description document for CPU virtualization part. Modify the description of CPU virtualization in MiniBall's README.md.

Fixes: #187

Signed-off-by: yaoyinnan yaoyinnan@foxmail.com

@codecov
Copy link

codecov bot commented Aug 10, 2022

Codecov Report

Merging #188 (16c8b74) into main (cea08cf) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #188   +/-   ##
=======================================
  Coverage   86.24%   86.24%           
=======================================
  Files          81       81           
  Lines       21404    21404           
=======================================
  Hits        18460    18460           
  Misses       2944     2944           
Flag Coverage Δ
dbs-address-space 68.36% <ø> (ø)
dbs-allocator 81.99% <ø> (ø)
dbs-arch 96.30% <ø> (ø)
dbs-boot 65.41% <ø> (ø)
dbs-device 91.84% <ø> (ø)
dbs-interrupt 90.40% <ø> (ø)
dbs-legacy-devices 92.77% <ø> (ø)
dbs-upcall 94.26% <ø> (ø)
dbs-utils 91.25% <ø> (ø)
dbs-virtio-devices 86.05% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

# CPU 虚拟化

## 概述
在配置 KVM、guest memory 后,开始配置 vCPU。通过 dbs-boot、dbs-arch、kvm-ioctls crates 完成。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls use English or Chinese&English

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I have discussed with @yaoyinnan, he should first finish all the virtualization-related documents in his preferred language. And he could translate it to English when he has extra time. The important part of this project is virtualization knowledge instead of language translation.

But @yaoyinnan, could you add an comment/tip here to tell potential readers why there is only Chinese here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as @studychao said. Since my current main task is to build a simple virtual machine to sort out the virtualization knowledge points, the document is in Chinese. After I have free time, I will sync it for translation.


为了获得处理器信息,操作系统有两种获取处理器信息的方式:一种是 Intel 的 Multi Processor Specification(后续简称 MP Spec)约定的方式;另外一种是 ACPI MADT(Multiple APIC Description Table)约定的方式。MP Spec 约定的核心数据结构包括两部分:MP Floating Pointer Structure(后续简称 MPF)和 MP Configuration Table(后续简称 MP Table)的地址,如下图所示。

![MPtable.png](img/MPTable.png)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redraw the picture by yourself and add not only the picture but the original file is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'll revise it later.

@yaoyinnan
Copy link
Contributor Author

Since my current main task is to build a simple virtual machine to sort out the virtualization knowledge points, the document is in Chinese. After I have free time, I will sync it for translation.

.map_err(Error::MpTable)?;
```

在 `setup_mptable()` 中,第 5~7 行,首先判断 boot_cpus 是否超过给定的 max_cpus,以及第 8~9 行,判断 max_cpus 是否大于系统支持的最大 CPU 数目(MAX_SUPPORTED_CPUS)。之后,kvmtool 将 MP Table 放置在主板 BIOS 所在的区域(0xF0000 ~ 0xFFFFF),在 BIOS 实际占据地址的末尾处。kvmtool 首先申请了一块内存区,在其中组织 MPF 和 MP Table,然后将组织好的数据结构复制到 Guest 中主板 BIOS 所在的区域。代码如下:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kvmtool is another VMM.
In this document, you should use miniball

@studychao
Copy link
Member

studychao commented Aug 14, 2022

Hi Yinnan, thanks for your amazing work.
Overall, LGTM. only one small comment.

Add description document for CPU virtualization part. Modify the description of CPU virtualization in MiniBall's README.md.

Fixes: openanolis#187

Signed-off-by: yaoyinnan <yaoyinnan@foxmail.com>
@yaoyinnan yaoyinnan force-pushed the 187/miniball/cpu-virtualization-docs branch from 2b1d26b to 16c8b74 Compare August 15, 2022 07:18
@studychao studychao merged commit baba432 into openanolis:main Aug 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Miniball: add CPU virtualization docs
3 participants