i386/xen: redirect gnttab callers with XEN_EMULATE
It adjust how some of the APIs in xen-backend and xen-pvdev to use the
XenBackendOps for platforms that which to emulate some of those
operations.
Meaning instead of a system call, we do it ourselves in a Qemu
equivalent implementation because Qemu will have full visibility of
the grant table frames. Hence it is pointless (and less performant)
to ask /dev/xen/gntdev to do the mapping when we can just fetch
the hva from the gpa (or @frame pointed by gref) directly.
Also, make sure that physical address is properly typed as gnt->frame
is a 32-bit type and thus when shifted by 12 can lose higher bits, hence
some of the casts to hwaddr.
Signed-off-by: Joao Martins <joao.m.martins@oracle.com> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>