From patchwork Fri Aug 24 00:56:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fenghua Yu X-Patchwork-Id: 1369301 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4D1E4E012B for ; Fri, 24 Aug 2012 01:12:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755393Ab2HXBMV (ORCPT ); Thu, 23 Aug 2012 21:12:21 -0400 Received: from mga03.intel.com ([143.182.124.21]:10983 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754489Ab2HXBLV (ORCPT ); Thu, 23 Aug 2012 21:11:21 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 23 Aug 2012 18:11:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,301,1344236400"; d="scan'208";a="184254193" Received: from fenghua-desk.sc.intel.com ([10.3.52.163]) by azsmga001.ch.intel.com with ESMTP; 23 Aug 2012 18:11:02 -0700 From: "Fenghua Yu" To: "Ingo Molnar" , "Thomas Gleixner" , "H Peter Anvin" , "Linus Torvalds" , "Andrew Morton" , "Asit K Mallick" , "Tony Luck" , "Arjan Dan De Ven" , "Suresh B Siddha" , "Len Brown" , "Srivatssa S. Bhat" , "Randy Dunlap" , "Chen Gong" , "linux-kernel" , "linux-pm" , "x86" Cc: "Fenghua Yu" Subject: [PATCH v7 11/12] x86/i387.c: Thread xstate is initialized only on CPU0 once Date: Thu, 23 Aug 2012 17:56:10 -0700 Message-Id: <1345769771-27019-12-git-send-email-fenghua.yu@intel.com> X-Mailer: git-send-email 1.7.2 In-Reply-To: <1345769771-27019-1-git-send-email-fenghua.yu@intel.com> References: <1345769771-27019-1-git-send-email-fenghua.yu@intel.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Fenghua Yu init_thread_xstate() is only called once to avoid overriding xstate_size during boot time or during CPU hotplug. Signed-off-by: Fenghua Yu --- arch/x86/kernel/i387.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c index f250431..e4c3a21 100644 --- a/arch/x86/kernel/i387.c +++ b/arch/x86/kernel/i387.c @@ -188,7 +188,11 @@ void __cpuinit fpu_init(void) cr0 |= X86_CR0_EM; write_cr0(cr0); - if (!smp_processor_id()) + /* + * init_thread_xstate is only called once to avoid overriding + * xstate_size during boot time or during CPU hotplug. + */ + if (xstate_size == 0) init_thread_xstate(); mxcsr_feature_mask_init();