本文介绍了硬件虚拟化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Wikipedia上阅读了不同类型的虚拟化,但我的问题是CPU在每种情况下如何工作?例如,在软件与硬件虚拟化期间,CPU将会发生什么?我的意思是在软件虚拟化中,如果我增加虚拟机数量,CPU负载也会增加;在硬件虚拟化中,如果我增加虚拟机数量,CPU负载又增加,那么这两种情况之间有什么区别?

I have read different type of virtualization on Wikipedia but my question is that how CPU act in each case? For example what will happen to CPU during software vs hardware virtualization? I mean in software virtualization if I increase number of VMs cpu load also increases in hardware virtualization if I increase number of VMs cpu load again increases so what is the difference between these two situation?

推荐答案

不清楚您要问的是什么,但是硬件支持的虚拟化是CPU具有其他硬件支持/指令(例如VT-x)的地方,以方便执行通常遇到的一些常见任务在虚拟化中。与编写一个可以完成虚拟化硬件等效功能的汇编/软件程序相比,它更快。

It's not clear what you're exactly asking but hardware supported virtualization is where the CPU has additional hardware support/instructions (eg: VT-x) to facilitate some common tasks usually seen in virtualization. This makes it quicker as compared to writing a little assembly/software program that does the equivalent job of the virtualization hardware.

因此,在硬件加速虚拟化中,该任务委托给该硬件块需要完成。在纯软件虚拟化中,运行一个小的软件例程来完成相同的工作。通常,专用硬件要比软件例程快得多,这就是为什么要首先设计专用硬件的原因。

So in hardware accelerated virtualization, that task is delegated to that h/w block for completion. In software only virtualization, a small software routine is run to do the same job. Usually the dedicated hardware is much faster than the software routine - which is why they were designed-in in the first place.

(问题后编辑)

硬件虚拟化是硬件辅助。传统的CPU具有硬件模块,可以使它们非常高效地运行常见的软件工作负载(我们乘以15%的时间?好吧,让硬件乘法器进入其中)。在数十年的芯片制造和代码配置分析中,我们在编写的代码和可用的芯片之间有着相当不错的配合。最近,虚拟化开始兴起,在虚拟化中,出现了一种新的工作负载模式,这种模式无法被传统 CPU看到/支持。芯片制造商确定了这种模式,并在硬件中添加了额外的指令以加快此类工作量。因此,现在您有了硬件辅助的虚拟化CPU,可以快速完成某些任务。

Hardware virtualization is "hardware assisted". Traditional CPUs have hardware blocks that allow them to run commonly seen software workloads very efficiently ("We're multiplying 15% of the time? Ok, lets put a hardware multiplier in there"). Over decades of chip making and code profiling, we have a pretty good fit between the code written and the chips available. Recently virtualization has taken off and in virtualization a new workload pattern emerges that is not seen/supported by 'traditional' CPU. Chipmakers identified this pattern and added extra instructions into the hardware to accelerate such workloads. So now you have hardware assisted virtualization CPUs can do some those tasks quickly.

尽管如此,意识到在虚拟化计算机时,您仍然必须处理操作系统一直在做的传统工作(通常的工作量)加上看到的新工作量因此,即使有了硬件支持的虚拟化,添加更多的VM也会消耗更多的CPU。

Despite that, realize the when you virtualize a machine, you still have to process the traditional stuff that the operating systems have been doing (usual workload) PLUS the new workload seen from hypervisors etc. So even with hardware supported virtualization, adding more VMs will consume more CPU.

这篇关于硬件虚拟化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 17:34