diff options
author | Hillf Danton <hdanton@sina.com> | 2019-04-30 20:26:08 +0200 |
---|---|---|
committer | Stefano Stabellini <sstabellini@kernel.org> | 2019-04-30 20:26:08 +0200 |
commit | fe846979d30576107aa9910e1820fec3c20e62d7 (patch) | |
tree | 8621314e874d81ff5cd91661036887b03d6f4d9a /arch/arm/xen/p2m.c | |
parent | xen/arm: Free p2m entry if fail to add it to RB tree (diff) | |
download | linux-fe846979d30576107aa9910e1820fec3c20e62d7.tar.xz linux-fe846979d30576107aa9910e1820fec3c20e62d7.zip |
xen/arm: Use p2m entry with lock protection
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>
Diffstat (limited to 'arch/arm/xen/p2m.c')
-rw-r--r-- | arch/arm/xen/p2m.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/xen/p2m.c b/arch/arm/xen/p2m.c index d3f632c88890..da2a7044a124 100644 --- a/arch/arm/xen/p2m.c +++ b/arch/arm/xen/p2m.c @@ -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; |