Full virtualization and paravirtualization difference between the cpu ring0 ring1 what is the concept?

 

ring0 involves running the CPU level, it is the highest level ring0, ring1 followed, ring2 followed by more ...... 
get Linux + x86, the 
operating system (kernel) code running at the highest level ring0 running, you can use privileged instructions, interrupt control, modify the page table, access to equipment and so on. 
Code that runs the application running at the lowest level on ring3, can not do controlled operation. If you do, for example, to access the disk, write files, you should call (function) by executing the system, when the system call, the CPU is switched from the run level ring3 to ring0 will occur, and jump to the corresponding system call kernel code execution position, so that the kernel you complete access device, and then return ring3 from ring0 after completion. This process is also referred to as user mode and kernel mode switching of.

So, here virtualization encountered a problem because the host operating system is working in ring0, the guest operating system can not also ring0, but it does not know this, before any instruction execution, execution or what instructions now, it is certainly not ah, no authority, ah, could not handle ah. So this time hypervisor (VMM) is necessary to avoid this happening. 
(VMM on ring0, usually embodied in the form of drivers, drivers are working on ring0, or can not drive the device) 
generally do so, the client operating system to perform privileged instructions, will trigger an exception (CPU mechanism, no authority instruction, trigger an exception), then VMM catch this exception, a translator in which abnormal, simulation, and finally returned to the guest operating system, the guest operating system that their privileged instructions to work, continue to run. But this performance loss is very large, you think of the original, a simple instruction executed, trouble, and now have to pass complex exception handling process.

This time paravirtualization came, paravirtualized idea is to allow customers operating system know they are running on a virtual machine, some of the privileged instructions work in the ring0 state, it was originally executed on the physical machine, it will modified in other ways, this approach is a good agreement and VMM, this is equivalent to, I modify the code for the operating system to a new architecture up is customized. So like this semi XEN virtualization technology, client operating systems are a dedicated custom kernel version and x86, mips, arm these kernel versions are equivalent. This way, there will catch the exception, translate, process simulation, the performance loss is very low. This is the advantage of this semi-XEN virtualization architecture. This is why the XEN virtualization support only Linux, virtualization windows can not reason, Microsoft does not change the code ah.

Can later, CPU manufacturers started to support virtualization, the situation has changed, take the X86 CPU, the introduction of the Intel-VT technology to support Intel-VT's CPU, there VMX root operation and VMX non-root operation modes both modes support Ring 0 ~ Ring 3 four run level. This is just great, VMM can run in VMX root operation mode, the guest OS running in VMX non-root operation mode. Also he said that the hardware layer made some distinction, this fully virtualized, some rely on "catch exceptions - translation - analog" implementation is not required. And the CPU manufacturers to support increasing the intensity of virtualization, full virtualization technology on the performance of hardware-assisted virtualization is gradually approaching a half, plus a fully virtualized guest operating systems do not need to modify this advantage, full virtualization technology it should be the future trend of development.

XEN is the most typical paravirtualization, but now XEN also supports hardware-assisted full virtualization, trend, fail to beat ah. .
KVM, VMARE these have always been full virtualization.

 

Reprinted from network

ring0 involves running the CPU level, it is the highest level ring0, ring1 followed, ring2 followed by more ...... 
get Linux + x86, the 
operating system (kernel) code running at the highest level ring0 running, you can use privileged instructions, interrupt control, modify the page table, access to equipment and so on. 
Code that runs the application running at the lowest level on ring3, can not do controlled operation. If you do, for example, to access the disk, write files, you should call (function) by executing the system, when the system call, the CPU is switched from the run level ring3 to ring0 will occur, and jump to the corresponding system call kernel code execution position, so that the kernel you complete access device, and then return ring3 from ring0 after completion. This process is also referred to as user mode and kernel mode switching of.

So, here virtualization encountered a problem because the host operating system is working in ring0, the guest operating system can not also ring0, but it does not know this, before any instruction execution, execution or what instructions now, it is certainly not ah, no authority, ah, could not handle ah. So this time hypervisor (VMM) is necessary to avoid this happening. 
(VMM on ring0, usually embodied in the form of drivers, drivers are working on ring0, or can not drive the device) 
generally do so, the client operating system to perform privileged instructions, will trigger an exception (CPU mechanism, no authority instruction, trigger an exception), then VMM catch this exception, a translator in which abnormal, simulation, and finally returned to the guest operating system, the guest operating system that their privileged instructions to work, continue to run. But this performance loss is very large, you think of the original, a simple instruction executed, trouble, and now have to pass complex exception handling process.

This time paravirtualization came, paravirtualized idea is to allow customers operating system know they are running on a virtual machine, some of the privileged instructions work in the ring0 state, it was originally executed on the physical machine, it will modified in other ways, this approach is a good agreement and VMM, this is equivalent to, I modify the code for the operating system to a new architecture up is customized. So like this semi XEN virtualization technology, client operating systems are a dedicated custom kernel version and x86, mips, arm these kernel versions are equivalent. This way, there will catch the exception, translate, process simulation, the performance loss is very low. This is the advantage of this semi-XEN virtualization architecture. This is why the XEN virtualization support only Linux, virtualization windows can not reason, Microsoft does not change the code ah.

Can later, CPU manufacturers started to support virtualization, the situation has changed, take the X86 CPU, the introduction of the Intel-VT technology to support Intel-VT's CPU, there VMX root operation and VMX non-root operation modes both modes support Ring 0 ~ Ring 3 four run level. This is just great, VMM can run in VMX root operation mode, the guest OS running in VMX non-root operation mode. Also he said that the hardware layer made some distinction, this fully virtualized, some rely on "catch exceptions - translation - analog" implementation is not required. And the CPU manufacturers to support increasing the intensity of virtualization, full virtualization technology on the performance of hardware-assisted virtualization is gradually approaching a half, plus a fully virtualized guest operating systems do not need to modify this advantage, full virtualization technology it should be the future trend of development.

XEN is the most typical paravirtualization, but now XEN also supports hardware-assisted full virtualization, trend, fail to beat ah. .
KVM, VMARE these have always been full virtualization.

 

Reprinted from network

Guess you like

Origin www.cnblogs.com/pipci/p/12241698.html