diff for duplicates of <147151362112175@kroah.com> diff --git a/a/content_digest b/N1/content_digest index d9b9672..90a8a02 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. -034066eeb205bc4ece9fbc93abd4683681fb78a6adfc9edb7d493e84e4cab541 +eaee879e2ef72b5a55814cc7ac3d9edd18122c47c09a0011e07806fc07d09ccc
diff --git a/a/1.txt b/N2/1.txt index e9e27b4..b3d17e2 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -12,3 +12,126 @@ and it can be found in the queue-3.14 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:46:32 2016 +From: James Hogan <james.hogan@imgtec.com> +Date: Thu, 18 Aug 2016 10:22:55 +0100 +Subject: [PATCH BACKPORT 3.10-3.15 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: <f985ed835cfcabe5c7f313abd1de1bb3ee8737f9.1471021142.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.10.y - v3.15.y] +Signed-off-by: James Hogan <james.hogan@imgtec.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + arch/mips/kvm/kvm_mips_emul.c | 33 ++++++++++++++++++++++++--------- + arch/mips/kvm/kvm_tlb.c | 14 ++++++++++---- + 2 files changed, 34 insertions(+), 13 deletions(-) + +--- a/arch/mips/kvm/kvm_mips_emul.c ++++ b/arch/mips/kvm/kvm_mips_emul.c +@@ -972,8 +972,13 @@ kvm_mips_emulate_cache(uint32_t inst, ui + 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) { +@@ -1006,11 +1011,16 @@ kvm_mips_emulate_cache(uint32_t inst, ui + 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 { +@@ -1821,8 +1831,13 @@ kvm_mips_handle_tlbmiss(unsigned long ca + tlb->tlb_hi, tlb->tlb_lo0, tlb->tlb_lo1); + #endif + /* 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/kvm_tlb.c ++++ b/arch/mips/kvm/kvm_tlb.c +@@ -797,10 +797,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-3.14/mips-kvm-add-missing-gfn-range-check.patch +queue-3.14/mips-kvm-propagate-kseg0-mapped-tlb-fault-errors.patch +queue-3.14/mips-kvm-fix-mapped-fault-broken-commpage-handling.patch +queue-3.14/mips-kvm-fix-gfn-range-check-in-kseg0-tlb-faults.patch diff --git a/a/content_digest b/N2/content_digest index d9b9672..b66de88 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -27,6 +27,129 @@ "and it can be found in the queue-3.14 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:46:32 2016\n" + "From: James Hogan <james.hogan@imgtec.com>\n" + "Date: Thu, 18 Aug 2016 10:22:55 +0100\n" + "Subject: [PATCH BACKPORT 3.10-3.15 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: <f985ed835cfcabe5c7f313abd1de1bb3ee8737f9.1471021142.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.10.y - v3.15.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/kvm_mips_emul.c | 33 ++++++++++++++++++++++++---------\n" + " arch/mips/kvm/kvm_tlb.c | 14 ++++++++++----\n" + " 2 files changed, 34 insertions(+), 13 deletions(-)\n" + "\n" + "--- a/arch/mips/kvm/kvm_mips_emul.c\n" + "+++ b/arch/mips/kvm/kvm_mips_emul.c\n" + "@@ -972,8 +972,13 @@ kvm_mips_emulate_cache(uint32_t inst, ui\n" + " \tpreempt_disable();\n" + " \tif (KVM_GUEST_KSEGX(va) == KVM_GUEST_KSEG0) {\n" + " \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" + "@@ -1006,11 +1011,16 @@ kvm_mips_emulate_cache(uint32_t inst, ui\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/* We fault an entry from the guest tlb to the shadow host TLB */\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/* We fault an entry from the guest tlb to the shadow host TLB */\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" + "@@ -1821,8 +1831,13 @@ kvm_mips_handle_tlbmiss(unsigned long ca\n" + " \t\t\t tlb->tlb_hi, tlb->tlb_lo0, tlb->tlb_lo1);\n" + " #endif\n" + " \t\t\t/* OK we have a Guest TLB entry, now inject it into the shadow host TLB */\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/kvm_tlb.c\n" + "+++ b/arch/mips/kvm/kvm_tlb.c\n" + "@@ -797,10 +797,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-3.14/mips-kvm-add-missing-gfn-range-check.patch\n" + "queue-3.14/mips-kvm-propagate-kseg0-mapped-tlb-fault-errors.patch\n" + "queue-3.14/mips-kvm-fix-mapped-fault-broken-commpage-handling.patch\n" + queue-3.14/mips-kvm-fix-gfn-range-check-in-kseg0-tlb-faults.patch -034066eeb205bc4ece9fbc93abd4683681fb78a6adfc9edb7d493e84e4cab541 +118d1f1e3af3cf3419816742e308bfa4281468a385f7fc665c4ed9d85be5e542
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.