Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Jan 2013 02:49:12 +0000 (UTC)
From:      Neel Natu <neel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r245021 - in projects/bhyve/sys/amd64: include vmm
Message-ID:  <201301040249.r042nCG8036610@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <machine/cpufunc.h> 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 <machine/specialreg.h> */
-#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 */



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