From: Greg Kroah-Hartman Date: Sat, 2 May 2015 12:29:29 +0000 (+0200) Subject: 3.14-stable patches X-Git-Tag: v3.10.77~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c3bec68dbdce0b33f754c63ce439bc01be40d519;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: kvm-s390-zero-out-current-vmdb-of-stsi-before-including-level3-data.patch kvm-use-slowpath-for-cross-page-cached-accesses.patch mips-hibernate-flush-tlb-entries-earlier.patch s390-hibernate-fix-save-and-restore-of-kernel-text-section.patch --- diff --git a/queue-3.14/kvm-s390-zero-out-current-vmdb-of-stsi-before-including-level3-data.patch b/queue-3.14/kvm-s390-zero-out-current-vmdb-of-stsi-before-including-level3-data.patch new file mode 100644 index 00000000000..f0b5d1be0e9 --- /dev/null +++ b/queue-3.14/kvm-s390-zero-out-current-vmdb-of-stsi-before-including-level3-data.patch @@ -0,0 +1,31 @@ +From b75f4c9afac2604feb971441116c07a24ecca1ec Mon Sep 17 00:00:00 2001 +From: Ekaterina Tumanova +Date: Tue, 3 Mar 2015 09:54:41 +0100 +Subject: KVM: s390: Zero out current VMDB of STSI before including level3 data. + +From: Ekaterina Tumanova + +commit b75f4c9afac2604feb971441116c07a24ecca1ec upstream. + +s390 documentation requires words 0 and 10-15 to be reserved and stored as +zeros. As we fill out all other fields, we can memset the full structure. + +Signed-off-by: Ekaterina Tumanova +Reviewed-by: David Hildenbrand +Signed-off-by: Christian Borntraeger +Signed-off-by: Greg Kroah-Hartman + +--- + arch/s390/kvm/priv.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/s390/kvm/priv.c ++++ b/arch/s390/kvm/priv.c +@@ -414,6 +414,7 @@ static void handle_stsi_3_2_2(struct kvm + for (n = mem->count - 1; n > 0 ; n--) + memcpy(&mem->vm[n], &mem->vm[n - 1], sizeof(mem->vm[0])); + ++ memset(&mem->vm[0], 0, sizeof(mem->vm[0])); + mem->vm[0].cpus_total = cpus; + mem->vm[0].cpus_configured = cpus; + mem->vm[0].cpus_standby = 0; diff --git a/queue-3.14/kvm-use-slowpath-for-cross-page-cached-accesses.patch b/queue-3.14/kvm-use-slowpath-for-cross-page-cached-accesses.patch new file mode 100644 index 00000000000..a266e28cdaa --- /dev/null +++ b/queue-3.14/kvm-use-slowpath-for-cross-page-cached-accesses.patch @@ -0,0 +1,43 @@ +From ca3f0874723fad81d0c701b63ae3a17a408d5f25 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= +Date: Wed, 8 Apr 2015 14:16:48 +0200 +Subject: KVM: use slowpath for cross page cached accesses +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= + +commit ca3f0874723fad81d0c701b63ae3a17a408d5f25 upstream. + +kvm_write_guest_cached() does not mark all written pages as dirty and +code comments in kvm_gfn_to_hva_cache_init() talk about NULL memslot +with cross page accesses. Fix all the easy way. + +The check is '<= 1' to have the same result for 'len = 0' cache anywhere +in the page. (nr_pages_needed is 0 on page boundary.) + +Fixes: 8f964525a121 ("KVM: Allow cross page reads and writes from cached translations.") +Signed-off-by: Radim Krčmář +Message-Id: <20150408121648.GA3519@potion.brq.redhat.com> +Reviewed-by: Wanpeng Li +Signed-off-by: Paolo Bonzini +Signed-off-by: Greg Kroah-Hartman + +--- + virt/kvm/kvm_main.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/virt/kvm/kvm_main.c ++++ b/virt/kvm/kvm_main.c +@@ -1549,8 +1549,8 @@ int kvm_gfn_to_hva_cache_init(struct kvm + ghc->generation = slots->generation; + ghc->len = len; + ghc->memslot = gfn_to_memslot(kvm, start_gfn); +- ghc->hva = gfn_to_hva_many(ghc->memslot, start_gfn, &nr_pages_avail); +- if (!kvm_is_error_hva(ghc->hva) && nr_pages_avail >= nr_pages_needed) { ++ ghc->hva = gfn_to_hva_many(ghc->memslot, start_gfn, NULL); ++ if (!kvm_is_error_hva(ghc->hva) && nr_pages_needed <= 1) { + ghc->hva += offset; + } else { + /* diff --git a/queue-3.14/mips-hibernate-flush-tlb-entries-earlier.patch b/queue-3.14/mips-hibernate-flush-tlb-entries-earlier.patch new file mode 100644 index 00000000000..764694c63a0 --- /dev/null +++ b/queue-3.14/mips-hibernate-flush-tlb-entries-earlier.patch @@ -0,0 +1,45 @@ +From a843d00d038b11267279e3b5388222320f9ddc1d Mon Sep 17 00:00:00 2001 +From: Huacai Chen +Date: Sun, 29 Mar 2015 10:54:05 +0800 +Subject: MIPS: Hibernate: flush TLB entries earlier + +From: Huacai Chen + +commit a843d00d038b11267279e3b5388222320f9ddc1d upstream. + +We found that TLB mismatch not only happens after kernel resume, but +also happens during snapshot restore. So move it to the beginning of +swsusp_arch_suspend(). + +Signed-off-by: Huacai Chen +Cc: Steven J. Hill +Cc: linux-mips@linux-mips.org +Cc: Fuxin Zhang +Cc: Zhangjin Wu +Patchwork: https://patchwork.linux-mips.org/patch/9621/ +Signed-off-by: Ralf Baechle +Signed-off-by: Greg Kroah-Hartman + +--- + arch/mips/power/hibernate.S | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/mips/power/hibernate.S ++++ b/arch/mips/power/hibernate.S +@@ -30,6 +30,8 @@ LEAF(swsusp_arch_suspend) + END(swsusp_arch_suspend) + + LEAF(swsusp_arch_resume) ++ /* Avoid TLB mismatch during and after kernel resume */ ++ jal local_flush_tlb_all + PTR_L t0, restore_pblist + 0: + PTR_L t1, PBE_ADDRESS(t0) /* source */ +@@ -43,7 +45,6 @@ LEAF(swsusp_arch_resume) + bne t1, t3, 1b + PTR_L t0, PBE_NEXT(t0) + bnez t0, 0b +- jal local_flush_tlb_all /* Avoid TLB mismatch after kernel resume */ + PTR_LA t0, saved_regs + PTR_L ra, PT_R31(t0) + PTR_L sp, PT_R29(t0) diff --git a/queue-3.14/s390-hibernate-fix-save-and-restore-of-kernel-text-section.patch b/queue-3.14/s390-hibernate-fix-save-and-restore-of-kernel-text-section.patch new file mode 100644 index 00000000000..8fc88ea5b59 --- /dev/null +++ b/queue-3.14/s390-hibernate-fix-save-and-restore-of-kernel-text-section.patch @@ -0,0 +1,74 @@ +From d74419495633493c9cd3f2bbeb7f3529d0edded6 Mon Sep 17 00:00:00 2001 +From: Heiko Carstens +Date: Wed, 25 Mar 2015 10:13:33 +0100 +Subject: s390/hibernate: fix save and restore of kernel text section + +From: Heiko Carstens + +commit d74419495633493c9cd3f2bbeb7f3529d0edded6 upstream. + +Sebastian reported a crash caused by a jump label mismatch after resume. +This happens because we do not save the kernel text section during suspend +and therefore also do not restore it during resume, but use the kernel image +that restores the old system. + +This means that after a suspend/resume cycle we lost all modifications done +to the kernel text section. +The reason for this is the pfn_is_nosave() function, which incorrectly +returns that read-only pages don't need to be saved. This is incorrect since +we mark the kernel text section read-only. +We still need to make sure to not save and restore pages contained within +NSS and DCSS segment. +To fix this add an extra case for the kernel text section and only save +those pages if they are not contained within an NSS segment. + +Fixes the following crash (and the above bugs as well): + +Jump label code mismatch at netif_receive_skb_internal+0x28/0xd0 +Found: c0 04 00 00 00 00 +Expected: c0 f4 00 00 00 11 +New: c0 04 00 00 00 00 +Kernel panic - not syncing: Corrupted kernel text +CPU: 0 PID: 9 Comm: migration/0 Not tainted 3.19.0-01975-gb1b096e70f23 #4 +Call Trace: + [<0000000000113972>] show_stack+0x72/0xf0 + [<000000000081f15e>] dump_stack+0x6e/0x90 + [<000000000081c4e8>] panic+0x108/0x2b0 + [<000000000081be64>] jump_label_bug.isra.2+0x104/0x108 + [<0000000000112176>] __jump_label_transform+0x9e/0xd0 + [<00000000001121e6>] __sm_arch_jump_label_transform+0x3e/0x50 + [<00000000001d1136>] multi_cpu_stop+0x12e/0x170 + [<00000000001d1472>] cpu_stopper_thread+0xb2/0x168 + [<000000000015d2ac>] smpboot_thread_fn+0x134/0x1b0 + [<0000000000158baa>] kthread+0x10a/0x110 + [<0000000000824a86>] kernel_thread_starter+0x6/0xc + +Reported-and-tested-by: Sebastian Ott +Signed-off-by: Heiko Carstens +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman + +--- + arch/s390/kernel/suspend.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/s390/kernel/suspend.c ++++ b/arch/s390/kernel/suspend.c +@@ -142,6 +142,8 @@ int pfn_is_nosave(unsigned long pfn) + { + unsigned long nosave_begin_pfn = PFN_DOWN(__pa(&__nosave_begin)); + unsigned long nosave_end_pfn = PFN_DOWN(__pa(&__nosave_end)); ++ unsigned long eshared_pfn = PFN_DOWN(__pa(&_eshared)) - 1; ++ unsigned long stext_pfn = PFN_DOWN(__pa(&_stext)); + + /* Always save lowcore pages (LC protection might be enabled). */ + if (pfn <= LC_PAGES) +@@ -149,6 +151,8 @@ int pfn_is_nosave(unsigned long pfn) + if (pfn >= nosave_begin_pfn && pfn < nosave_end_pfn) + return 1; + /* Skip memory holes and read-only pages (NSS, DCSS, ...). */ ++ if (pfn >= stext_pfn && pfn <= eshared_pfn) ++ return ipl_info.type == IPL_TYPE_NSS ? 1 : 0; + if (tprot(PFN_PHYS(pfn))) + return 1; + return 0; diff --git a/queue-3.14/series b/queue-3.14/series index 566e0545a06..c133f2623ef 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -9,3 +9,7 @@ btrfs-fix-inode-eviction-infinite-loop-after-cloning-into-it.patch btrfs-fix-inode-eviction-infinite-loop-after-extent_same-ioctl.patch sched-idle-x86-restore-mwait_idle-to-fix-boot-hangs-to-improve-power-savings-and-to-improve-performance.patch usb-gadget-composite-enable-besl-support.patch +kvm-s390-zero-out-current-vmdb-of-stsi-before-including-level3-data.patch +s390-hibernate-fix-save-and-restore-of-kernel-text-section.patch +kvm-use-slowpath-for-cross-page-cached-accesses.patch +mips-hibernate-flush-tlb-entries-earlier.patch