From: Greg Kroah-Hartman Date: Tue, 10 Jun 2014 00:01:04 +0000 (-0700) Subject: 3.4-stable patches X-Git-Tag: v3.14.7~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f63ba274b842b40fa12fa792254dd537b27905d;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: xen-p2m-allow-alloc_p2m_middle-to-call-reserve_brk-depending-on-argument.patch xen-p2m-collapse-early_alloc_p2m_middle-redundant-checks.patch --- diff --git a/queue-3.4/series b/queue-3.4/series index 92124097c72..0225198955f 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -76,3 +76,5 @@ fix-4-port-and-add-support-for-8-port-unknown-pci-serial-port-cards.patch 8250-16-50-add-support-for-broadcom-trumanage-redirected-serial-port.patch tty-serial-add-support-for-altera-serial-port.patch xen-p2m-move-code-around-to-allow-for-better-re-usage.patch +xen-p2m-allow-alloc_p2m_middle-to-call-reserve_brk-depending-on-argument.patch +xen-p2m-collapse-early_alloc_p2m_middle-redundant-checks.patch diff --git a/queue-3.4/xen-p2m-allow-alloc_p2m_middle-to-call-reserve_brk-depending-on-argument.patch b/queue-3.4/xen-p2m-allow-alloc_p2m_middle-to-call-reserve_brk-depending-on-argument.patch new file mode 100644 index 00000000000..88a66fda537 --- /dev/null +++ b/queue-3.4/xen-p2m-allow-alloc_p2m_middle-to-call-reserve_brk-depending-on-argument.patch @@ -0,0 +1,66 @@ +From cef4cca551d652b7f69c9d76337c5fae24e069dc Mon Sep 17 00:00:00 2001 +From: Konrad Rzeszutek Wilk +Date: Fri, 30 Mar 2012 14:15:14 -0400 +Subject: xen/p2m: Allow alloc_p2m_middle to call reserve_brk depending on argument + +From: Konrad Rzeszutek Wilk + +commit cef4cca551d652b7f69c9d76337c5fae24e069dc upstream. + +For identity cases we want to call reserve_brk only on the boundary +conditions of the middle P2M (so P2M[x][y][0] = extend_brk). This is +to work around identify regions (PCI spaces, gaps in E820) which are not +aligned on 2MB regions. + +However for the case were we want to allocate P2M middle leafs at the +early bootup stage, irregardless of this alignment check we need some +means of doing that. For that we provide the new argument. + +Signed-off-by: Daniel Kiper +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/xen/p2m.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/arch/x86/xen/p2m.c ++++ b/arch/x86/xen/p2m.c +@@ -499,7 +499,7 @@ static bool alloc_p2m(unsigned long pfn) + return true; + } + +-static bool __init early_alloc_p2m_middle(unsigned long pfn) ++static bool __init early_alloc_p2m_middle(unsigned long pfn, bool check_boundary) + { + unsigned topidx, mididx, idx; + +@@ -508,7 +508,7 @@ static bool __init early_alloc_p2m_middl + idx = p2m_index(pfn); + + /* Pfff.. No boundary cross-over, lets get out. */ +- if (!idx) ++ if (!idx && check_boundary) + return false; + + WARN(p2m_top[topidx][mididx] == p2m_identity, +@@ -531,7 +531,7 @@ static bool __init early_alloc_p2m_middl + p2m_top[topidx][mididx] = p2m; + + /* 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", +@@ -592,8 +592,8 @@ unsigned long __init set_phys_range_iden + WARN_ON(!early_alloc_p2m(pfn)); + } + +- early_alloc_p2m_middle(pfn_s); +- early_alloc_p2m_middle(pfn_e); ++ early_alloc_p2m_middle(pfn_s, true); ++ early_alloc_p2m_middle(pfn_e, true); + + for (pfn = pfn_s; pfn < pfn_e; pfn++) + if (!__set_phys_to_machine(pfn, IDENTITY_FRAME(pfn))) diff --git a/queue-3.4/xen-p2m-collapse-early_alloc_p2m_middle-redundant-checks.patch b/queue-3.4/xen-p2m-collapse-early_alloc_p2m_middle-redundant-checks.patch new file mode 100644 index 00000000000..bbc029a29c2 --- /dev/null +++ b/queue-3.4/xen-p2m-collapse-early_alloc_p2m_middle-redundant-checks.patch @@ -0,0 +1,68 @@ +From d5096850b47424fb0f1c6a75b8f7184f7169319a Mon Sep 17 00:00:00 2001 +From: Konrad Rzeszutek Wilk +Date: Fri, 30 Mar 2012 14:16:49 -0400 +Subject: xen/p2m: Collapse early_alloc_p2m_middle redundant checks. + +From: Konrad Rzeszutek Wilk + +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 +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + 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)