Paravirt_ops

Linux provides support for different hypervisor virtualization technologies.Historically different binary kernels would be required in order to supportdifferent hypervisors, this restriction was removed with pv_ops.Linux pv_ops is a virtualization API which enables support for differenthypervisors. It allows each hypervisor to override critical operations andallows a single kernel binary to run on all supported execution environmentsincluding native machine – without any hypervisors.

pv_ops provides a set of function pointers which represent operationscorresponding to low level critical instructions and high levelfunctionalities in various areas. pv-ops allows for optimizations at runtime by enabling binary patching of the low-ops critical operationsat boot time.

pv_ops operations are classified into three categories:

  • simple indirect call
    These operations correspond to high level functionality where it isknown that the overhead of indirect call isn’t very important.
  • indirect call which allows optimization with binary patch
    Usually these operations correspond to low level critical instructions. Theyare called frequently and are performance critical. The overhead isvery important.
  • a set of macros for hand written assembly code
    Hand written assembly codes (.S files) also need paravirtualizationbecause they include sensitive instructions or some of code paths inthem are very performance critical.