Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9336693rwd; Wed, 21 Jun 2023 06:16:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ58lSeQj+Ba/5PgEHggZzOgbxyk9L787oV9sP81pqEEzpsWQYYnopLLK2DuvYFH6WxHzGGe X-Received: by 2002:a9d:76d4:0:b0:6b1:383f:cb83 with SMTP id p20-20020a9d76d4000000b006b1383fcb83mr6103334otl.18.1687353408336; Wed, 21 Jun 2023 06:16:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687353408; cv=none; d=google.com; s=arc-20160816; b=kTVv5HRK/ECkx+ATBdBiAnVKhPzAGPzZLOCchL48hfBg+uKuYQP1KUZwG7DKhBKKKM WjGEkwljY4awaHPa4OeUMzg7Rhg8c1WOhImk5OWklFXJzDv3ede0fzP16y2H4bNVVHY7 PqhjBz0KJyIPO+oyZj4GfPg0GPK7tn/dkKxrLvAQ+xClpnoc7O5fayE3PGOujnl+9EBb 8BXXsGdiMiR3I9AXCCtM1zJphtybQInvYjpf1mWWNIac/J3Al1gLT64DpRMIxc96Hrn0 nED26LJN9VT/ugLQoBoxux10HABy66dvkSFkJnQr/MSvUROrIQeeFqVpoQI5uuo1fXqf TiFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=C+/sbow5CvGlQnucKhZ2xA1oTgjSZa8gapGkbIHb9FM=; b=q5TBjRFjaje0uojtTi446drnQzICnuEIAQKeolPtAXR/3u8MdG8ObSMuOULKKtwh45 8GP0323CdXohp31SOzjiJcC8/N8nln8W4hz+qaiL0FfcB8jI+g9xQTymbgRb3/mijbjN 4VSJvG/XSbEQjz6Knramqo1dj3Ek/Qv4CJB8wLIUjuhTpoVixoC/NDyyEeuAnCIXUFTo p3HrByF3ZsLHU/5y+pVYiWz7d3pVn5zrQUqQTVwTYVZ2FrMmVwlzMCA8svvuvXnTKR/1 doLOTxuWVP+njJvFMQjOctIhPZyiyuiggNF0y0132V1MjzRo1xGbrGDupryjKYfq8U3F otLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EE3rqI8L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l186-20020a6391c3000000b005573ea6ead9si188410pge.306.2023.06.21.06.16.32; Wed, 21 Jun 2023 06:16:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EE3rqI8L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231531AbjFUMWm (ORCPT + 99 others); Wed, 21 Jun 2023 08:22:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230462AbjFUMWa (ORCPT ); Wed, 21 Jun 2023 08:22:30 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6EEC1718 for ; Wed, 21 Jun 2023 05:22:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687350149; x=1718886149; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PxrG7SFhXzSn4raQBGerOrXRroeYuO9/VMUGq89WOlM=; b=EE3rqI8LbKdp6TGGgcyQ9iO6LM5XIU4GfX32AzOmiJbRjcWI73me/lKJ zrrqfkfgBESP5kKsXzDr1Outx/xgQyMt6+UFwIRuE00YuVsMxaElrv0en p87fxIv4ZOHC/D77FUk/DVYsqUi5g5DtUI6nMlePruQiaJaVoYRMlOa6G 0Fj7WrhY6FFS8XCuG/5QTUpUOrwo6mUwiV7jAOdtQo5yQRAzG530BrOhP Dnarh1Fg0oATAJ2Zh5BAgUolh6wtC+CZdvVeu0tk7CSWw5S/C3v1sN3qn cJ6kj9ju3Pz9/YxT4Frm8PuQYlZjB8aJ9Ob3+ULNlNb4bVdMZzedfzRgK w==; X-IronPort-AV: E=McAfee;i="6600,9927,10747"; a="360165707" X-IronPort-AV: E=Sophos;i="6.00,260,1681196400"; d="scan'208";a="360165707" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2023 05:22:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10747"; a="888638358" X-IronPort-AV: E=Sophos;i="6.00,260,1681196400"; d="scan'208";a="888638358" Received: from chang-linux-3.sc.intel.com ([172.25.66.173]) by orsmga005.jf.intel.com with ESMTP; 21 Jun 2023 05:22:28 -0700 From: "Chang S. Bae" To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, andrew.cooper3@citrix.com, chang.seok.bae@intel.com Subject: [PATCH v1 4/4] x86/fpu: Remove the unnecessary fpstate_reset() invocation Date: Wed, 21 Jun 2023 05:09:42 -0700 Message-Id: <20230621120942.121822-5-chang.seok.bae@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230621120942.121822-1-chang.seok.bae@intel.com> References: <20230621120942.121822-1-chang.seok.bae@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fpstate_reset() initializes the fpstate container. But, when no state has been established yet, calling this is not meaningful. In the fpu__init_system() function, it is called immediately after the legacy FPU size is determined. So, remove it as not causing any issues. Signed-off-by: Chang S. Bae Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org --- The change made by fpstate_reset() can be measured with this: static struct fpstate fps; void __init fpu__init_system(struct cpuinfo_x86 *c) { memcpy(&fps, ¤t->thread.fpu.__fpstate, sizeof(struct fpstate)); fpstate_reset(¤t->thread.fpu); if (memcmp(&fps, ¤t->thread.fpu.__fpstate, sizeof(struct fpstate))) pr_info("fpstate has reason to be inited at %s\n", __func__); else pr_info("fpstate has no reason to be inited at %s\n", __func__); ... } Although it looks to be a no-op, there might be some unknown intention behind it. If there is a specific reason for invoking fpstate_reset() at that point, this should be documented properly instead of removing it. --- arch/x86/kernel/fpu/init.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c index 998a08f17e33..95af3084c4cf 100644 --- a/arch/x86/kernel/fpu/init.c +++ b/arch/x86/kernel/fpu/init.c @@ -213,7 +213,6 @@ static void __init fpu__init_system_xstate_size_legacy(void) */ void __init fpu__init_system(void) { - fpstate_reset(¤t->thread.fpu); fpu__init_system_early_generic(); /* -- 2.34.1