# Xen PVH support
PR link: https://github.com/unikraft/unikraft-xen/pull/1
## Brief on PVH
PVH is one of the virtualization modes a guest can run in Xen. At the moment stable unikraft can run PV guests that paravirtulize both io and memory ops. PVH lets the guest own their page tables and interrupts and it lets the kernel run in Ring 1 rather than Ring 3 in the case of PV.
## PVH in Unikraft
This will allow Xen guests running in PVH to support binary-compatibility.
As the pagetables and interrupts are now owned by the guests, starting a PVH becomes very similar to KVM guests. Thus the two platforms will have pagetable support and interrupt support to be more or less the same.
As these operations are currently platform dependent, until someone breaks them down into a shared place like a driver of library the PVH support will remain in a fork in order to avoid code duplication.
## Using PVH
Selecting between PVH and PV can be done with `CONFIG_XEN_PVH` and `CONFIG_XEN_PV`.
Enabling PVH also involves chaning the guest-type for xen. In the `*.xl` config file for the guest the following must be added:
```
type = "pvh"
```
## Support in Kraftkit
Kraftkit support also needs to be added, the guest type can be deduced from the elfnotes of the image.
## Debugging Xen in Unikraft
For debugging the kernel the [guide](https://unikraft.org/docs/internals/debugging#xen) is still relevant.