> For the complete documentation index, see [llms.txt](https://richardweiyang-2.gitbook.io/kernel-exploring/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://richardweiyang-2.gitbook.io/kernel-exploring/00-kvm/01-memory_virtualization.md).

# 内存虚拟化

到哪里内存都是系统中重要的资源，那在虚拟环境下

* 如何管理内存宿主机
* 如何获得虚拟机上的内存信息
* 如何得到虚拟机中内存地址和宿主机上内存地址之间的对应？

这些都是在虚拟环境下遇到的问题和挑战。

就我当前粗陋的理解，下面会从两个方面尝试解读。

* [首先是基于Qemu用户态程序中的内存管理模型](/kernel-exploring/00-kvm/01-memory_virtualization/01_1-qemu_memory_model.md)
* [其次是KVM内核模块中内存管理的机制](/kernel-exploring/00-kvm/01-memory_virtualization/01_2-kvm_memory_manage.md)

在查阅资料的过程中也发现了网上不错的内容，其中有更多的代码细节，有兴趣的读者可以进一步学习

* [intel EPT 机制详解](http://www.cnblogs.com/ck1020/p/6043054.html)
* [QEMU学习笔记——内存](https://www.binss.me/blog/qemu-note-of-memory/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://richardweiyang-2.gitbook.io/kernel-exploring/00-kvm/01-memory_virtualization.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
