Understand the process of memory virtualization

Some basic concepts of memory

When no MMU processor, the memory address signal generated by the internal CPU execution unit directly transmits the address bus pins to the chip, memory chips are received, then it is not a general purpose computer as our support and deployment in the external memory, it can only be mixed together applications and operating systems

MMU, memory management unit

作用:管理内存的逻辑地址和物理地址的映射表,硬件集成到CPU中,由CPU管理

好处:
1、内存的复用技术,计算机可以使用比实际的物理内存更多的存储空间
2、实际的物理内存进行分割和保护,使得每个软件任务只能访问其分配到的内存空间

Here Insert Picture Description
Photo Internet to find, in fact, in the system memory is called before being divided into a number of minimum unit of memory pages, the page to the corresponding physical block, mmu relationship management is intermediate page table

The role of memory

CPU只跟内存进行交互,存放的数据能随时被CPU调用计算,就是一个处于CPU和硬盘间的临时存放区

Why is data loss after power failure memory

数据被放到内存中去时候是直接以二进制形式表示,因为它的原理是利用存储单元中电荷的多少来代表是1还是0

Because of slower hard disk, CPU if you run the project, all the data is read directly from the hard disk, the impact will be very efficient. So use of the CPU software will run a one-time call data from the hard disk to run fast memory, and CPU and then exchange data with the memory.

Memory Virtualization

定义:把物理机的真实内存统一管理,包装成多份虚拟内存给虚拟机使用
  • Host physical memory available to a virtual machine hypervisor memory
  • Virtual machine running on a VM Guest physical memory available memory
  • Guest virtual memory Guest os application submitted to a continuous logical address space

Here Insert Picture Description
Here Insert Picture Description
Virtual environment becomes a need to map twice to reach the final in order to find the physical block on the VMM virtual monitor, so MMU memory management unit would not do that

Solution

By means of software
Here Insert Picture Description
by the two mapping table to become one, handed over the management to do the MMU

CPU-based hardware-assisted virtualization

Above done by the software part, to the CPU can now do so will be faster and more advantages for processing speed than software

CPU hardware virtualization features
Inter-VT the X-EPT
AMD-V NPT

Published 37 original articles · won praise 14 · views 1302

Guess you like

Origin blog.csdn.net/yangshihuz/article/details/104083279