Skip to contentSkip to conversation

xen/arm: Use p2m entry with lock protection

PATCH Stefano Stabellini 1 participant 2 messages Apr 30, 2019 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 2 lines · Hillf Danton

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

Same comment about html and space damage. But the change looks correct.

Quoted 31 lines
Cc Stefano Stabellini <[email protected]>

---

--- 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

(quoted diff) +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;

             }

Quoted 10 lines

             if (pfn < entry->pfn)

                    n = n->rb_left;

--

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

#2 lore raw
Quoted 5 lines · Stefano Stabellini
Quoted 2 lines · Hillf Danton

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

Same comment about html and space damage. But the change looks correct.

I fixed up the patches and committed both of them to the xentip tree.

Quoted 33 lines
Quoted 33 lines
Cc Stefano Stabellini <[email protected]>

---

--- 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

(quoted diff) +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)

Quoted 8 lines
Quoted 8 lines

                    n = n->rb_left;

--

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