* [PATCH for-4.7 1/1] xen/arm: Rename map_regions_rw_cache and use p2m.default_access
@ 2016-06-08 0:15 Edgar E. Iglesias
2016-06-08 8:17 ` Wei Liu
2016-06-08 8:24 ` Julien Grall
0 siblings, 2 replies; 7+ messages in thread
From: Edgar E. Iglesias @ 2016-06-08 0:15 UTC (permalink / raw)
To: xen-devel; +Cc: edgar.iglesias, julien.grall, sstabellini, wei.liu2
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
Rename map_regions_rw_cache to map_regions_cache and make it use
p2m.default_access.
Suggested-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
xen/arch/arm/domain_build.c | 16 ++++++++--------
xen/arch/arm/p2m.c | 20 ++++++++++----------
xen/include/asm-arm/p2m.h | 18 +++++++++---------
3 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 00dc07a..b9ffaca 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1570,10 +1570,10 @@ 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,
- paddr_to_pfn(addr & PAGE_MASK),
- DIV_ROUND_UP(size, PAGE_SIZE),
- paddr_to_pfn(addr & PAGE_MASK));
+ res = map_regions_cache(d,
+ paddr_to_pfn(addr & PAGE_MASK),
+ DIV_ROUND_UP(size, PAGE_SIZE),
+ paddr_to_pfn(addr & PAGE_MASK));
if ( res )
{
panic(XENLOG_ERR "Unable to map ACPI region 0x%"PRIx64
@@ -1926,10 +1926,10 @@ 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,
- paddr_to_pfn(d->arch.efi_acpi_gpa),
- PFN_UP(d->arch.efi_acpi_len),
- paddr_to_pfn(virt_to_maddr(d->arch.efi_acpi_table)));
+ rc = map_regions_cache(d,
+ paddr_to_pfn(d->arch.efi_acpi_gpa),
+ PFN_UP(d->arch.efi_acpi_len),
+ paddr_to_pfn(virt_to_maddr(d->arch.efi_acpi_table)));
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 838d004..3d3fd16 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -1216,30 +1216,30 @@ int p2m_populate_ram(struct domain *d,
d->arch.p2m.default_access);
}
-int map_regions_rw_cache(struct domain *d,
- unsigned long start_gfn,
- unsigned long nr,
- unsigned long mfn)
+int map_regions_cache(struct domain *d,
+ unsigned long start_gfn,
+ unsigned long nr,
+ unsigned long mfn)
{
return apply_p2m_changes(d, INSERT,
pfn_to_paddr(start_gfn),
pfn_to_paddr(start_gfn + nr),
pfn_to_paddr(mfn),
MATTR_MEM, 0, p2m_mmio_direct,
- p2m_access_rw);
+ d->arch.p2m.default_access);
}
-int unmap_regions_rw_cache(struct domain *d,
- unsigned long start_gfn,
- unsigned long nr,
- unsigned long mfn)
+int unmap_regions_cache(struct domain *d,
+ unsigned long start_gfn,
+ unsigned long nr,
+ unsigned long mfn)
{
return apply_p2m_changes(d, REMOVE,
pfn_to_paddr(start_gfn),
pfn_to_paddr(start_gfn + nr),
pfn_to_paddr(mfn),
MATTR_MEM, 0, p2m_invalid,
- p2m_access_rw);
+ d->arch.p2m.default_access);
}
int map_mmio_regions(struct domain *d,
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index d240d1e..a2d1bbe 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -144,15 +144,15 @@ int p2m_cache_flush(struct domain *d, xen_pfn_t start_mfn, xen_pfn_t end_mfn);
/* Setup p2m RAM mapping for domain d from start-end. */
int p2m_populate_ram(struct domain *d, paddr_t start, paddr_t end);
-int map_regions_rw_cache(struct domain *d,
- unsigned long start_gfn,
- unsigned long nr_mfns,
- unsigned long mfn);
-
-int unmap_regions_rw_cache(struct domain *d,
- unsigned long start_gfn,
- unsigned long nr_mfns,
- unsigned long mfn);
+int map_regions_cache(struct domain *d,
+ unsigned long start_gfn,
+ unsigned long nr_mfns,
+ unsigned long mfn);
+
+int unmap_regions_cache(struct domain *d,
+ unsigned long start_gfn,
+ unsigned long nr_mfns,
+ unsigned long mfn);
int map_dev_mmio_region(struct domain *d,
unsigned long start_gfn,
--
2.5.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH for-4.7 1/1] xen/arm: Rename map_regions_rw_cache and use p2m.default_access
2016-06-08 0:15 [PATCH for-4.7 1/1] xen/arm: Rename map_regions_rw_cache and use p2m.default_access Edgar E. Iglesias
@ 2016-06-08 8:17 ` Wei Liu
2016-06-08 8:22 ` Julien Grall
2016-06-08 8:24 ` Julien Grall
1 sibling, 1 reply; 7+ messages in thread
From: Wei Liu @ 2016-06-08 8:17 UTC (permalink / raw)
To: Edgar E. Iglesias
Cc: edgar.iglesias, julien.grall, sstabellini, wei.liu2, xen-devel
On Wed, Jun 08, 2016 at 02:15:27AM +0200, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
>
> Rename map_regions_rw_cache to map_regions_cache and make it use
> p2m.default_access.
>
> Suggested-by: Julien Grall <julien.grall@arm.com>
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
I don't think this is absolutely necessary for 4.7.
On the other hand, it is just straight renaming, which should be quite
safe.
If I can get an ack or review from maintainers and confirmation that it
doesn't break ARM build within today, we can shovel this in; otherwise
it needs to wait for next version of Xen.
We will commit our last batch of patches for 4.7 today.
Wei.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH for-4.7 1/1] xen/arm: Rename map_regions_rw_cache and use p2m.default_access
2016-06-08 8:17 ` Wei Liu
@ 2016-06-08 8:22 ` Julien Grall
2016-06-08 8:25 ` Wei Liu
2016-06-08 9:36 ` Stefano Stabellini
0 siblings, 2 replies; 7+ messages in thread
From: Julien Grall @ 2016-06-08 8:22 UTC (permalink / raw)
To: Wei Liu, Edgar E. Iglesias; +Cc: edgar.iglesias, sstabellini, xen-devel
Hi Wei,
On 08/06/2016 09:17, Wei Liu wrote:
> On Wed, Jun 08, 2016 at 02:15:27AM +0200, Edgar E. Iglesias wrote:
>> From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
>>
>> Rename map_regions_rw_cache to map_regions_cache and make it use
>> p2m.default_access.
>>
>> Suggested-by: Julien Grall <julien.grall@arm.com>
>> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
>
> I don't think this is absolutely necessary for 4.7.
>
> On the other hand, it is just straight renaming, which should be quite
> safe.
This patch does not only contain a renaming, it also contain a change to
fix the default memaccess attribute.
However, I don't see why we should rename the function to
map_regions_cache given this will always map the region Read-Write
(p2m_mmio_direct prevents the execution of the memory).
> If I can get an ack or review from maintainers and confirmation that it
> doesn't break ARM build within today, we can shovel this in; otherwise
> it needs to wait for next version of Xen.
I would wait for a backport here. Stefano, any opinions?
Regards,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH for-4.7 1/1] xen/arm: Rename map_regions_rw_cache and use p2m.default_access
2016-06-08 8:22 ` Julien Grall
@ 2016-06-08 8:25 ` Wei Liu
2016-06-08 9:36 ` Stefano Stabellini
1 sibling, 0 replies; 7+ messages in thread
From: Wei Liu @ 2016-06-08 8:25 UTC (permalink / raw)
To: Julien Grall
Cc: edgar.iglesias, Edgar E. Iglesias, sstabellini, Wei Liu, xen-devel
On Wed, Jun 08, 2016 at 09:22:56AM +0100, Julien Grall wrote:
> Hi Wei,
>
> On 08/06/2016 09:17, Wei Liu wrote:
> >On Wed, Jun 08, 2016 at 02:15:27AM +0200, Edgar E. Iglesias wrote:
> >>From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
> >>
> >>Rename map_regions_rw_cache to map_regions_cache and make it use
> >>p2m.default_access.
> >>
> >>Suggested-by: Julien Grall <julien.grall@arm.com>
> >>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> >
> >I don't think this is absolutely necessary for 4.7.
> >
> >On the other hand, it is just straight renaming, which should be quite
> >safe.
>
> This patch does not only contain a renaming, it also contain a change to fix
> the default memaccess attribute.
>
Oops, I missed that.
In that case this is a good reason to wait post-4.7.
> However, I don't see why we should rename the function to map_regions_cache
> given this will always map the region Read-Write (p2m_mmio_direct prevents
> the execution of the memory).
>
> >If I can get an ack or review from maintainers and confirmation that it
> >doesn't break ARM build within today, we can shovel this in; otherwise
> >it needs to wait for next version of Xen.
>
> I would wait for a backport here. Stefano, any opinions?
>
> Regards,
>
> --
> Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH for-4.7 1/1] xen/arm: Rename map_regions_rw_cache and use p2m.default_access
2016-06-08 8:22 ` Julien Grall
2016-06-08 8:25 ` Wei Liu
@ 2016-06-08 9:36 ` Stefano Stabellini
2016-06-09 15:55 ` Edgar E. Iglesias
1 sibling, 1 reply; 7+ messages in thread
From: Stefano Stabellini @ 2016-06-08 9:36 UTC (permalink / raw)
To: Julien Grall
Cc: edgar.iglesias, Edgar E. Iglesias, sstabellini, Wei Liu, xen-devel
On Wed, 8 Jun 2016, Julien Grall wrote:
> Hi Wei,
>
> On 08/06/2016 09:17, Wei Liu wrote:
> > On Wed, Jun 08, 2016 at 02:15:27AM +0200, Edgar E. Iglesias wrote:
> > > From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
> > >
> > > Rename map_regions_rw_cache to map_regions_cache and make it use
> > > p2m.default_access.
> > >
> > > Suggested-by: Julien Grall <julien.grall@arm.com>
> > > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> >
> > I don't think this is absolutely necessary for 4.7.
> >
> > On the other hand, it is just straight renaming, which should be quite
> > safe.
>
> This patch does not only contain a renaming, it also contain a change to fix
> the default memaccess attribute.
>
> However, I don't see why we should rename the function to map_regions_cache
> given this will always map the region Read-Write (p2m_mmio_direct prevents the
> execution of the memory).
>
> > If I can get an ack or review from maintainers and confirmation that it
> > doesn't break ARM build within today, we can shovel this in; otherwise
> > it needs to wait for next version of Xen.
>
> I would wait for a backport here. Stefano, any opinions?
Indeed, I would also wait for a backport
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH for-4.7 1/1] xen/arm: Rename map_regions_rw_cache and use p2m.default_access
2016-06-08 9:36 ` Stefano Stabellini
@ 2016-06-09 15:55 ` Edgar E. Iglesias
0 siblings, 0 replies; 7+ messages in thread
From: Edgar E. Iglesias @ 2016-06-09 15:55 UTC (permalink / raw)
To: Stefano Stabellini; +Cc: Edgar E. Iglesias, Julien Grall, Wei Liu, xen-devel
On Wed, Jun 08, 2016 at 10:36:19AM +0100, Stefano Stabellini wrote:
> On Wed, 8 Jun 2016, Julien Grall wrote:
> > Hi Wei,
> >
> > On 08/06/2016 09:17, Wei Liu wrote:
> > > On Wed, Jun 08, 2016 at 02:15:27AM +0200, Edgar E. Iglesias wrote:
> > > > From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
> > > >
> > > > Rename map_regions_rw_cache to map_regions_cache and make it use
> > > > p2m.default_access.
> > > >
> > > > Suggested-by: Julien Grall <julien.grall@arm.com>
> > > > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> > >
> > > I don't think this is absolutely necessary for 4.7.
> > >
> > > On the other hand, it is just straight renaming, which should be quite
> > > safe.
> >
> > This patch does not only contain a renaming, it also contain a change to fix
> > the default memaccess attribute.
> >
> > However, I don't see why we should rename the function to map_regions_cache
> > given this will always map the region Read-Write (p2m_mmio_direct prevents the
> > execution of the memory).
> >
> > > If I can get an ack or review from maintainers and confirmation that it
> > > doesn't break ARM build within today, we can shovel this in; otherwise
> > > it needs to wait for next version of Xen.
> >
> > I would wait for a backport here. Stefano, any opinions?
>
> Indeed, I would also wait for a backport
OK, Sounds good. I'm travelling at the moment so it might take a couple of
weeks for me to get back to this.
Cheers,
Edgar
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH for-4.7 1/1] xen/arm: Rename map_regions_rw_cache and use p2m.default_access
2016-06-08 0:15 [PATCH for-4.7 1/1] xen/arm: Rename map_regions_rw_cache and use p2m.default_access Edgar E. Iglesias
2016-06-08 8:17 ` Wei Liu
@ 2016-06-08 8:24 ` Julien Grall
1 sibling, 0 replies; 7+ messages in thread
From: Julien Grall @ 2016-06-08 8:24 UTC (permalink / raw)
To: Edgar E. Iglesias, xen-devel; +Cc: edgar.iglesias, sstabellini, wei.liu2
Hi Edgar,
On 08/06/2016 01:15, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
>
> Rename map_regions_rw_cache to map_regions_cache and make it use
> p2m.default_access.
Why have you renamed the function? The current name corresponds to the
behavior of the code, i.e map the region cache and only read-write
(p2m_mmio_direct prevents the execution).
Regards,
--
Julien Grall
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-06-09 15:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-08 0:15 [PATCH for-4.7 1/1] xen/arm: Rename map_regions_rw_cache and use p2m.default_access Edgar E. Iglesias
2016-06-08 8:17 ` Wei Liu
2016-06-08 8:22 ` Julien Grall
2016-06-08 8:25 ` Wei Liu
2016-06-08 9:36 ` Stefano Stabellini
2016-06-09 15:55 ` Edgar E. Iglesias
2016-06-08 8:24 ` Julien Grall
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.