Skip to content

Commit

Permalink
xen/arm: Use p2m entry with lock protection
Browse files Browse the repository at this point in the history
A new local variable is introduced for accessing p2m entry with lock
protection.

Signed-off-by: Hillf Danton <hdanton@sina.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
  • Loading branch information
Hillf Danton authored and Stefano Stabellini committed Apr 30, 2019
1 parent 425f1cc commit fe84697
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/arm/xen/p2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ unsigned long __pfn_to_mfn(unsigned long pfn)
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;
Expand Down

0 comments on commit fe84697

Please sign in to comment.