|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 2/4] x86: relax a few get_gfn() invocations
In a few cases only a query is intended, i.e. without populating a
possible PoD or paged out entry, when the intention is to replace the
current entry anyway. Use get_gfn_query() there instead.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
--- a/xen/arch/x86/hvm/grant_table.c
+++ b/xen/arch/x86/hvm/grant_table.c
@@ -59,7 +59,7 @@ int replace_grant_p2m_mapping(uint64_t a
if ( new_addr != 0 || (flags & GNTMAP_contains_pte) )
return GNTST_general_error;
- old_mfn = get_gfn(d, gfn, &type);
+ old_mfn = get_gfn_query(d, gfn, &type);
if ( !p2m_is_grant(type) || !mfn_eq(old_mfn, frame) )
{
put_gfn(d, gfn);
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4516,7 +4516,7 @@ int xenmem_add_to_physmap_one(
}
/* Remove previously mapped page if it was present. */
- prev_mfn = mfn_x(get_gfn(d, gfn_x(gpfn), &p2mt));
+ prev_mfn = mfn_x(get_gfn_query(d, gfn_x(gpfn), &p2mt));
if ( mfn_valid(_mfn(prev_mfn)) )
{
if ( is_xen_heap_mfn(prev_mfn) )
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -2938,7 +2938,7 @@ int p2m_add_foreign(struct domain *tdom,
mfn = page_to_mfn(page);
/* Remove previously mapped page if it is present. */
- prev_mfn = get_gfn(tdom, gpfn, &p2mt_prev);
+ prev_mfn = get_gfn_query(tdom, gpfn, &p2mt_prev);
if ( mfn_valid(prev_mfn) )
{
if ( is_xen_heap_mfn(mfn_x(prev_mfn)) )
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |