@@ -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
@@ -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,
@@ -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,