All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
To: Julien Grall <julien.grall@arm.com>
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	sstabellini@kernel.org, xen-devel@lists.xen.org
Subject: Re: [PATCH v3 2/6] xen/arm: Rename and generalize un/map_regions_rw_cache
Date: Fri, 16 Sep 2016 17:31:19 +0200	[thread overview]
Message-ID: <20160916153119.GO28422@toto> (raw)
In-Reply-To: <ed51d059-e257-98f6-2123-05ed620de729@arm.com>

On Fri, Sep 16, 2016 at 04:24:17PM +0200, Julien Grall wrote:
> Hi Edgar,
> 
> On 07/09/2016 08:56, Edgar E. Iglesias wrote:
> >From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
> >
> >Rename and generalize un/map_regions_rw_cache into
> >un/map_regions_p2mt. The new functions take the mapping
> >attributes as an argument.
> >
> >No functional change.
> >
> >Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> >---
> > xen/arch/arm/domain_build.c | 18 ++++++++++--------
> > xen/arch/arm/p2m.c          | 19 ++++++++++---------
> > xen/include/asm-arm/p2m.h   | 19 ++++++++++---------
> > 3 files changed, 30 insertions(+), 26 deletions(-)
> >
> >diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> >index 35ab08d..f022342 100644
> >--- a/xen/arch/arm/domain_build.c
> >+++ b/xen/arch/arm/domain_build.c
> >@@ -1518,10 +1518,11 @@ static void acpi_map_other_tables(struct domain *d)
> >     {
> >         addr = acpi_gbl_root_table_list.tables[i].address;
> >         size = acpi_gbl_root_table_list.tables[i].length;
> >-        res = map_regions_rw_cache(d,
> >-                                   _gfn(paddr_to_pfn(addr)),
> >-                                   DIV_ROUND_UP(size, PAGE_SIZE),
> >-                                   _mfn(paddr_to_pfn(addr)));
> >+        res = map_regions_p2mt(d,
> >+                               _gfn(paddr_to_pfn(addr)),
> >+                               DIV_ROUND_UP(size, PAGE_SIZE),
> >+                               _mfn(paddr_to_pfn(addr)),
> >+                               p2m_mmio_direct_c);
> >         if ( res )
> >         {
> >              panic(XENLOG_ERR "Unable to map ACPI region 0x%"PRIx64
> >@@ -1874,10 +1875,11 @@ static int prepare_acpi(struct domain *d, struct kernel_info *kinfo)
> >     acpi_create_efi_mmap_table(d, &kinfo->mem, tbl_add);
> >
> >     /* Map the EFI and ACPI tables to Dom0 */
> >-    rc = map_regions_rw_cache(d,
> >-                              _gfn(paddr_to_pfn(d->arch.efi_acpi_gpa)),
> >-                              PFN_UP(d->arch.efi_acpi_len),
> >-                              _mfn(paddr_to_pfn(virt_to_maddr(d->arch.efi_acpi_table))));
> >+    rc = map_regions_p2mt(d,
> >+                          _gfn(paddr_to_pfn(d->arch.efi_acpi_gpa)),
> >+                          PFN_UP(d->arch.efi_acpi_len),
> >+                          _mfn(paddr_to_pfn(virt_to_maddr(d->arch.efi_acpi_table))),
> >+                          p2m_mmio_direct_c);
> >     if ( rc != 0 )
> >     {
> >         printk(XENLOG_ERR "Unable to map EFI/ACPI table 0x%"PRIx64
> >diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> >index bfef77b..58d4940 100644
> >--- a/xen/arch/arm/p2m.c
> >+++ b/xen/arch/arm/p2m.c
> >@@ -1234,18 +1234,19 @@ static inline int p2m_remove_mapping(struct domain *d,
> >                              0, p2m_invalid, d->arch.p2m.default_access);
> > }
> >
> >-int map_regions_rw_cache(struct domain *d,
> >-                         gfn_t gfn,
> >-                         unsigned long nr,
> >-                         mfn_t mfn)
> >+int map_regions_p2mt(struct domain *d,
> >+                     gfn_t gfn,
> >+                     unsigned long nr,
> >+                     mfn_t mfn,
> >+                     p2m_type_t p2mt)
> > {
> >-    return p2m_insert_mapping(d, gfn, nr, mfn, p2m_mmio_direct_c);
> >+    return p2m_insert_mapping(d, gfn, nr, mfn, p2mt);
> > }
> >
> >-int unmap_regions_rw_cache(struct domain *d,
> >-                           gfn_t gfn,
> >-                           unsigned long nr,
> >-                           mfn_t mfn)
> >+int unmap_regions_p2mt(struct domain *d,
> >+                       gfn_t gfn,
> >+                       unsigned long nr,
> >+                       mfn_t mfn)
> > {
> >     return p2m_remove_mapping(d, gfn, nr, mfn);
> > }
> >diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
> >index b012d50..f2bd16c 100644
> >--- a/xen/include/asm-arm/p2m.h
> >+++ b/xen/include/asm-arm/p2m.h
> >@@ -166,15 +166,16 @@ mfn_t p2m_lookup(struct domain *d, gfn_t gfn, p2m_type_t *t);
> > /* Clean & invalidate caches corresponding to a region of guest address space */
> > int p2m_cache_flush(struct domain *d, gfn_t start, unsigned long nr);
> >
> >-int map_regions_rw_cache(struct domain *d,
> >-                         gfn_t gfn,
> >-                         unsigned long nr,
> >-                         mfn_t mfn);
> >-
> >-int unmap_regions_rw_cache(struct domain *d,
> >-                           gfn_t gfn,
> >-                           unsigned long nr,
> >-                           mfn_t mfn);
> >+int map_regions_p2mt(struct domain *d,
> >+                     gfn_t gfn,
> >+                     unsigned long nr,
> >+                     mfn_t mfn,
> >+                     p2m_type_t p2mt);
> 
> Can you document the purpose of this function in the code? Something like:
> "Map the region in the guest p2m with a specific type (will affect the
> attributes of the region).".

Yes, I've added the following for v4:

/*
 * Map a region in the guest p2m with a specific p2m type.
 * The memory attributes will be derived from the p2m type.
 */

Thanks,
Edgar


> 
> >+
> >+int unmap_regions_p2mt(struct domain *d,
> >+                       gfn_t gfn,
> >+                       unsigned long nr,
> >+                       mfn_t mfn);
> >
> > int map_dev_mmio_region(struct domain *d,
> >                         gfn_t gfn,
> >
> 
> Regards,
> 
> -- 
> Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-09-16 15:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07  6:56 [PATCH v3 0/6] xen/arm: Add support for mapping mmio-sram nodes into dom0 Edgar E. Iglesias
2016-09-07  6:56 ` [PATCH v3 1/6] xen/arm: p2m: Add support for normal non-cacheable memory Edgar E. Iglesias
2016-09-16 14:21   ` Julien Grall
2016-09-16 15:08     ` Edgar E. Iglesias
2016-09-16 16:17     ` Edgar E. Iglesias
2016-09-19 15:22       ` Julien Grall
2016-09-23 17:39         ` Edgar E. Iglesias
2016-09-16 14:34   ` Julien Grall
2016-09-16 15:54     ` Edgar E. Iglesias
2016-09-07  6:56 ` [PATCH v3 2/6] xen/arm: Rename and generalize un/map_regions_rw_cache Edgar E. Iglesias
2016-09-16 14:24   ` Julien Grall
2016-09-16 15:31     ` Edgar E. Iglesias [this message]
2016-09-07  6:56 ` [PATCH v3 3/6] xen/device-tree: Add __DT_MATCH macros without braces Edgar E. Iglesias
2016-09-07  6:56 ` [PATCH v3 4/6] xen/device-tree: Make dt_match_node match props Edgar E. Iglesias
2016-09-16 14:28   ` Julien Grall
2016-09-16 15:47     ` Edgar E. Iglesias
2016-09-07  6:56 ` [PATCH v3 5/6] xen/arm: domain_build: Plumb for different mapping attributes Edgar E. Iglesias
2016-09-16 14:31   ` Julien Grall
2016-09-16 16:00     ` Edgar E. Iglesias
2016-09-07  6:56 ` [PATCH v3 6/6] xen/arm: Map mmio-sram nodes as un-cached memory Edgar E. Iglesias

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160916153119.GO28422@toto \
    --to=edgar.iglesias@xilinx.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.