From: Greg Kroah-Hartman Date: Thu, 20 Feb 2014 20:40:50 +0000 (-0800) Subject: 3.12-stable patches X-Git-Tag: v3.4.82~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8b6888396c7b0bd6030d9f91d8499a7bad016a1b;p=thirdparty%2Fkernel%2Fstable-queue.git 3.12-stable patches added patches: xen-blkfront-handle-backend-closed-without-closing.patch xen-properly-account-for-_page_numa-during-xen-pte-translations.patch --- diff --git a/queue-3.12/series b/queue-3.12/series new file mode 100644 index 00000000000..0ba4895483b --- /dev/null +++ b/queue-3.12/series @@ -0,0 +1,2 @@ +xen-properly-account-for-_page_numa-during-xen-pte-translations.patch +xen-blkfront-handle-backend-closed-without-closing.patch diff --git a/queue-3.12/xen-blkfront-handle-backend-closed-without-closing.patch b/queue-3.12/xen-blkfront-handle-backend-closed-without-closing.patch new file mode 100644 index 00000000000..97d1417172e --- /dev/null +++ b/queue-3.12/xen-blkfront-handle-backend-closed-without-closing.patch @@ -0,0 +1,44 @@ +From 3661371701e714f0cea4120f6a365340858fb4e4 Mon Sep 17 00:00:00 2001 +From: David Vrabel +Date: Tue, 4 Feb 2014 18:53:56 +0000 +Subject: xen-blkfront: handle backend CLOSED without CLOSING + +From: David Vrabel + +commit 3661371701e714f0cea4120f6a365340858fb4e4 upstream. + +Backend drivers shouldn't transistion to CLOSED unless the frontend is +CLOSED. If a backend does transition to CLOSED too soon then the +frontend may not see the CLOSING state and will not properly shutdown. + +So, treat an unexpected backend CLOSED state the same as CLOSING. + +Signed-off-by: David Vrabel +Acked-by: Konrad Rzeszutek Wilk +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/block/xen-blkfront.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/block/xen-blkfront.c ++++ b/drivers/block/xen-blkfront.c +@@ -1852,13 +1852,16 @@ static void blkback_changed(struct xenbu + case XenbusStateReconfiguring: + case XenbusStateReconfigured: + case XenbusStateUnknown: +- case XenbusStateClosed: + break; + + case XenbusStateConnected: + blkfront_connect(info); + break; + ++ case XenbusStateClosed: ++ if (dev->state == XenbusStateClosed) ++ break; ++ /* Missed the backend's Closing state -- fallthrough */ + case XenbusStateClosing: + blkfront_closing(info); + break; diff --git a/queue-3.12/xen-properly-account-for-_page_numa-during-xen-pte-translations.patch b/queue-3.12/xen-properly-account-for-_page_numa-during-xen-pte-translations.patch new file mode 100644 index 00000000000..9135d41634a --- /dev/null +++ b/queue-3.12/xen-properly-account-for-_page_numa-during-xen-pte-translations.patch @@ -0,0 +1,104 @@ +From a9c8e4beeeb64c22b84c803747487857fe424b68 Mon Sep 17 00:00:00 2001 +From: Mel Gorman +Date: Mon, 10 Feb 2014 14:25:40 -0800 +Subject: xen: properly account for _PAGE_NUMA during xen pte translations + +From: Mel Gorman + +commit a9c8e4beeeb64c22b84c803747487857fe424b68 upstream. + +Steven Noonan forwarded a users report where they had a problem starting +vsftpd on a Xen paravirtualized guest, with this in dmesg: + + BUG: Bad page map in process vsftpd pte:8000000493b88165 pmd:e9cc01067 + page:ffffea00124ee200 count:0 mapcount:-1 mapping: (null) index:0x0 + page flags: 0x2ffc0000000014(referenced|dirty) + addr:00007f97eea74000 vm_flags:00100071 anon_vma:ffff880e98f80380 mapping: (null) index:7f97eea74 + CPU: 4 PID: 587 Comm: vsftpd Not tainted 3.12.7-1-ec2 #1 + Call Trace: + dump_stack+0x45/0x56 + print_bad_pte+0x22e/0x250 + unmap_single_vma+0x583/0x890 + unmap_vmas+0x65/0x90 + exit_mmap+0xc5/0x170 + mmput+0x65/0x100 + do_exit+0x393/0x9e0 + do_group_exit+0xcc/0x140 + SyS_exit_group+0x14/0x20 + system_call_fastpath+0x1a/0x1f + Disabling lock debugging due to kernel taint + BUG: Bad rss-counter state mm:ffff880e9ca60580 idx:0 val:-1 + BUG: Bad rss-counter state mm:ffff880e9ca60580 idx:1 val:1 + +The issue could not be reproduced under an HVM instance with the same +kernel, so it appears to be exclusive to paravirtual Xen guests. He +bisected the problem to commit 1667918b6483 ("mm: numa: clear numa +hinting information on mprotect") that was also included in 3.12-stable. + +The problem was related to how xen translates ptes because it was not +accounting for the _PAGE_NUMA bit. This patch splits pte_present to add +a pteval_present helper for use by xen so both bare metal and xen use +the same code when checking if a PTE is present. + +[mgorman@suse.de: wrote changelog, proposed minor modifications] +[akpm@linux-foundation.org: fix typo in comment] +Reported-by: Steven Noonan +Tested-by: Steven Noonan +Signed-off-by: Elena Ufimtseva +Signed-off-by: Mel Gorman +Reviewed-by: David Vrabel +Acked-by: Konrad Rzeszutek Wilk +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/include/asm/pgtable.h | 14 ++++++++++++-- + arch/x86/xen/mmu.c | 4 ++-- + 2 files changed, 14 insertions(+), 4 deletions(-) + +--- a/arch/x86/include/asm/pgtable.h ++++ b/arch/x86/include/asm/pgtable.h +@@ -445,10 +445,20 @@ static inline int pte_same(pte_t a, pte_ + return a.pte == b.pte; + } + ++static inline int pteval_present(pteval_t pteval) ++{ ++ /* ++ * Yes Linus, _PAGE_PROTNONE == _PAGE_NUMA. Expressing it this ++ * way clearly states that the intent is that protnone and numa ++ * hinting ptes are considered present for the purposes of ++ * pagetable operations like zapping, protection changes, gup etc. ++ */ ++ return pteval & (_PAGE_PRESENT | _PAGE_PROTNONE | _PAGE_NUMA); ++} ++ + static inline int pte_present(pte_t a) + { +- return pte_flags(a) & (_PAGE_PRESENT | _PAGE_PROTNONE | +- _PAGE_NUMA); ++ return pteval_present(pte_flags(a)); + } + + #define pte_accessible pte_accessible +--- a/arch/x86/xen/mmu.c ++++ b/arch/x86/xen/mmu.c +@@ -365,7 +365,7 @@ void xen_ptep_modify_prot_commit(struct + /* Assume pteval_t is equivalent to all the other *val_t types. */ + static pteval_t pte_mfn_to_pfn(pteval_t val) + { +- if (val & _PAGE_PRESENT) { ++ if (pteval_present(val)) { + unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; + unsigned long pfn = mfn_to_pfn(mfn); + +@@ -381,7 +381,7 @@ static pteval_t pte_mfn_to_pfn(pteval_t + + static pteval_t pte_pfn_to_mfn(pteval_t val) + { +- if (val & _PAGE_PRESENT) { ++ if (pteval_present(val)) { + unsigned long pfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; + pteval_t flags = val & PTE_FLAGS_MASK; + unsigned long mfn;