[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [RFC for-4.8 v2 2/7] xen/arm: Rename and generalize un/map_regions_rw_cache
From: "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxxx> Rename and generalize un/map_regions_rw_cache into un/map_regions. The new functions take the mapping attributes and access permissions as arguments. No functional change. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xxxxxxxxxx> --- xen/arch/arm/domain_build.c | 18 ++++++++++-------- xen/arch/arm/p2m.c | 28 ++++++++++++++++------------ xen/include/asm-arm/p2m.h | 22 +++++++++++++--------- 3 files changed, 39 insertions(+), 29 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 00dc07a..e4fed4b 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -1570,10 +1570,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, - paddr_to_pfn(addr & PAGE_MASK), - DIV_ROUND_UP(size, PAGE_SIZE), - paddr_to_pfn(addr & PAGE_MASK)); + res = map_regions(d, + paddr_to_pfn(addr & PAGE_MASK), + DIV_ROUND_UP(size, PAGE_SIZE), + paddr_to_pfn(addr & PAGE_MASK), + MATTR_MEM, p2m_access_rw); if ( res ) { panic(XENLOG_ERR "Unable to map ACPI region 0x%"PRIx64 @@ -1926,10 +1927,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, - 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(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)), + MATTR_MEM, p2m_access_rw); 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 0f1e1b1..a8538e5 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1217,30 +1217,34 @@ 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(struct domain *d, + unsigned long start_gfn, + unsigned long nr, + unsigned long mfn, + unsigned int mattr, + p2m_access_t access) { 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); + mattr, 0, p2m_mmio_direct, + access); } -int unmap_regions_rw_cache(struct domain *d, - unsigned long start_gfn, - unsigned long nr, - unsigned long mfn) +int unmap_regions(struct domain *d, + unsigned long start_gfn, + unsigned long nr, + unsigned long mfn, + unsigned int mattr, + p2m_access_t access) { 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); + mattr, 0, p2m_invalid, + 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..92c425e 100644 --- a/xen/include/asm-arm/p2m.h +++ b/xen/include/asm-arm/p2m.h @@ -144,15 +144,19 @@ 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(struct domain *d, + unsigned long start_gfn, + unsigned long nr, + unsigned long mfn, + unsigned int mattr, + p2m_access_t perms); + +int unmap_regions(struct domain *d, + unsigned long start_gfn, + unsigned long nr, + unsigned long mfn, + unsigned int mattr, + p2m_access_t perms); int map_dev_mmio_region(struct domain *d, unsigned long start_gfn, -- 2.5.0 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |