diff for duplicates of <1471513643214168@kroah.com> diff --git a/a/content_digest b/N1/content_digest index 7680d20..577165b 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -10,8 +10,7 @@ ralf@linux-mips.org rkrcmar@redhat.com " stable@vger.kernel.org\0" - "Cc\0<stable@vger.kernel.org>" - " <stable-commits@vger.kernel.org>\0" + "Cc\0stable-commits@vger.kernel.org\0" "\00:1\0" "b\0" "\n" @@ -29,4 +28,4 @@ "If you, or anyone else, feels it should not be added to the stable tree,\n" please let <stable@vger.kernel.org> know about it. -ca7d3f8db6f0509babc9922d4d89459abb18bdf91051e04296e7a44fbd3b7464 +8ce1e7c44b4f52b03e573c08f93655182d9426870b2af9481e783a86deb1c445
diff --git a/a/1.txt b/N2/1.txt index e9f081a..7ad1e3e 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -12,3 +12,133 @@ and it can be found in the queue-4.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@vger.kernel.org> know about it. + + +>From james.hogan@imgtec.com Thu Aug 18 11:45:02 2016 +From: James Hogan <james.hogan@imgtec.com> +Date: Thu, 18 Aug 2016 10:05:32 +0100 +Subject: [PATCH BACKPORT 3.17-4.4 4/4] MIPS: KVM: Propagate kseg0/mapped tlb fault errors +To: <stable@vger.kernel.org> +Cc: James Hogan <james.hogan@imgtec.com>, Paolo Bonzini <pbonzini@redhat.com>, Radim Krčmář <rkrcmar@redhat.com>, Ralf Baechle <ralf@linux-mips.org>, <linux-mips@linux-mips.org>, <kvm@vger.kernel.org> +Message-ID: <bc64b178eead8f261016756dc6d1348f4eba638c.1471018436.git-series.james.hogan@imgtec.com> + +From: James Hogan <james.hogan@imgtec.com> + +commit 9b731bcfdec4c159ad2e4312e25d69221709b96a upstream. + +Propagate errors from kvm_mips_handle_kseg0_tlb_fault() and +kvm_mips_handle_mapped_seg_tlb_fault(), usually triggering an internal +error since they normally indicate the guest accessed bad physical +memory or the commpage in an unexpected way. + +Fixes: 858dd5d45733 ("KVM/MIPS32: MMU/TLB operations for the Guest.") +Fixes: e685c689f3a8 ("KVM/MIPS32: Privileged instruction/target branch emulation.") +Signed-off-by: James Hogan <james.hogan@imgtec.com> +Cc: Paolo Bonzini <pbonzini@redhat.com> +Cc: "Radim Krčmář" <rkrcmar@redhat.com> +Cc: Ralf Baechle <ralf@linux-mips.org> +Cc: linux-mips@linux-mips.org +Cc: kvm@vger.kernel.org +Signed-off-by: Radim Krčmář <rkrcmar@redhat.com> +[james.hogan@imgtec.com: Backport to v3.17.y - v4.4.y] +Signed-off-by: James Hogan <james.hogan@imgtec.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + arch/mips/kvm/emulate.c | 40 ++++++++++++++++++++++++++++------------ + arch/mips/kvm/tlb.c | 14 ++++++++++---- + 2 files changed, 38 insertions(+), 16 deletions(-) + +--- a/arch/mips/kvm/emulate.c ++++ b/arch/mips/kvm/emulate.c +@@ -1629,8 +1629,14 @@ enum emulation_result kvm_mips_emulate_c + + preempt_disable(); + if (KVM_GUEST_KSEGX(va) == KVM_GUEST_KSEG0) { +- if (kvm_mips_host_tlb_lookup(vcpu, va) < 0) +- kvm_mips_handle_kseg0_tlb_fault(va, vcpu); ++ if (kvm_mips_host_tlb_lookup(vcpu, va) < 0 && ++ kvm_mips_handle_kseg0_tlb_fault(va, vcpu)) { ++ kvm_err("%s: handling mapped kseg0 tlb fault for %lx, vcpu: %p, ASID: %#lx\n", ++ __func__, va, vcpu, read_c0_entryhi()); ++ er = EMULATE_FAIL; ++ preempt_enable(); ++ goto done; ++ } + } else if ((KVM_GUEST_KSEGX(va) < KVM_GUEST_KSEG0) || + KVM_GUEST_KSEGX(va) == KVM_GUEST_KSEG23) { + int index; +@@ -1665,14 +1671,19 @@ enum emulation_result kvm_mips_emulate_c + run, vcpu); + preempt_enable(); + goto dont_update_pc; +- } else { +- /* +- * We fault an entry from the guest tlb to the +- * shadow host TLB +- */ +- kvm_mips_handle_mapped_seg_tlb_fault(vcpu, tlb, +- NULL, +- NULL); ++ } ++ /* ++ * We fault an entry from the guest tlb to the ++ * shadow host TLB ++ */ ++ if (kvm_mips_handle_mapped_seg_tlb_fault(vcpu, tlb, ++ NULL, NULL)) { ++ kvm_err("%s: handling mapped seg tlb fault for %lx, index: %u, vcpu: %p, ASID: %#lx\n", ++ __func__, va, index, vcpu, ++ read_c0_entryhi()); ++ er = EMULATE_FAIL; ++ preempt_enable(); ++ goto done; + } + } + } else { +@@ -2633,8 +2644,13 @@ enum emulation_result kvm_mips_handle_tl + * OK we have a Guest TLB entry, now inject it into the + * shadow host TLB + */ +- kvm_mips_handle_mapped_seg_tlb_fault(vcpu, tlb, NULL, +- NULL); ++ if (kvm_mips_handle_mapped_seg_tlb_fault(vcpu, tlb, ++ NULL, NULL)) { ++ kvm_err("%s: handling mapped seg tlb fault for %lx, index: %u, vcpu: %p, ASID: %#lx\n", ++ __func__, va, index, vcpu, ++ read_c0_entryhi()); ++ er = EMULATE_FAIL; ++ } + } + } + +--- a/arch/mips/kvm/tlb.c ++++ b/arch/mips/kvm/tlb.c +@@ -808,10 +808,16 @@ uint32_t kvm_get_inst(uint32_t *opc, str + local_irq_restore(flags); + return KVM_INVALID_INST; + } +- kvm_mips_handle_mapped_seg_tlb_fault(vcpu, +- &vcpu->arch. +- guest_tlb[index], +- NULL, NULL); ++ if (kvm_mips_handle_mapped_seg_tlb_fault(vcpu, ++ &vcpu->arch.guest_tlb[index], ++ NULL, NULL)) { ++ kvm_err("%s: handling mapped seg tlb fault failed for %p, index: %u, vcpu: %p, ASID: %#lx\n", ++ __func__, opc, index, vcpu, ++ read_c0_entryhi()); ++ kvm_mips_dump_guest_tlbs(vcpu); ++ local_irq_restore(flags); ++ return KVM_INVALID_INST; ++ } + inst = *(opc); + } + local_irq_restore(flags); + + +Patches currently in stable-queue which might be from james.hogan@imgtec.com are + +queue-4.4/mips-kvm-add-missing-gfn-range-check.patch +queue-4.4/mips-kvm-propagate-kseg0-mapped-tlb-fault-errors.patch +queue-4.4/mips-kvm-fix-mapped-fault-broken-commpage-handling.patch +queue-4.4/mips-kvm-fix-gfn-range-check-in-kseg0-tlb-faults.patch diff --git a/a/content_digest b/N2/content_digest index 7680d20..e61e721 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -27,6 +27,136 @@ "and it can be found in the queue-4.4 subdirectory.\n" "\n" "If you, or anyone else, feels it should not be added to the stable tree,\n" - please let <stable@vger.kernel.org> know about it. + "please let <stable@vger.kernel.org> know about it.\n" + "\n" + "\n" + ">From james.hogan@imgtec.com Thu Aug 18 11:45:02 2016\n" + "From: James Hogan <james.hogan@imgtec.com>\n" + "Date: Thu, 18 Aug 2016 10:05:32 +0100\n" + "Subject: [PATCH BACKPORT 3.17-4.4 4/4] MIPS: KVM: Propagate kseg0/mapped tlb fault errors\n" + "To: <stable@vger.kernel.org>\n" + "Cc: James Hogan <james.hogan@imgtec.com>, Paolo Bonzini <pbonzini@redhat.com>, Radim Kr\304\215m\303\241\305\231 <rkrcmar@redhat.com>, Ralf Baechle <ralf@linux-mips.org>, <linux-mips@linux-mips.org>, <kvm@vger.kernel.org>\n" + "Message-ID: <bc64b178eead8f261016756dc6d1348f4eba638c.1471018436.git-series.james.hogan@imgtec.com>\n" + "\n" + "From: James Hogan <james.hogan@imgtec.com>\n" + "\n" + "commit 9b731bcfdec4c159ad2e4312e25d69221709b96a upstream.\n" + "\n" + "Propagate errors from kvm_mips_handle_kseg0_tlb_fault() and\n" + "kvm_mips_handle_mapped_seg_tlb_fault(), usually triggering an internal\n" + "error since they normally indicate the guest accessed bad physical\n" + "memory or the commpage in an unexpected way.\n" + "\n" + "Fixes: 858dd5d45733 (\"KVM/MIPS32: MMU/TLB operations for the Guest.\")\n" + "Fixes: e685c689f3a8 (\"KVM/MIPS32: Privileged instruction/target branch emulation.\")\n" + "Signed-off-by: James Hogan <james.hogan@imgtec.com>\n" + "Cc: Paolo Bonzini <pbonzini@redhat.com>\n" + "Cc: \"Radim Kr\304\215m\303\241\305\231\" <rkrcmar@redhat.com>\n" + "Cc: Ralf Baechle <ralf@linux-mips.org>\n" + "Cc: linux-mips@linux-mips.org\n" + "Cc: kvm@vger.kernel.org\n" + "Signed-off-by: Radim Kr\304\215m\303\241\305\231 <rkrcmar@redhat.com>\n" + "[james.hogan@imgtec.com: Backport to v3.17.y - v4.4.y]\n" + "Signed-off-by: James Hogan <james.hogan@imgtec.com>\n" + "Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>\n" + "---\n" + " arch/mips/kvm/emulate.c | 40 ++++++++++++++++++++++++++++------------\n" + " arch/mips/kvm/tlb.c | 14 ++++++++++----\n" + " 2 files changed, 38 insertions(+), 16 deletions(-)\n" + "\n" + "--- a/arch/mips/kvm/emulate.c\n" + "+++ b/arch/mips/kvm/emulate.c\n" + "@@ -1629,8 +1629,14 @@ enum emulation_result kvm_mips_emulate_c\n" + " \n" + " \tpreempt_disable();\n" + " \tif (KVM_GUEST_KSEGX(va) == KVM_GUEST_KSEG0) {\n" + "-\t\tif (kvm_mips_host_tlb_lookup(vcpu, va) < 0)\n" + "-\t\t\tkvm_mips_handle_kseg0_tlb_fault(va, vcpu);\n" + "+\t\tif (kvm_mips_host_tlb_lookup(vcpu, va) < 0 &&\n" + "+\t\t kvm_mips_handle_kseg0_tlb_fault(va, vcpu)) {\n" + "+\t\t\tkvm_err(\"%s: handling mapped kseg0 tlb fault for %lx, vcpu: %p, ASID: %#lx\\n\",\n" + "+\t\t\t\t__func__, va, vcpu, read_c0_entryhi());\n" + "+\t\t\ter = EMULATE_FAIL;\n" + "+\t\t\tpreempt_enable();\n" + "+\t\t\tgoto done;\n" + "+\t\t}\n" + " \t} else if ((KVM_GUEST_KSEGX(va) < KVM_GUEST_KSEG0) ||\n" + " \t\t KVM_GUEST_KSEGX(va) == KVM_GUEST_KSEG23) {\n" + " \t\tint index;\n" + "@@ -1665,14 +1671,19 @@ enum emulation_result kvm_mips_emulate_c\n" + " \t\t\t\t\t\t\t\trun, vcpu);\n" + " \t\t\t\tpreempt_enable();\n" + " \t\t\t\tgoto dont_update_pc;\n" + "-\t\t\t} else {\n" + "-\t\t\t\t/*\n" + "-\t\t\t\t * We fault an entry from the guest tlb to the\n" + "-\t\t\t\t * shadow host TLB\n" + "-\t\t\t\t */\n" + "-\t\t\t\tkvm_mips_handle_mapped_seg_tlb_fault(vcpu, tlb,\n" + "-\t\t\t\t\t\t\t\t NULL,\n" + "-\t\t\t\t\t\t\t\t NULL);\n" + "+\t\t\t}\n" + "+\t\t\t/*\n" + "+\t\t\t * We fault an entry from the guest tlb to the\n" + "+\t\t\t * shadow host TLB\n" + "+\t\t\t */\n" + "+\t\t\tif (kvm_mips_handle_mapped_seg_tlb_fault(vcpu, tlb,\n" + "+\t\t\t\t\t\t\t\t NULL, NULL)) {\n" + "+\t\t\t\tkvm_err(\"%s: handling mapped seg tlb fault for %lx, index: %u, vcpu: %p, ASID: %#lx\\n\",\n" + "+\t\t\t\t\t__func__, va, index, vcpu,\n" + "+\t\t\t\t\tread_c0_entryhi());\n" + "+\t\t\t\ter = EMULATE_FAIL;\n" + "+\t\t\t\tpreempt_enable();\n" + "+\t\t\t\tgoto done;\n" + " \t\t\t}\n" + " \t\t}\n" + " \t} else {\n" + "@@ -2633,8 +2644,13 @@ enum emulation_result kvm_mips_handle_tl\n" + " \t\t\t * OK we have a Guest TLB entry, now inject it into the\n" + " \t\t\t * shadow host TLB\n" + " \t\t\t */\n" + "-\t\t\tkvm_mips_handle_mapped_seg_tlb_fault(vcpu, tlb, NULL,\n" + "-\t\t\t\t\t\t\t NULL);\n" + "+\t\t\tif (kvm_mips_handle_mapped_seg_tlb_fault(vcpu, tlb,\n" + "+\t\t\t\t\t\t\t\t NULL, NULL)) {\n" + "+\t\t\t\tkvm_err(\"%s: handling mapped seg tlb fault for %lx, index: %u, vcpu: %p, ASID: %#lx\\n\",\n" + "+\t\t\t\t\t__func__, va, index, vcpu,\n" + "+\t\t\t\t\tread_c0_entryhi());\n" + "+\t\t\t\ter = EMULATE_FAIL;\n" + "+\t\t\t}\n" + " \t\t}\n" + " \t}\n" + " \n" + "--- a/arch/mips/kvm/tlb.c\n" + "+++ b/arch/mips/kvm/tlb.c\n" + "@@ -808,10 +808,16 @@ uint32_t kvm_get_inst(uint32_t *opc, str\n" + " \t\t\t\tlocal_irq_restore(flags);\n" + " \t\t\t\treturn KVM_INVALID_INST;\n" + " \t\t\t}\n" + "-\t\t\tkvm_mips_handle_mapped_seg_tlb_fault(vcpu,\n" + "-\t\t\t\t\t\t\t &vcpu->arch.\n" + "-\t\t\t\t\t\t\t guest_tlb[index],\n" + "-\t\t\t\t\t\t\t NULL, NULL);\n" + "+\t\t\tif (kvm_mips_handle_mapped_seg_tlb_fault(vcpu,\n" + "+\t\t\t\t\t\t&vcpu->arch.guest_tlb[index],\n" + "+\t\t\t\t\t\tNULL, NULL)) {\n" + "+\t\t\t\tkvm_err(\"%s: handling mapped seg tlb fault failed for %p, index: %u, vcpu: %p, ASID: %#lx\\n\",\n" + "+\t\t\t\t\t__func__, opc, index, vcpu,\n" + "+\t\t\t\t\tread_c0_entryhi());\n" + "+\t\t\t\tkvm_mips_dump_guest_tlbs(vcpu);\n" + "+\t\t\t\tlocal_irq_restore(flags);\n" + "+\t\t\t\treturn KVM_INVALID_INST;\n" + "+\t\t\t}\n" + " \t\t\tinst = *(opc);\n" + " \t\t}\n" + " \t\tlocal_irq_restore(flags);\n" + "\n" + "\n" + "Patches currently in stable-queue which might be from james.hogan@imgtec.com are\n" + "\n" + "queue-4.4/mips-kvm-add-missing-gfn-range-check.patch\n" + "queue-4.4/mips-kvm-propagate-kseg0-mapped-tlb-fault-errors.patch\n" + "queue-4.4/mips-kvm-fix-mapped-fault-broken-commpage-handling.patch\n" + queue-4.4/mips-kvm-fix-gfn-range-check-in-kseg0-tlb-faults.patch -ca7d3f8db6f0509babc9922d4d89459abb18bdf91051e04296e7a44fbd3b7464 +3b84fae7210692b603525e9685906384df7a7b6afa55f9d3f2ea5165262d68ff
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.