vfio: platform: Take the guest node from a device tree template

A node with only reg and interrupts is of no use to a guest driver, and
nothing beyond those two can be read from VFIO: the compatible string,
DMA coherency, clocks or links to other devices all depend on the
binding of the device.

Let the user supply them as a compiled device tree blob:

  --vfio-platform <device>[,<template.dtb>]

Every property of the template's root node, and every subnode, is
copied into the generated node with libfdt. reg and interrupts at the
root of the template are skipped, since they are filled in from the
VFIO regions and the assigned GIC lines. A device assigned without a
template keeps the bare node.

Signed-off-by: Mostafa Saleh <smostafa@google.com>
4 files changed