From patchwork Fri May 14 03:16:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 99523 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4E3JV47013314 for ; Fri, 14 May 2010 03:19:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753067Ab0ENDSV (ORCPT ); Thu, 13 May 2010 23:18:21 -0400 Received: from mga11.intel.com ([192.55.52.93]:3164 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751722Ab0ENDSU (ORCPT ); Thu, 13 May 2010 23:18:20 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 13 May 2010 20:16:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.53,226,1272870000"; d="scan'208";a="567057704" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.36.64]) by fmsmga002.fm.intel.com with ESMTP; 13 May 2010 20:17:30 -0700 Received: from yasker by syang10-desktop with local (Exim 4.71) (envelope-from ) id 1OClOW-0001Fq-Bd; Fri, 14 May 2010 11:17:00 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti Cc: Ingo Molnar , "H. Peter Anvin" , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Sheng Yang Subject: [PATCH 2/3] x86: Export FPU API for KVM use Date: Fri, 14 May 2010 11:16:52 +0800 Message-Id: <1273807013-4792-3-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1273807013-4792-1-git-send-email-sheng@linux.intel.com> References: <1273807013-4792-1-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 14 May 2010 03:19:31 +0000 (UTC) diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h index 989d3b7..f19bdf9 100644 --- a/arch/x86/include/asm/i387.h +++ b/arch/x86/include/asm/i387.h @@ -503,6 +503,8 @@ static inline void fpu_copy(struct fpu *dst, struct fpu *src) memcpy(dst->state, src->state, xstate_size); } +extern void fpu_finit(struct fpu *fpu); + #endif /* __ASSEMBLY__ */ #define PSHUFB_XMM5_XMM0 .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 diff --git a/arch/x86/include/asm/xsave.h b/arch/x86/include/asm/xsave.h index 2c4390c..29ee4e4 100644 --- a/arch/x86/include/asm/xsave.h +++ b/arch/x86/include/asm/xsave.h @@ -13,6 +13,9 @@ #define FXSAVE_SIZE 512 +#define XSTATE_YMM_SIZE 256 +#define XSTATE_YMM_OFFSET (512 + 64) + /* * These are the features that the OS can handle currently. */ diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index 86cef6b..c4444bc 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c @@ -107,7 +107,7 @@ void __cpuinit fpu_init(void) } #endif /* CONFIG_X86_64 */ -static void fpu_finit(struct fpu *fpu) +void fpu_finit(struct fpu *fpu) { #ifdef CONFIG_X86_32 if (!HAVE_HWFP) { @@ -132,6 +132,7 @@ static void fpu_finit(struct fpu *fpu) fp->fos = 0xffff0000u; } } +EXPORT_SYMBOL_GPL(fpu_finit); /* * The _current_ task is using the FPU for the first time diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 8bcc21f..373fec9 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -28,6 +28,7 @@ unsigned long idle_nomwait; EXPORT_SYMBOL(idle_nomwait); struct kmem_cache *task_xstate_cachep; +EXPORT_SYMBOL(task_xstate_cachep); int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) {