From: Greg Kroah-Hartman Date: Mon, 27 Aug 2012 17:28:31 +0000 (-0700) Subject: 3.4-stable patches X-Git-Tag: v3.5.4~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6809f003c98e7a6ffe96054e931ac03e09922c3;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: xen-setup-fix-one-off-error-when-adding-for-balloon-pfns-to-the-p2m.patch --- diff --git a/queue-3.4/revert-dma-imx-dma-fix-kernel-crash-due-to-missing-clock-conversion.patch b/queue-3.4/revert-dma-imx-dma-fix-kernel-crash-due-to-missing-clock-conversion.patch index ba0de9a48f3..c5f9e144239 100644 --- a/queue-3.4/revert-dma-imx-dma-fix-kernel-crash-due-to-missing-clock-conversion.patch +++ b/queue-3.4/revert-dma-imx-dma-fix-kernel-crash-due-to-missing-clock-conversion.patch @@ -15,26 +15,26 @@ Cc: Sascha Hauer Cc: Vinod Koul Signed-off-by: Greg Kroah-Hartman ---- b/drivers/dma/imx-dma.c -+++ a/drivers/dma/imx-dma.c -@@ -172,8 +172,7 @@ +--- + drivers/dma/imx-dma.c | 36 +++++++++++------------------------- + 1 file changed, 11 insertions(+), 25 deletions(-) + +--- a/drivers/dma/imx-dma.c ++++ b/drivers/dma/imx-dma.c +@@ -172,8 +172,7 @@ struct imxdma_engine { struct device_dma_parameters dma_parms; struct dma_device dma_device; void __iomem *base; -+ struct clk *dma_clk; - struct clk *dma_ahb; - struct clk *dma_ipg; ++ struct clk *dma_clk; spinlock_t lock; struct imx_dma_2d_config slots_2d[IMX_DMA_2D_SLOTS]; struct imxdma_channel channel[IMX_DMA_CHANNELS]; -@@ -977,20 +976,10 @@ +@@ -977,20 +976,10 @@ static int __init imxdma_probe(struct pl return 0; } -+ imxdma->dma_clk = clk_get(NULL, "dma"); -+ if (IS_ERR(imxdma->dma_clk)) -+ return PTR_ERR(imxdma->dma_clk); -+ clk_enable(imxdma->dma_clk); - imxdma->dma_ipg = devm_clk_get(&pdev->dev, "ipg"); - if (IS_ERR(imxdma->dma_ipg)) { - ret = PTR_ERR(imxdma->dma_ipg); @@ -49,48 +49,52 @@ Signed-off-by: Greg Kroah-Hartman - - clk_prepare_enable(imxdma->dma_ipg); - clk_prepare_enable(imxdma->dma_ahb); ++ imxdma->dma_clk = clk_get(NULL, "dma"); ++ if (IS_ERR(imxdma->dma_clk)) ++ return PTR_ERR(imxdma->dma_clk); ++ clk_enable(imxdma->dma_clk); /* reset DMA module */ imx_dmav1_writel(imxdma, DCR_DRST, DMA_DCR); -@@ -999,14 +988,16 @@ +@@ -999,14 +988,16 @@ static int __init imxdma_probe(struct pl ret = request_irq(MX1_DMA_INT, dma_irq_handler, 0, "DMA", imxdma); if (ret) { dev_warn(imxdma->dev, "Can't register IRQ for DMA\n"); +- goto err_enable; + kfree(imxdma); + return ret; -- goto err_enable; } ret = request_irq(MX1_DMA_ERR, imxdma_err_handler, 0, "DMA", imxdma); if (ret) { dev_warn(imxdma->dev, "Can't register ERRIRQ for DMA\n"); free_irq(MX1_DMA_INT, NULL); +- goto err_enable; + kfree(imxdma); + return ret; -- goto err_enable; } } -@@ -1103,10 +1094,7 @@ +@@ -1103,10 +1094,7 @@ err_init: free_irq(MX1_DMA_INT, NULL); free_irq(MX1_DMA_ERR, NULL); } -+ -err_enable: - clk_disable_unprepare(imxdma->dma_ipg); - clk_disable_unprepare(imxdma->dma_ahb); -err_clk: ++ kfree(imxdma); return ret; } -@@ -1126,9 +1114,7 @@ +@@ -1126,9 +1114,7 @@ static int __exit imxdma_remove(struct p free_irq(MX1_DMA_ERR, NULL); } -+ kfree(imxdma); - clk_disable_unprepare(imxdma->dma_ipg); - clk_disable_unprepare(imxdma->dma_ahb); - kfree(imxdma); ++ kfree(imxdma); return 0; } diff --git a/queue-3.4/series b/queue-3.4/series index bdabbbf20ce..000d1c7c7d0 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -9,3 +9,4 @@ arm-omap2-fix-dmtimer-set-source-clock-failure.patch arm-s3c24xx-add-missing-dmach_dt_prop.patch arm-s3c24xx-fix-s3c2410_dma_enqueue-parameters.patch revert-dma-imx-dma-fix-kernel-crash-due-to-missing-clock-conversion.patch +xen-setup-fix-one-off-error-when-adding-for-balloon-pfns-to-the-p2m.patch diff --git a/queue-3.4/xen-setup-fix-one-off-error-when-adding-for-balloon-pfns-to-the-p2m.patch b/queue-3.4/xen-setup-fix-one-off-error-when-adding-for-balloon-pfns-to-the-p2m.patch new file mode 100644 index 00000000000..dd5c5f0e853 --- /dev/null +++ b/queue-3.4/xen-setup-fix-one-off-error-when-adding-for-balloon-pfns-to-the-p2m.patch @@ -0,0 +1,59 @@ +From c96aae1f7f393387d160211f60398d58463a7e65 Mon Sep 17 00:00:00 2001 +From: Konrad Rzeszutek Wilk +Date: Fri, 17 Aug 2012 16:43:28 -0400 +Subject: xen/setup: Fix one-off error when adding for-balloon PFNs to the P2M. + +From: Konrad Rzeszutek Wilk + +commit c96aae1f7f393387d160211f60398d58463a7e65 upstream. + +When we are finished with return PFNs to the hypervisor, then +populate it back, and also mark the E820 MMIO and E820 gaps +as IDENTITY_FRAMEs, we then call P2M to set areas that can +be used for ballooning. We were off by one, and ended up +over-writting a P2M entry that most likely was an IDENTITY_FRAME. +For example: + +1-1 mapping on 40000->40200 +1-1 mapping on bc558->bc5ac +1-1 mapping on bc5b4->bc8c5 +1-1 mapping on bc8c6->bcb7c +1-1 mapping on bcd00->100000 +Released 614 pages of unused memory +Set 277889 page(s) to 1-1 mapping +Populating 40200-40466 pfn range: 614 pages added + +=> here we set from 40466 up to bc559 P2M tree to be +INVALID_P2M_ENTRY. We should have done it up to bc558. + +The end result is that if anybody is trying to construct +a PTE for PFN bc558 they end up with ~PAGE_PRESENT. + +Reported-by-and-Tested-by: Andre Przywara +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/xen/setup.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +--- a/arch/x86/xen/setup.c ++++ b/arch/x86/xen/setup.c +@@ -79,9 +79,16 @@ static void __init xen_add_extra_mem(u64 + memblock_reserve(start, size); + + xen_max_p2m_pfn = PFN_DOWN(start + size); ++ for (pfn = PFN_DOWN(start); pfn < xen_max_p2m_pfn; pfn++) { ++ unsigned long mfn = pfn_to_mfn(pfn); ++ ++ if (WARN(mfn == pfn, "Trying to over-write 1-1 mapping (pfn: %lx)\n", pfn)) ++ continue; ++ WARN(mfn != INVALID_P2M_ENTRY, "Trying to remove %lx which has %lx mfn!\n", ++ pfn, mfn); + +- for (pfn = PFN_DOWN(start); pfn <= xen_max_p2m_pfn; pfn++) + __set_phys_to_machine(pfn, INVALID_P2M_ENTRY); ++ } + } + + static unsigned long __init xen_release_chunk(unsigned long start,