|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH V3 6/6] libxl: Allocate MMIO params for GPIO device and update DT
On 04.08.22 10:01, Viresh Kumar wrote: Hello Viresh This patch allocates Virtio MMIO params (IRQ and memory region) and pass them to the backend, also update Guest device-tree based on Virtio GPIO DT bindings [1]. [1] https://www.kernel.org/doc/Documentation/devicetree/bindings/gpio/gpio-virtio.yaml Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx> --- tools/libs/light/libxl_arm.c | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c index 08a1499c9523..14b95087f027 100644 --- a/tools/libs/light/libxl_arm.c +++ b/tools/libs/light/libxl_arm.c @@ -121,6 +121,15 @@ int libxl__arch_domain_prepare_config(libxl__gc *gc, return rc; }+ for (i = 0; i < d_config->num_gpios; i++) { I think that patch needs to be updated taking into the account suggestions provided for two previous patches (of course, if you agree with them). If so, the make_virtio_mmio_node_gpio() should gain "uint32_t backend_domid" argument, etc. And we need to make sure that make_xen_iommu_node() will be called for virtio gpio. Something like the diff on top of current patch below (not tested): diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c index 9bd8d49f3c..54756b3dd5 100644 --- a/tools/libs/light/libxl_arm.c +++ b/tools/libs/light/libxl_arm.c@@ -986,11 +986,11 @@ static int make_virtio_mmio_node_i2c(libxl__gc *gc, void *fdt, uint64_t base, }static int make_virtio_mmio_node_gpio(libxl__gc *gc, void *fdt, uint64_t base,
- uint32_t irq)
+ uint32_t irq, uint32_t backend_domid)
{
int res;
- res = make_virtio_mmio_node_common(gc, fdt, base, irq);
+ res = make_virtio_mmio_node_common(gc, fdt, base, irq, backend_domid);
if (res) return res;
res = fdt_begin_node(fdt, "gpio");
@@ -1350,8 +1350,11 @@ next_resize:
for (i = 0; i < d_config->num_gpios; i++) {
libxl_device_gpio *gpio = &d_config->gpios[i];
+ if (gpio->backend_domid != LIBXL_TOOLSTACK_DOMID)
+ iommu_needed = true;
- FDT( make_virtio_mmio_node_gpio(gc, fdt, gpio->base,
gpio->irq) );
+ FDT( make_virtio_mmio_node_gpio(gc, fdt, gpio->base, gpio->irq, + gpio->backend_domid) ); } /* Other changes look good. -- Regards, Oleksandr Tyshchenko
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |