Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Oct 2013 23:46:38 +0000 (UTC)
From:      Neel Natu <neel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r256867 - projects/bhyve_svm/sys/amd64/vmm/amd
Message-ID:  <201310212346.r9LNkcL7042125@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: neel
Date: Mon Oct 21 23:46:37 2013
New Revision: 256867
URL: http://svnweb.freebsd.org/changeset/base/256867

Log:
  The ASID allocation in SVM is incorrect because it allocates a single ASID for
  all vcpus belonging to a guest. This means that when different vcpus belonging
  to the same guest are executing on the same host cpu there may be "leakage"
  in the mappings created by one vcpu to another.
  
  The proper fix for this is being worked on and will be committed shortly.
  
  In the meantime workaround this bug by flushing the guest TLB entries on every
  VM entry.
  
  Submitted by:	Anish Gupta (akgupt3@gmail.com)

Modified:
  projects/bhyve_svm/sys/amd64/vmm/amd/svm.c

Modified: projects/bhyve_svm/sys/amd64/vmm/amd/svm.c
==============================================================================
--- projects/bhyve_svm/sys/amd64/vmm/amd/svm.c	Mon Oct 21 22:55:56 2013	(r256866)
+++ projects/bhyve_svm/sys/amd64/vmm/amd/svm.c	Mon Oct 21 23:46:37 2013	(r256867)
@@ -955,8 +955,13 @@ svm_vmrun(void *arg, int vcpu, register_
 		/* Can't use any cached VMCB state by cpu.*/
 		ctrl->vmcb_clean = VMCB_CACHE_NONE;
 	} else {
-		/* Don't flush TLB since guest ASID is unchanged. */
-		ctrl->tlb_ctrl = VMCB_TLB_FLUSH_NOTHING;
+		/*
+		 * XXX: Using same ASID for all vcpus of a VM will cause TLB
+		 * corruption. This can easily be produced by muxing two vcpus
+		 * on same core.
+		 * For now, flush guest TLB for every vmrun.
+		 */
+		ctrl->tlb_ctrl = VMCB_TLB_FLUSH_GUEST;
 		
 		/* 
 		 * This is the same cpu on which vcpu last ran so don't



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310212346.r9LNkcL7042125>