From patchwork Thu Oct 14 23:09:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 12559589 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59B2BC433FE for ; Thu, 14 Oct 2021 23:09:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 431F7610F8 for ; Thu, 14 Oct 2021 23:09:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234400AbhJNXLs (ORCPT ); Thu, 14 Oct 2021 19:11:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234338AbhJNXLi (ORCPT ); Thu, 14 Oct 2021 19:11:38 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50A7DC061753; Thu, 14 Oct 2021 16:09:33 -0700 (PDT) Message-ID: <20211014230739.184014242@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1634252971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=3waKzyY1T7PuMxjCNrXEk0Bp26hUU6HXuRX+FyaOY24=; b=Qn1Pkzn87g4uwvEYpSI7nYS57SA4ObeHiCQZ5y0kMmkvM1C2ApRv6/cnfB+owMlLVDdbU3 sY9BiZ1KyIrNbdRapRfyistRccNgREG8jcqs2PuHWAg2w/GYlpw6z66a+aUUNosYCBM/Ll roXHhaUVbvXDeMMzpvTqGCFVpbC9806ErwFFKCnbnETVia5d+LKwoE0+7e9fmjfgEaMmzy xXmrRV2oZVPRZwpipRDHp2eeIp/J4eTdyQ5JOTytEDr/Kh46DZx/DaKWq3QJWnHroEAUjo zDwWRdBtbd5hv60ml4Vgq/xEAgjEPkxDrVLld1zIxG3MdF//LIWvuC4bsA1F9A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1634252971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=3waKzyY1T7PuMxjCNrXEk0Bp26hUU6HXuRX+FyaOY24=; b=NoV8jzCW56WvEkPIoOlHQ1aOs4l8psUBuTtBL3Xt6hVJJIQB0SmOEEfbwtfKAfU35G2VL3 oj0eGj8p8aLE97BQ== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, "Chang S. Bae" , Dave Hansen , Arjan van de Ven , kvm@vger.kernel.org, Paolo Bonzini Subject: [patch 2/8] x86/fpu: Cleanup fpu__init_system_xstate_size_legacy() References: <20211014225711.615197738@linutronix.de> MIME-Version: 1.0 Date: Fri, 15 Oct 2021 01:09:31 +0200 (CEST) Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Clean the function up before making changes. No functional change. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/fpu/init.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) --- a/arch/x86/kernel/fpu/init.c +++ b/arch/x86/kernel/fpu/init.c @@ -199,17 +199,12 @@ static void __init fpu__init_system_xsta * Note that xstate sizes might be overwritten later during * fpu__init_system_xstate(). */ - - if (!boot_cpu_has(X86_FEATURE_FPU)) { + if (!cpu_feature_enabled(X86_FEATURE_FPU)) fpu_kernel_xstate_size = sizeof(struct swregs_state); - } else { - if (boot_cpu_has(X86_FEATURE_FXSR)) - fpu_kernel_xstate_size = - sizeof(struct fxregs_state); - else - fpu_kernel_xstate_size = - sizeof(struct fregs_state); - } + else if (cpu_feature_enabled(X86_FEATURE_FXSR)) + fpu_kernel_xstate_size = sizeof(struct fxregs_state); + else + fpu_kernel_xstate_size = sizeof(struct fregs_state); fpu_user_xstate_size = fpu_kernel_xstate_size; fpstate_reset(¤t->thread.fpu);