Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jun 2012 22:46:51 +0000
From:      syuu@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r238295 - soc2012/syuu/bhyve-bios/sys/amd64/vmm/intel
Message-ID:  <20120625224651.52E6A1065670@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: syuu
Date: Mon Jun 25 22:46:50 2012
New Revision: 238295
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=238295

Log:
  if in unrestricted guest mode, unset EFER/LMA flag on entry_ctls

Modified:
  soc2012/syuu/bhyve-bios/sys/amd64/vmm/intel/vmx.c

Modified: soc2012/syuu/bhyve-bios/sys/amd64/vmm/intel/vmx.c
==============================================================================
--- soc2012/syuu/bhyve-bios/sys/amd64/vmm/intel/vmx.c	Mon Jun 25 22:22:12 2012	(r238294)
+++ soc2012/syuu/bhyve-bios/sys/amd64/vmm/intel/vmx.c	Mon Jun 25 22:46:50 2012	(r238295)
@@ -1189,6 +1189,9 @@
 		vmexit->exitcode = VM_EXITCODE_PAGING;
 		vmexit->u.paging.cr3 = vmcs_guest_cr3();
 		break;
+	case EXIT_REASON_VMCALL:
+		vmexit->exitcode = VM_EXITCODE_VMCALL;
+		break;
 	default:
 		break;
 	}
@@ -1652,10 +1655,22 @@
 		break;
 	case VM_CAP_UNRESTRICTED_GUEST:
 		if (cap_unrestricted_guest) {
+			uint64_t ctls;
+
 			retval = 0;
 			baseval = procbased_ctls2;
 			flag = PROCBASED2_UNRESTRICTED_GUEST;
 			reg = VMCS_SEC_PROC_BASED_CTLS;
+			error = vmcs_getreg(vmcs,
+				    VMCS_IDENT(VMCS_ENTRY_CTLS), &ctls);
+			if (error == 0) {
+				ctls &= ~(VM_ENTRY_LOAD_EFER | VM_ENTRY_GUEST_LMA);
+				vmcs_setreg(vmcs,
+				    	VMCS_IDENT(VMCS_ENTRY_CTLS), ctls);
+			}else{
+				printf("%s vmcs_getreg returns %d\n",
+					__func__, error);
+			}
 		}
 		break;
 	default:



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