[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v4 3/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_p2mt. The new functions take the mapping attributes as an argument. No functional change. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xxxxxxxxxx> --- xen/arch/arm/domain_build.c | 18 ++++++++++-------- xen/arch/arm/p2m.c | 19 ++++++++++--------- xen/include/asm-arm/p2m.h | 23 ++++++++++++++--------- 3 files changed, 34 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 9912658..8e7eb68 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1235,18 +1235,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 9708fdc..a684ed0 100644 --- a/xen/include/asm-arm/p2m.h +++ b/xen/include/asm-arm/p2m.h @@ -167,15 +167,20 @@ 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); +/* + * Map a region in the guest p2m with a specific p2m type. + * The memory attributes will be derived from the p2m type. + */ +int map_regions_p2mt(struct domain *d, + gfn_t gfn, + unsigned long nr, + mfn_t mfn, + p2m_type_t p2mt); + +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, -- 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |