Skip to contentSkip to conversation

xen/arm: Use p2m entry with lock protection

PATCH New Hillf Danton 1 participant 1 message Apr 30, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 xen/arm: Use p2m entry with lock protection

A new local variable is introduced for accessing p2m entry with lock protection.

Cc Stefano Stabellini <[email protected]>

---

arch/arm/xen/p2m.c +0 -0
@@ -70,8 +70,9 @@ unsigned long __pfn_to_mfn(unsigned long
		entry = rb_entry(n, struct xen_p2m_entry, rbnode_phys);
		if (entry->pfn <= pfn &&
				entry->pfn + entry->nr_pages > pfn) {
+			unsigned long mfn = entry->mfn + (pfn - entry->pfn);
			read_unlock_irqrestore(&p2m_lock, irqflags);
-			return entry->mfn + (pfn - entry->pfn);
+			return mfn;
		}
		if (pfn < entry->pfn)
			n = n->rb_left;

--

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel