From owner-svn-src-projects@FreeBSD.ORG Fri Jan 4 02:49:12 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E308E576; Fri, 4 Jan 2013 02:49:12 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF7D4397; Fri, 4 Jan 2013 02:49:12 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r042nClL036614; Fri, 4 Jan 2013 02:49:12 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r042nCG8036610; Fri, 4 Jan 2013 02:49:12 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201301040249.r042nCG8036610@svn.freebsd.org> From: Neel Natu Date: Fri, 4 Jan 2013 02:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r245021 - in projects/bhyve/sys/amd64: include vmm X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 02:49:13 -0000 Author: neel Date: Fri Jan 4 02:49:12 2013 New Revision: 245021 URL: http://svnweb.freebsd.org/changeset/base/245021 Log: There is no need for 'start_emulating()' and 'stop_emulating()' to be defined in so remove them from there. Obtained from: NetApp Modified: projects/bhyve/sys/amd64/include/cpufunc.h projects/bhyve/sys/amd64/vmm/vmm.c Modified: projects/bhyve/sys/amd64/include/cpufunc.h ============================================================================== --- projects/bhyve/sys/amd64/include/cpufunc.h Fri Jan 4 02:04:41 2013 (r245020) +++ projects/bhyve/sys/amd64/include/cpufunc.h Fri Jan 4 02:49:12 2013 (r245021) @@ -705,23 +705,6 @@ intr_disable(void) return (rflags); } -#ifndef CR0_TS -/* Defined in */ -#define CR0_TS 0x00000008 -#endif -static __inline void -start_emulating(void) -{ - __asm __volatile("smsw %%ax; orb %0,%%al; lmsw %%ax" - : : "n" (CR0_TS) : "ax"); -} - -static __inline void -stop_emulating(void) -{ - __asm __volatile("clts"); -} - static __inline void intr_restore(register_t rflags) { Modified: projects/bhyve/sys/amd64/vmm/vmm.c ============================================================================== --- projects/bhyve/sys/amd64/vmm/vmm.c Fri Jan 4 02:04:41 2013 (r245020) +++ projects/bhyve/sys/amd64/vmm/vmm.c Fri Jan 4 02:49:12 2013 (r245021) @@ -145,8 +145,8 @@ static struct vmm_ops *ops; #define VMSETCAP(vmi, vcpu, num, val) \ (ops != NULL ? (*ops->vmsetcap)(vmi, vcpu, num, val) : ENXIO) -#define fpu_start_emulating() start_emulating() -#define fpu_stop_emulating() stop_emulating() +#define fpu_start_emulating() load_cr0(rcr0() | CR0_TS) +#define fpu_stop_emulating() clts() static MALLOC_DEFINE(M_VM, "vm", "vm"); CTASSERT(VMM_MSR_NUM <= 64); /* msr_mask can keep track of up to 64 msrs */