简体   繁体   中英

software virtualization vs hardware virtualization

What actually happens when hardware virtualization is enabled ? if not, a hypervisor uses binary translation. but, when hardware virtualization is enabled, i have read that it uses trap and emulate. so the guest code executes directly on the host cpu, if its a privileged instruction the cpu hands over the control to the hypervisor, the hypervisor emulates that instruciton and then executes it.

so, what does the emulation means here ? is the same binary translation carried out when hardware virtualization is enable ?

Enabling HW virtualization sets the vmx flag in Intel and svm flag in AMD.

In Intel architecture, this allows the user-space calls to run as-is on the lower protection ring as they cannot potentially interfear with the host OS. On the other hand the kernel-space calls of the virualized OS are trapped and binary-translated by the hypervisor.

This is done so as to partly take away the CPU intensive translation for trivial calls. How-much of this happens depends on the virtualization type- full, partial or paravirtual.

Binary-translation is a subset of the more elaborate process of emulation. It alligns the guest code to be able to run on the host-architecture.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM