Re: [Xen-devel] [PATCH v4 5/6] xen: arm: map child MMIO and IRQs to dom0 for PCI bus DT nodes.

2015-07-03 Thread Ian Campbell
On Fri, 2015-06-26 at 19:56 +0200, Julien Grall wrote:
 Hi Ian,
 
 NIT in the title: The final point is not necessary
 
 On 08/05/2015 13:26, Ian Campbell wrote:
  +static int map_device_children(struct domain *d,
  +   const struct dt_device_node *dev)
  +{
  +bool_t need_mapping = !dt_device_for_passthrough(dev);
  +int ret;
  +
  +if ( dt_device_type_is_equal(dev, pci) )
  +{
  +DPRINT(Mapping children of %s to guest\n, 
  dt_node_full_name(dev));
  +
  +/*
  + * We need to handle IRQs even if !need_mapping in order to
  + * setup the domain's permissions on the device's IRQs, such
  + * that it can pass them through to other domains.
  + */
  + ret = dt_for_each_irq_map(dev, map_interrupt_to_domain, d);
  + if ( ret  0 )
  + return ret;
  +
  + if ( need_mapping )
  + {
 
 I forgot to mention in the previous version that we need to give iomem 
 permission to the guest. Otherwise DOM0 won't be able to map the BAR 
 into the guest.

This boils down to a call to iomem_permit_access in the
map_range_to_domain callback and moving the need_mapping check down into
the cb surrouding only the map_mmio_region call but not the
permis_access one, right?



___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v4 5/6] xen: arm: map child MMIO and IRQs to dom0 for PCI bus DT nodes.

2015-07-03 Thread Julien Grall
Hi Ian,

On 03/07/15 11:59, Ian Campbell wrote:
 On Fri, 2015-06-26 at 19:56 +0200, Julien Grall wrote:
 I forgot to mention in the previous version that we need to give iomem 
 permission to the guest. Otherwise DOM0 won't be able to map the BAR 
 into the guest.
 
 This boils down to a call to iomem_permit_access in the
 map_range_to_domain callback and moving the need_mapping check down into
 the cb surrouding only the map_mmio_region call but not the
 permis_access one, right?

Correct.

Regards,

-- 
Julien Grall

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v4 5/6] xen: arm: map child MMIO and IRQs to dom0 for PCI bus DT nodes.

2015-06-26 Thread Julien Grall

Hi Ian,

NIT in the title: The final point is not necessary

On 08/05/2015 13:26, Ian Campbell wrote:

+static int map_device_children(struct domain *d,
+   const struct dt_device_node *dev)
+{
+bool_t need_mapping = !dt_device_for_passthrough(dev);
+int ret;
+
+if ( dt_device_type_is_equal(dev, pci) )
+{
+DPRINT(Mapping children of %s to guest\n, dt_node_full_name(dev));
+
+/*
+ * We need to handle IRQs even if !need_mapping in order to
+ * setup the domain's permissions on the device's IRQs, such
+ * that it can pass them through to other domains.
+ */
+ ret = dt_for_each_irq_map(dev, map_interrupt_to_domain, d);
+ if ( ret  0 )
+ return ret;
+
+ if ( need_mapping )
+ {


I forgot to mention in the previous version that we need to give iomem 
permission to the guest. Otherwise DOM0 won't be able to map the BAR 
into the guest.


Regards,

--
Julien Grall

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel