From fec8c768eb1c50ae42da476ee843414b7f87b8f5 Mon Sep 17 00:00:00 2001 From: neel Date: Fri, 4 Jan 2013 02:49:12 +0000 Subject: There is no need for 'start_emulating()' and 'stop_emulating()' to be defined in so remove them from there. Obtained from: NetApp --- sys/amd64/include/cpufunc.h | 17 ----------------- sys/amd64/vmm/vmm.c | 4 ++-- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 7243173..881fcd2 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -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) { diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index eae9ccc..a4dea79 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -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 */ -- cgit v1.1