This is a note to let you know that I've just added the patch titled

    xen/p2m: Collapse early_alloc_p2m_middle redundant checks.

to the 3.4-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     xen-p2m-collapse-early_alloc_p2m_middle-redundant-checks.patch
and it can be found in the queue-3.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From d5096850b47424fb0f1c6a75b8f7184f7169319a Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <[email protected]>
Date: Fri, 30 Mar 2012 14:16:49 -0400
Subject: xen/p2m: Collapse early_alloc_p2m_middle redundant checks.

From: Konrad Rzeszutek Wilk <[email protected]>

commit d5096850b47424fb0f1c6a75b8f7184f7169319a upstream.

At the start of the function we were checking for idx != 0
and bailing out. And later calling extend_brk if idx != 0.

That is unnecessary so remove that checks.

Signed-off-by: Daniel Kiper <[email protected]>
Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 arch/x86/xen/p2m.c |   25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -502,6 +502,8 @@ static bool alloc_p2m(unsigned long pfn)
 static bool __init early_alloc_p2m_middle(unsigned long pfn, bool 
check_boundary)
 {
        unsigned topidx, mididx, idx;
+       unsigned long *p2m;
+       unsigned long *mid_mfn_p;
 
        topidx = p2m_top_index(pfn);
        mididx = p2m_mid_index(pfn);
@@ -522,24 +524,21 @@ static bool __init early_alloc_p2m_middl
                return false;
 
        /* Boundary cross-over for the edges: */
-       if (idx) {
-               unsigned long *p2m = extend_brk(PAGE_SIZE, PAGE_SIZE);
-               unsigned long *mid_mfn_p;
+       p2m = extend_brk(PAGE_SIZE, PAGE_SIZE);
 
-               p2m_init(p2m);
+       p2m_init(p2m);
 
-               p2m_top[topidx][mididx] = p2m;
+       p2m_top[topidx][mididx] = p2m;
 
-               /* For save/restore we need to MFN of the P2M saved */
+       /* For save/restore we need to MFN of the P2M saved */
 
-               mid_mfn_p = p2m_top_mfn_p[topidx];
-               WARN(mid_mfn_p[mididx] != virt_to_mfn(p2m_missing),
-                       "P2M_TOP_P[%d][%d] != MFN of p2m_missing!\n",
-                       topidx, mididx);
-               mid_mfn_p[mididx] = virt_to_mfn(p2m);
+       mid_mfn_p = p2m_top_mfn_p[topidx];
+       WARN(mid_mfn_p[mididx] != virt_to_mfn(p2m_missing),
+               "P2M_TOP_P[%d][%d] != MFN of p2m_missing!\n",
+               topidx, mididx);
+       mid_mfn_p[mididx] = virt_to_mfn(p2m);
 
-       }
-       return idx != 0;
+       return true;
 }
 
 static bool __init early_alloc_p2m(unsigned long pfn)


Patches currently in stable-queue which might be from [email protected] are

queue-3.4/xen-p2m-move-code-around-to-allow-for-better-re-usage.patch
queue-3.4/xen-p2m-collapse-early_alloc_p2m_middle-redundant-checks.patch
queue-3.4/xen-p2m-allow-alloc_p2m_middle-to-call-reserve_brk-depending-on-argument.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to