[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH RFC 27/35] arm: acpi map mmio regions to dom0
 
 
Hi Parth,
On 04/02/2015 22:02, parth.dixit@xxxxxxxxxx wrote:
 
From: Parth Dixit <parth.dixit@xxxxxxxxxx>
map mmio regions described in uefi tables to dom0 address space
Signed-off-by: Parth Dixit <parth.dixit@xxxxxxxxxx>
---
  xen/arch/arm/domain_build.c | 54 +++++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 54 insertions(+)
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index d781c63..49eb52a 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1235,6 +1235,56 @@ static int make_chosen_node(const struct domain *d, 
const struct kernel_info *ki
      return res;
  }
+static int acpi_map_mmio(struct domain *d)
+{
+    int i,res;
+    u64 addr,size;
 
Missing space after the comma.
 
+
+    for( i = 0; i < acpi_mmio.nr_banks; i++ )
+    {
+        addr = acpi_mmio.bank[i].start;
+        size = acpi_mmio.bank[i].size;
+
+        res = iomem_permit_access(d, paddr_to_pfn(addr & PAGE_MASK),
 
 There is multiple place within this loop which use paddr_to_pfn(addr & 
PAGE_MASK). I would create a temporary variable to store the value and 
use it everywhere.
 
+                                    paddr_to_pfn(PAGE_ALIGN(addr + size - 1)));
 
 
The indentation is wrong.
 
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to permit to dom%d access to"
+                   " 0x%"PRIx64" - 0x%"PRIx64"\n",
+                   d->domain_id,
+                   addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1);
+            return res;
+        }
+
+        res = map_mmio_regions(d,
+                                paddr_to_pfn(addr & PAGE_MASK),
+                                DIV_ROUND_UP(size, PAGE_SIZE),
+                                paddr_to_pfn(addr & PAGE_MASK));
 
Ditto
Regards,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
 
 
    
     |