2019-07-10 15:30:52 +00:00
|
|
|
.. SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
|
|
|
============
|
2015-02-13 06:43:40 +00:00
|
|
|
Paravirt_ops
|
|
|
|
============
|
|
|
|
|
|
|
|
Linux provides support for different hypervisor virtualization technologies.
|
2023-06-10 05:43:10 +00:00
|
|
|
Historically, different binary kernels would be required in order to support
|
|
|
|
different hypervisors; this restriction was removed with pv_ops.
|
2015-02-13 06:43:40 +00:00
|
|
|
Linux pv_ops is a virtualization API which enables support for different
|
|
|
|
hypervisors. It allows each hypervisor to override critical operations and
|
|
|
|
allows a single kernel binary to run on all supported execution environments
|
|
|
|
including native machine -- without any hypervisors.
|
|
|
|
|
|
|
|
pv_ops provides a set of function pointers which represent operations
|
2023-06-10 05:43:10 +00:00
|
|
|
corresponding to low-level critical instructions and high-level
|
|
|
|
functionalities in various areas. pv_ops allows for optimizations at run
|
|
|
|
time by enabling binary patching of the low-level critical operations
|
2015-02-13 06:43:40 +00:00
|
|
|
at boot time.
|
|
|
|
|
|
|
|
pv_ops operations are classified into three categories:
|
|
|
|
|
|
|
|
- simple indirect call
|
2023-06-10 05:43:10 +00:00
|
|
|
These operations correspond to high-level functionality where it is
|
2019-07-10 15:30:52 +00:00
|
|
|
known that the overhead of indirect call isn't very important.
|
2015-02-13 06:43:40 +00:00
|
|
|
|
|
|
|
- indirect call which allows optimization with binary patch
|
2023-06-10 05:43:10 +00:00
|
|
|
Usually these operations correspond to low-level critical instructions. They
|
2019-07-10 15:30:52 +00:00
|
|
|
are called frequently and are performance critical. The overhead is
|
|
|
|
very important.
|
2015-02-13 06:43:40 +00:00
|
|
|
|
|
|
|
- a set of macros for hand written assembly code
|
2019-07-10 15:30:52 +00:00
|
|
|
Hand written assembly codes (.S files) also need paravirtualization
|
2023-06-10 05:43:10 +00:00
|
|
|
because they include sensitive instructions or some code paths in
|
2019-07-10 15:30:52 +00:00
|
|
|
them are very performance critical.
|