With virtual machines, the host kernel runs in privileged mode to create a virtu
ID: 3846174 • Letter: W
Question
With virtual machines, the host kernel runs in privileged mode to create
a virtual machine that runs in user mode. The virtual machine provides
the illusion that the guest kernel runs on its own machine in privileged
mode, even though it is actually running in user mode.
Early versions of the x86 architecture (pre-2006) were not completely
virtualizable—these systems could not guarantee to run unmodified
guest operating systems properly. One problem was the popf “pop flags”
instruction that restores the processor status word. When popf was run
in privileged mode, it changed both the ALU flags (e.g., the condition
codes) and the systems flags (e.g., the interrupt mask). When popf was
run in unprivileged mode, it changed just the ALU flags.
a) Why do instructions like popf prevent transparent virtualization of
the (old) x86 architecture?
b) How would you change the (old) x86 hardware to fix this problem?
Explanation / Answer
Solution:
a) Hypervisor Running is used by the virtualization in privileged mode to create a virtual machine which will run in unprivileged mode. So that, the guest operating System which is unmodidifed can able to run in the vrtual machine.And the illusion has been created by the hypervisor that in privileged mode every guest operating systems is running on its own machine.
These flags conditions will not cause a trap in user mode and behaves differently for user and kernal mode.
b) By adding a privileged flag, we can able to fix this issue which will set and cause popf "pop flags" to trap in user mode. After that whenever the gueat is running in virtual privileged mode, hypervisor ensured that popf "pop flags" is set. And if guest is running in virtual unprivileged mode, at that time it can be cleared only.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.