Commit fe846979 authored by Hillf Danton's avatar Hillf Danton Committed by Stefano Stabellini

xen/arm: Use p2m entry with lock protection

A new local variable is introduced for accessing p2m entry with lock
protection.
Signed-off-by: default avatarHillf Danton <hdanton@sina.com>
Signed-off-by: default avatarStefano Stabellini <sstabellini@kernel.org>
Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
parent 425f1cc2
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment