<s>
The	O
Popek	B-Architecture
and	I-Architecture
Goldberg	I-Architecture
virtualization	I-Architecture
requirements	I-Architecture
are	O
a	O
set	O
of	O
conditions	O
sufficient	O
for	O
a	O
computer	O
architecture	O
to	O
support	O
system	O
virtualization	B-Architecture
efficiently	O
.	O
</s>
<s>
Even	O
though	O
the	O
requirements	O
are	O
derived	O
under	O
simplifying	O
assumptions	O
,	O
they	O
still	O
represent	O
a	O
convenient	O
way	O
of	O
determining	O
whether	O
a	O
computer	O
architecture	O
supports	O
efficient	O
virtualization	B-Architecture
and	O
provide	O
guidelines	O
for	O
the	O
design	O
of	O
virtualized	O
computer	O
architectures	O
.	O
</s>
<s>
System	O
virtual	B-Architecture
machines	I-Architecture
are	O
capable	O
of	O
virtualizing	O
a	O
full	O
set	O
of	O
hardware	O
resources	O
,	O
including	O
a	O
processor	O
(	O
or	O
processors	O
)	O
,	O
memory	O
and	O
storage	O
resources	O
and	O
peripheral	O
devices	O
.	O
</s>
<s>
A	O
virtual	B-Operating_System
machine	I-Operating_System
monitor	I-Operating_System
(	O
VMM	O
,	O
also	O
called	O
hypervisor	B-Operating_System
)	O
is	O
the	O
piece	O
of	O
software	O
that	O
provides	O
the	O
abstraction	O
of	O
a	O
virtual	B-Architecture
machine	I-Architecture
.	O
</s>
<s>
Popek	O
and	O
Goldberg	O
describe	O
the	O
characteristics	O
that	O
the	O
instruction	B-General_Concept
set	I-General_Concept
architecture	I-General_Concept
(	O
ISA	O
)	O
of	O
the	O
physical	O
machine	O
must	O
possess	O
in	O
order	O
to	O
run	O
VMMs	O
which	O
possess	O
the	O
above	O
properties	O
.	O
</s>
<s>
Their	O
analysis	O
derives	O
such	O
characteristics	O
using	O
a	O
model	O
of	O
"	O
third	O
generation	O
architectures	O
"	O
(	O
e.g.	O
,	O
IBM	O
360	O
,	O
Honeywell	O
6000	O
,	O
DEC	B-Device
PDP-10	I-Device
)	O
that	O
is	O
nevertheless	O
general	O
enough	O
to	O
be	O
extended	O
to	O
modern	O
machines	O
.	O
</s>
<s>
This	O
model	O
includes	O
a	O
processor	O
that	O
operates	O
in	O
either	O
system	O
or	O
user	B-Operating_System
mode	I-Operating_System
,	O
and	O
has	O
access	O
to	O
linear	O
,	O
uniformly	O
addressable	O
memory	O
.	O
</s>
<s>
It	O
is	O
assumed	O
that	O
a	O
subset	O
of	O
the	O
instruction	B-General_Concept
set	I-General_Concept
is	O
available	O
only	O
when	O
in	O
system	O
mode	O
and	O
that	O
memory	O
is	O
addressed	O
relative	O
to	O
a	O
relocation	O
register	O
.	O
</s>
<s>
I/O	O
and	O
interrupts	B-Application
are	O
not	O
modelled	O
.	O
</s>
<s>
To	O
derive	O
their	O
virtualization	B-Architecture
theorems	O
,	O
which	O
give	O
sufficient	O
(	O
but	O
not	O
necessary	O
)	O
conditions	O
for	O
virtualization	B-Architecture
,	O
Popek	O
and	O
Goldberg	O
introduce	O
a	O
classification	O
of	O
some	O
instructions	O
of	O
an	O
ISA	O
into	O
3	O
different	O
groups	O
:	O
</s>
<s>
Privileged	O
instructions	O
Those	O
that	O
trap	B-Application
if	O
the	O
processor	O
is	O
in	O
user	B-Operating_System
mode	I-Operating_System
and	O
do	O
not	O
trap	B-Application
if	O
it	O
is	O
in	O
system	O
mode	O
(	O
supervisor	O
mode	O
)	O
.	O
</s>
<s>
Intuitively	O
,	O
the	O
theorem	O
states	O
that	O
to	O
build	O
a	O
VMM	O
it	O
is	O
sufficient	O
that	O
all	O
instructions	O
that	O
could	O
affect	O
the	O
correct	O
functioning	O
of	O
the	O
VMM	O
(	O
sensitive	O
instructions	O
)	O
always	O
trap	B-Application
and	O
pass	O
control	O
to	O
the	O
VMM	O
.	O
</s>
<s>
This	O
theorem	O
also	O
provides	O
a	O
simple	O
technique	O
for	O
implementing	O
a	O
VMM	O
,	O
called	O
trap-and-emulate	O
virtualization	B-Architecture
,	O
more	O
recently	O
called	O
classic	O
virtualization	B-Architecture
:	O
because	O
all	O
sensitive	O
instructions	O
behave	O
nicely	O
,	O
all	O
the	O
VMM	O
has	O
to	O
do	O
is	O
trap	B-Application
and	O
emulate	O
every	O
one	O
time	O
of	O
them	O
.	O
</s>
<s>
A	O
related	O
problem	O
is	O
that	O
of	O
deriving	O
sufficient	O
conditions	O
for	O
recursive	O
virtualization	B-Architecture
,	O
that	O
is	O
,	O
the	O
conditions	O
under	O
which	O
a	O
VMM	O
that	O
can	O
run	O
on	O
a	O
copy	O
of	O
itself	O
can	O
be	O
built	O
.	O
</s>
<s>
Some	O
architectures	O
,	O
like	O
the	O
non-hardware-assisted	O
x86	B-Operating_System
,	O
do	O
not	O
meet	O
these	O
conditions	O
,	O
so	O
they	O
cannot	O
be	O
virtualized	O
in	O
the	O
classic	O
way	O
.	O
</s>
<s>
But	O
architectures	O
can	O
still	O
be	O
fully	O
virtualized	O
(	O
in	O
the	O
x86	B-Operating_System
case	O
meaning	O
at	O
the	O
CPU	O
and	O
MMU	O
level	O
)	O
by	O
using	O
different	O
techniques	O
like	O
binary	O
translation	O
,	O
which	O
replaces	O
the	O
sensitive	O
instructions	O
that	O
do	O
not	O
generate	O
traps	B-Application
,	O
which	O
are	O
sometimes	O
called	O
critical	O
instructions	O
.	O
</s>
<s>
This	O
additional	O
processing	O
however	O
makes	O
the	O
VMM	O
less	O
efficient	O
in	O
theory	O
,	O
but	O
hardware	O
traps	B-Application
have	O
non-negligible	O
performance	O
cost	O
as	O
well	O
.	O
</s>
<s>
A	O
well-tuned	O
caching	O
binary	O
translation	O
system	O
may	O
achieve	O
comparable	O
performance	O
,	O
and	O
it	O
does	O
in	O
the	O
case	O
of	O
x86	B-Operating_System
binary	O
translation	O
relative	O
to	O
first	O
generation	O
x86	B-Operating_System
hardware	O
assist	O
,	O
which	O
merely	O
made	O
sensitive	O
instructions	O
trappable	O
.	O
</s>
<s>
The	O
conditions	O
for	O
ISA	O
virtualization	B-Architecture
expressed	O
in	O
Theorem	O
1	O
may	O
be	O
relaxed	O
at	O
the	O
expense	O
of	O
the	O
efficiency	O
property	O
.	O
</s>
<s>
The	O
virtualization	B-Architecture
of	O
such	O
architectures	O
requires	O
correct	O
handling	O
of	O
critical	O
instructions	O
,	O
i.e.	O
,	O
sensitive	O
but	O
unprivileged	O
instructions	O
.	O
</s>
<s>
One	O
approach	O
,	O
known	O
as	O
patching	O
,	O
adopts	O
techniques	O
commonly	O
used	O
in	O
dynamic	O
recompilation	O
:	O
critical	O
instructions	O
are	O
discovered	O
at	O
run-time	O
and	O
replaced	O
with	O
a	O
trap	B-Application
into	O
the	O
VMM	O
.	O
</s>
<s>
Various	O
mechanisms	O
,	O
such	O
as	O
the	O
caching	O
of	O
emulation	B-Application
code	O
or	O
hardware	B-General_Concept
assists	I-General_Concept
,	O
have	O
been	O
proposed	O
to	O
make	O
the	O
patching	O
process	O
more	O
efficient	O
.	O
</s>
<s>
This	O
section	O
presents	O
some	O
relevant	O
architectures	O
and	O
how	O
they	O
relate	O
to	O
the	O
virtualization	B-Architecture
requirements	O
.	O
</s>
<s>
The	O
PDP-10	B-Device
architecture	O
has	O
a	O
few	O
instructions	O
which	O
are	O
sensitive	O
(	O
alter	O
or	O
query	O
the	O
processor	O
's	O
mode	O
)	O
but	O
not	O
privileged	O
.	O
</s>
<s>
These	O
instructions	O
save	O
or	O
restore	O
the	O
condition	B-General_Concept
codes	I-General_Concept
containing	O
USER	O
or	O
IOT	O
bits	O
:	O
</s>
<s>
All	O
sensitive	O
instructions	O
in	O
the	O
System/370	B-Device
are	O
privileged	O
:	O
it	O
satisfies	O
the	O
virtualization	B-Architecture
requirements	O
.	O
</s>
<s>
The	O
Motorola	B-Device
MC68000	I-Device
has	O
a	O
single	O
unprivileged	O
sensitive	O
instruction	O
:	O
</s>
<s>
This	O
instruction	O
is	O
sensitive	O
because	O
it	O
allows	O
access	O
to	O
the	O
entire	O
status	B-General_Concept
register	I-General_Concept
,	O
which	O
includes	O
not	O
only	O
the	O
condition	B-General_Concept
codes	I-General_Concept
but	O
also	O
the	O
user/supervisor	O
bit	O
,	O
interrupt	B-Application
level	O
,	O
and	O
trace	O
control	O
.	O
</s>
<s>
In	O
most	O
later	O
family	O
members	O
,	O
starting	O
with	O
the	O
MC68010	B-Device
,	O
the	O
MOVE	O
from	O
SR	O
instruction	O
was	O
made	O
privileged	O
,	O
and	O
a	O
new	O
MOVE	O
from	O
CCR	O
instruction	O
was	O
provided	O
to	O
allow	O
access	O
to	O
the	O
condition	B-General_Concept
code	I-General_Concept
register	I-General_Concept
only	O
.	O
</s>
<s>
The	O
IA-32	B-Device
instruction	B-General_Concept
set	I-General_Concept
of	O
the	O
Pentium	B-General_Concept
processor	O
contains	O
18	O
sensitive	O
,	O
unprivileged	O
instructions	O
.	O
</s>
<s>
Sensitive	O
register	O
instructions	O
:	O
read	O
or	O
change	O
sensitive	O
registers	O
or	O
memory	O
locations	O
such	O
as	O
a	O
clock	O
register	O
or	O
interrupt	B-Application
registers	O
:	O
</s>
<s>
The	O
introduction	O
of	O
the	O
AMD-V	O
and	O
Intel	O
VT-x	O
instruction	B-General_Concept
sets	I-General_Concept
in	O
2005	O
allows	O
x86	B-Operating_System
processors	O
to	O
meet	O
the	O
Popek	B-Architecture
and	I-Architecture
Goldberg	I-Architecture
virtualization	I-Architecture
requirements	I-Architecture
.	O
</s>
<s>
The	O
effort	O
needed	O
to	O
support	O
virtualization	B-Architecture
on	O
the	O
IA-64	B-General_Concept
architecture	O
is	O
described	O
in	O
a	O
2000	O
article	O
by	O
Magenheimer	O
and	O
Christian	O
.	O
</s>
<s>
A	O
"	O
hyperprivileged	O
"	O
mode	O
for	O
the	O
UltraSPARC	B-General_Concept
architecture	O
was	O
specified	O
in	O
UltraSPARC	B-General_Concept
Architecture	O
2005.	O
'	O
</s>
<s>
All	O
sensitive	O
instructions	O
in	O
the	O
PowerPC	B-Architecture
instruction	B-General_Concept
set	I-General_Concept
are	O
privileged	O
.	O
</s>
<s>
This	O
is	O
what	O
distinguishes	O
a	O
VMM	O
from	O
the	O
more	O
general	O
class	O
of	O
hardware	O
emulation	B-Application
software	I-Application
.	O
</s>
<s>
Unfortunately	O
,	O
even	O
on	O
an	O
architecture	O
that	O
meets	O
Popek	O
and	O
Goldberg	O
's	O
requirements	O
,	O
the	O
performance	O
of	O
a	O
virtual	B-Architecture
machine	I-Architecture
can	O
differ	O
significantly	O
from	O
the	O
actual	O
hardware	O
.	O
</s>
<s>
Early	O
experiments	O
performed	O
on	O
the	O
System/370	B-Device
(	O
which	O
meets	O
the	O
formal	O
requirements	O
of	O
Theorem	O
1	O
)	O
showed	O
that	O
performance	O
of	O
a	O
virtual	B-Architecture
machine	I-Architecture
could	O
be	O
as	O
low	O
as	O
21%	O
of	O
the	O
native	O
machine	O
in	O
some	O
benchmarks	O
.	O
</s>
<s>
The	O
cost	O
of	O
trapping	O
and	O
emulating	B-Application
privileged	O
instructions	O
in	O
the	O
VMM	O
can	O
be	O
significant	O
.	O
</s>
<s>
This	O
led	O
the	O
IBM	O
engineers	O
to	O
introduce	O
a	O
number	O
of	O
hardware	B-General_Concept
assists	I-General_Concept
,	O
which	O
roughly	O
doubled	O
the	O
performance	O
of	O
the	O
System/370	B-Device
virtual	B-Architecture
machines	I-Architecture
.	O
</s>
<s>
In	O
the	O
end	O
,	O
there	O
were	O
over	O
100	O
assists	O
on	O
the	O
late	O
models	O
System/370	B-Device
.	O
</s>
<s>
One	O
of	O
the	O
main	O
driving	O
factors	O
for	O
the	O
development	O
of	O
hardware	B-General_Concept
assists	I-General_Concept
for	O
the	O
System/370	B-Device
was	O
virtual	O
memory	O
itself	O
.	O
</s>
