x86/p2m: drop p2m_access_t parameter from set_mmio_p2m_entry()

Both callers request the host P2M's default access, which can as well be
done inside the function. While touching this anyway, make the "gfn"
parameter type-safe as well.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@ciitrix.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Jan Beulich committed 2020-02-21 17:19:16 +01:00
1 parent a446a33011
commit b05cf27bab
3 files changed
+10 -11

No files matched your search

+2 -3
View File
@@ -3047,9 +3047,8 @@ static int vmx_alloc_vlapic_mapping(struct domain *d)
clear_domain_page(mfn);
d->arch.hvm.vmx.apic_access_mfn = mfn;
return set_mmio_p2m_entry(d, paddr_to_pfn(APIC_DEFAULT_PHYS_BASE), mfn,
PAGE_ORDER_4K,
p2m_get_hostp2m(d)->default_access);
return set_mmio_p2m_entry(d, gaddr_to_gfn(APIC_DEFAULT_PHYS_BASE), mfn,
PAGE_ORDER_4K);
}
static void vmx_free_vlapic_mapping(struct domain *d)
+6 -6
View File
@@ -1310,15 +1310,16 @@ int set_foreign_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
p2m_get_hostp2m(d)->default_access);
}
int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
unsigned int order, p2m_access_t access)
int set_mmio_p2m_entry(struct domain *d, gfn_t gfn, mfn_t mfn,
unsigned int order)
{
if ( order > PAGE_ORDER_4K &&
rangeset_overlaps_range(mmio_ro_ranges, mfn_x(mfn),
mfn_x(mfn) + (1UL << order) - 1) )
return PAGE_ORDER_4K + 1;
return set_typed_p2m_entry(d, gfn, mfn, order, p2m_mmio_direct, access);
return set_typed_p2m_entry(d, gfn_x(gfn), mfn, order, p2m_mmio_direct,
p2m_get_hostp2m(d)->default_access);
}
int set_identity_p2m_entry(struct domain *d, unsigned long gfn_l,
@@ -2288,9 +2289,8 @@ int map_mmio_regions(struct domain *d,
for ( order = mmio_order(d, (gfn_x(start_gfn) + i) | (mfn_x(mfn) + i), nr - i); ;
order = ret - 1 )
{
ret = set_mmio_p2m_entry(d, gfn_x(start_gfn) + i,
mfn_add(mfn, i), order,
p2m_get_hostp2m(d)->default_access);
ret = set_mmio_p2m_entry(d, gfn_add(start_gfn, i),
mfn_add(mfn, i), order);
if ( ret <= 0 )
break;
ASSERT(ret <= order);
+2 -2
View File
@@ -638,8 +638,8 @@ int p2m_is_logdirty_range(struct p2m_domain *, unsigned long start,
int set_foreign_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
/* Set mmio addresses in the p2m table (for pass-through) */
int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
unsigned int order, p2m_access_t access);
int set_mmio_p2m_entry(struct domain *d, gfn_t gfn, mfn_t mfn,
unsigned int order);
int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
unsigned int order);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.