All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 2/2] xen/arm: Use p2m entry with lock protection
@ 2019-04-30  5:37 ` Hillf Danton
  0 siblings, 0 replies; 4+ messages in thread
From: Hillf Danton @ 2019-04-30  5:37 UTC (permalink / raw)
  To: xen-devel; +Cc: Stefano Stabellini <sstabellini@kernel.org>


[-- Attachment #1.1: Type: text/plain, Size: 727 bytes --]

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

Cc: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Hillf Danton <hdanton@sina.com>
---

--- a/arch/arm/xen/p2m.c	2019-04-30 12:32:05.363768200 +0800
+++ b/arch/arm/xen/p2m.c	2019-04-30 12:58:19.854334100 +0800
@@ -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;
--


[-- Attachment #1.2: Type: text/html, Size: 3233 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <20190430053741.F1C0C2080C@mail.kernel.org>]

end of thread, other threads:[~2019-04-30 19:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-30  5:37 [patch 2/2] xen/arm: Use p2m entry with lock protection Hillf Danton
2019-04-30  5:37 ` [Xen-devel] " Hillf Danton
     [not found] <20190430053741.F1C0C2080C@mail.kernel.org>
2019-04-30 16:21 ` Stefano Stabellini
2019-04-30 19:56   ` Stefano Stabellini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.