All of lore.kernel.org
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: gregkh@linuxfoundation.org, james.hogan@imgtec.com,
	pbonzini@redhat.com, ralf@linux-mips.org, rkrcmar@redhat.com
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "Revert KVM: MIPS: Drop other CPU ASIDs on guest MMU changes" has been added to the 4.4-stable tree
Date: Sun, 13 Nov 2016 12:22:18 +0100	[thread overview]
Message-ID: <1479036138186249@kroah.com> (raw)


This is a note to let you know that I've just added the patch titled

    Revert KVM: MIPS: Drop other CPU ASIDs on guest MMU changes

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     revert-kvm-mips-drop-other-cpu-asids-on-guest-mmu-changes.patch
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 foo@baz Sun Nov 13 12:16:15 CET 2016
Date: Sun, 13 Nov 2016 12:16:15 +0100
To: Greg KH <gregkh@linuxfoundation.org>
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Revert KVM: MIPS: Drop other CPU ASIDs on guest MMU changes

This reverts commit d450527ad04ad180636679aeb3161ec58079f1ba which was
commit 91e4f1b6073dd680d86cdb7e42d7cccca9db39d8 upstream as it was
incorrect.  A fixed version will be forthcoming.

Reported-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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/mips/kvm/emulate.c |   63 +++++++-----------------------------------------
 1 file changed, 10 insertions(+), 53 deletions(-)

--- a/arch/mips/kvm/emulate.c
+++ b/arch/mips/kvm/emulate.c
@@ -807,47 +807,6 @@ enum emulation_result kvm_mips_emul_tlbr
 	return EMULATE_FAIL;
 }
 
-/**
- * kvm_mips_invalidate_guest_tlb() - Indicates a change in guest MMU map.
- * @vcpu:	VCPU with changed mappings.
- * @tlb:	TLB entry being removed.
- *
- * This is called to indicate a single change in guest MMU mappings, so that we
- * can arrange TLB flushes on this and other CPUs.
- */
-static void kvm_mips_invalidate_guest_tlb(struct kvm_vcpu *vcpu,
-					  struct kvm_mips_tlb *tlb)
-{
-	int cpu, i;
-	bool user;
-
-	/* No need to flush for entries which are already invalid */
-	if (!((tlb->tlb_lo[0] | tlb->tlb_lo[1]) & ENTRYLO_V))
-		return;
-	/* User address space doesn't need flushing for KSeg2/3 changes */
-	user = tlb->tlb_hi < KVM_GUEST_KSEG0;
-
-	preempt_disable();
-
-	/*
-	 * Probe the shadow host TLB for the entry being overwritten, if one
-	 * matches, invalidate it
-	 */
-	kvm_mips_host_tlb_inv(vcpu, tlb->tlb_hi);
-
-	/* Invalidate the whole ASID on other CPUs */
-	cpu = smp_processor_id();
-	for_each_possible_cpu(i) {
-		if (i == cpu)
-			continue;
-		if (user)
-			vcpu->arch.guest_user_asid[i] = 0;
-		vcpu->arch.guest_kernel_asid[i] = 0;
-	}
-
-	preempt_enable();
-}
-
 /* Write Guest TLB Entry @ Index */
 enum emulation_result kvm_mips_emul_tlbwi(struct kvm_vcpu *vcpu)
 {
@@ -867,8 +826,11 @@ enum emulation_result kvm_mips_emul_tlbw
 	}
 
 	tlb = &vcpu->arch.guest_tlb[index];
-
-	kvm_mips_invalidate_guest_tlb(vcpu, tlb);
+	/*
+	 * Probe the shadow host TLB for the entry being overwritten, if one
+	 * matches, invalidate it
+	 */
+	kvm_mips_host_tlb_inv(vcpu, tlb->tlb_hi);
 
 	tlb->tlb_mask = kvm_read_c0_guest_pagemask(cop0);
 	tlb->tlb_hi = kvm_read_c0_guest_entryhi(cop0);
@@ -897,7 +859,11 @@ enum emulation_result kvm_mips_emul_tlbw
 
 	tlb = &vcpu->arch.guest_tlb[index];
 
-	kvm_mips_invalidate_guest_tlb(vcpu, tlb);
+	/*
+	 * Probe the shadow host TLB for the entry being overwritten, if one
+	 * matches, invalidate it
+	 */
+	kvm_mips_host_tlb_inv(vcpu, tlb->tlb_hi);
 
 	tlb->tlb_mask = kvm_read_c0_guest_pagemask(cop0);
 	tlb->tlb_hi = kvm_read_c0_guest_entryhi(cop0);
@@ -1016,7 +982,6 @@ enum emulation_result kvm_mips_emulate_C
 	int32_t rt, rd, copz, sel, co_bit, op;
 	uint32_t pc = vcpu->arch.pc;
 	unsigned long curr_pc;
-	int cpu, i;
 
 	/*
 	 * Update PC and hold onto current PC in case there is
@@ -1124,16 +1089,8 @@ enum emulation_result kvm_mips_emulate_C
 						vcpu->arch.gprs[rt]
 						& ASID_MASK);
 
-					preempt_disable();
 					/* Blow away the shadow host TLBs */
 					kvm_mips_flush_host_tlb(1);
-					cpu = smp_processor_id();
-					for_each_possible_cpu(i)
-						if (i != cpu) {
-							vcpu->arch.guest_user_asid[i] = 0;
-							vcpu->arch.guest_kernel_asid[i] = 0;
-						}
-					preempt_enable();
 				}
 				kvm_write_c0_guest_entryhi(cop0,
 							   vcpu->arch.gprs[rt]);


Patches currently in stable-queue which might be from gregkh@linuxfoundation.org are

queue-4.4/drm-amdgpu-fix-dp-mode-validation.patch
queue-4.4/ipmr-ip6mr-fix-scheduling-while-atomic-and-a-deadlock-with-ipmr_get_route.patch
queue-4.4/of-silence-warnings-due-to-max-usage.patch
queue-4.4/ip6_gre-fix-flowi6_proto-value-in-ip6gre_xmit_other.patch
queue-4.4/drm-radeon-fix-dp-mode-validation.patch
queue-4.4/rtnetlink-add-rtnexthop-offload-flag-to-compare-mask.patch
queue-4.4/net-sctp-forbid-negative-length.patch
queue-4.4/ip6_tunnel-fix-ip6_tnl_lookup.patch
queue-4.4/net-sched-act_vlan-push-skb-data-to-mac_header-prior-calling-skb_vlan_-functions.patch
queue-4.4/packet-call-fanout_release-while-unregistering-a-netdev.patch
queue-4.4/tg3-avoid-null-pointer-dereference-in-tg3_io_error_detected.patch
queue-4.4/kvm-mips-drop-other-cpu-asids-on-guest-mmu-changes.patch
queue-4.4/net-add-recursion-limit-to-gro.patch
queue-4.4/bridge-multicast-restore-perm-router-ports-on-multicast-enable.patch
queue-4.4/tcp-fix-wrong-checksum-calculation-on-mtu-probing.patch
queue-4.4/revert-kvm-mips-drop-other-cpu-asids-on-guest-mmu-changes.patch
queue-4.4/net-sched-filters-fix-notification-of-filter-delete-with-proper-handle.patch
queue-4.4/ipv4-use-the-right-lock-for-ping_group_range.patch
queue-4.4/ipv4-disable-bh-in-set_ping_group_range.patch
queue-4.4/drm-amdgpu-dp-add-back-special-handling-for-nutmeg.patch
queue-4.4/tcp-fix-a-compile-error-in-dbgundo.patch
queue-4.4/net-avoid-sk_forward_alloc-overflows.patch
queue-4.4/udp-fix-ip_checksum-handling.patch
queue-4.4/net-add-netdev-all_adj_list-refcnt-propagation-to-fix-panic.patch
queue-4.4/netlink-do-not-enter-direct-reclaim-from-netlink_dump.patch
queue-4.4/net-fec-set-mac-address-unconditionally.patch
queue-4.4/ipv6-tcp-restore-ip6cb-for-pktoptions-skbs.patch
queue-4.4/tcp-fix-overflow-in-__tcp_retransmit_skb.patch
queue-4.4/ipv6-correctly-add-local-routes-when-lo-goes-up.patch
queue-4.4/packet-on-direct_xmit-limit-tso-and-csum-to-supported-devices.patch
queue-4.4/sctp-validate-chunk-len-before-actually-using-it.patch
queue-4.4/net-pktgen-remove-rcu-locking-in-pktgen_change_name.patch
queue-4.4/drm-radeon-dp-add-back-special-handling-for-nutmeg.patch
queue-4.4/net-pktgen-fix-pkt_size.patch

                 reply	other threads:[~2016-11-13 11:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479036138186249@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=james.hogan@imgtec.com \
    --cc=pbonzini@redhat.com \
    --cc=ralf@linux-mips.org \
    --cc=rkrcmar@redhat.com \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.