Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4431318ybx; Mon, 4 Nov 2019 13:16:20 -0800 (PST) X-Google-Smtp-Source: APXvYqz2Of+k9LRBMBsd/zuOgc2ElvIrYyaDV2XrU2N58g1Jsd32Xh/WKUsBnZgpgJTMK633aFEs X-Received: by 2002:a17:906:f90c:: with SMTP id lc12mr26422717ejb.208.1572902180040; Mon, 04 Nov 2019 13:16:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572902180; cv=none; d=google.com; s=arc-20160816; b=JvGK9VMdq1yVAYJdhRaldiGu6FEOm4CoCBFMNuU45aoo6+bC4Kou5EoLTGflcykD25 UhleT57RTuB/FWWrJV+nt4m5q9lpUcUyUjhQ/HB7aPYQDuM1FAxncymxS7r22cepSSyG kSQCAFJZODcD4vak9NOFFI9LUJjVyHi4A1ktIg9gFhrsFNLUQMuMrHnw+vilwvalpOA8 KCX5T/uCPKTmAQOoyjGoekGVJYtuab8xUvbe3UeooML+E7fFe2DqTJGgojUCdzGdJ2A6 8m+Qe8ErrCFQmcHsDVgmJJ0qO2as5nhi37TGk1bpegciFdoKqM0BmVBsGLq6kY6A1eLY 9ZVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=ezXrJk1I8Sa5u++DFrUzxxCWUDPLDMIoDB8Cf90YCOg=; b=y9jJmQG99p3T8pl5nwHrhbBMj5oZQnnbAiBXOjzR0w+jyQmVGEQgCsQlb9Ki8DbQUx ZMh1ALNmaU/XnQAzJjlDlIbTCcIAj3LUI26lLhX/8vCAG6DTVEviQ6OuHKr4rfIqCDU6 3Bu8a5hRsB3ujegd3thuUDfCZUkdVzjuCCIRmOghDgjE7B5NmhbDibeMDPn3G8a6fHWn zX1LTcOdb9yvfX26gdRTmpJtMCLdSPCMeRWbb9KlxHujpSBfsTGv1waxbBmVUJFb/SKA 1mrazc/AYf+R85VP6VXtQOLpHRkHsY4smLeYwbdKV2d+Lh0Rix1fgSSRVayAdizrHLeZ iLWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si9841804edc.221.2019.11.04.13.15.56; Mon, 04 Nov 2019 13:16:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729594AbfKDVOl (ORCPT + 99 others); Mon, 4 Nov 2019 16:14:41 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:38912 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728377AbfKDVOf (ORCPT ); Mon, 4 Nov 2019 16:14:35 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iRjgF-0005ZM-Tw; Mon, 04 Nov 2019 22:14:32 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 692A21C0017; Mon, 4 Nov 2019 22:14:31 +0100 (CET) Date: Mon, 04 Nov 2019 21:14:31 -0000 From: "tip-bot2 for Cyrill Gorcunov" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/fpu] x86/fpu: Use XFEATURE_FP/SSE enum values instead of hardcoded numbers Cc: Cyrill Gorcunov , Thomas Gleixner , Ingo Molnar , Borislav Petkov , linux-kernel@vger.kernel.org In-Reply-To: <20191101130153.GG1615@uranus.lan> References: <20191101130153.GG1615@uranus.lan> MIME-Version: 1.0 Message-ID: <157290207104.29376.2447130677768331870.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/fpu branch of tip: Commit-ID: 446e693ca30b7c7c2aaeaf09e90ec224c7538fec Gitweb: https://git.kernel.org/tip/446e693ca30b7c7c2aaeaf09e90ec224c7538fec Author: Cyrill Gorcunov AuthorDate: Fri, 01 Nov 2019 16:01:53 +03:00 Committer: Thomas Gleixner CommitterDate: Mon, 04 Nov 2019 22:10:07 +01:00 x86/fpu: Use XFEATURE_FP/SSE enum values instead of hardcoded numbers When setting up sizes and offsets for legacy header entries the code uses hardcoded 0/1 instead of the corresponding enum values XFEATURE_FP and XFEATURE_SSE. Replace the hardcoded numbers which enhances readability of the code and also makes this code the first user of those enum values.. Signed-off-by: Cyrill Gorcunov Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20191101130153.GG1615@uranus.lan --- arch/x86/kernel/fpu/xstate.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c index a8bd5c0..319be93 100644 --- a/arch/x86/kernel/fpu/xstate.c +++ b/arch/x86/kernel/fpu/xstate.c @@ -254,10 +254,13 @@ static void __init setup_xstate_features(void) * in the fixed offsets in the xsave area in either compacted form * or standard form. */ - xstate_offsets[0] = 0; - xstate_sizes[0] = offsetof(struct fxregs_state, xmm_space); - xstate_offsets[1] = xstate_sizes[0]; - xstate_sizes[1] = FIELD_SIZEOF(struct fxregs_state, xmm_space); + xstate_offsets[XFEATURE_FP] = 0; + xstate_sizes[XFEATURE_FP] = offsetof(struct fxregs_state, + xmm_space); + + xstate_offsets[XFEATURE_SSE] = xstate_sizes[XFEATURE_FP]; + xstate_sizes[XFEATURE_SSE] = FIELD_SIZEOF(struct fxregs_state, + xmm_space); for (i = FIRST_EXTENDED_XFEATURE; i < XFEATURE_MAX; i++) { if (!xfeature_enabled(i)) @@ -350,8 +353,9 @@ static void __init setup_xstate_comp(void) * in the fixed offsets in the xsave area in either compacted form * or standard form. */ - xstate_comp_offsets[0] = 0; - xstate_comp_offsets[1] = offsetof(struct fxregs_state, xmm_space); + xstate_comp_offsets[XFEATURE_FP] = 0; + xstate_comp_offsets[XFEATURE_SSE] = offsetof(struct fxregs_state, + xmm_space); if (!boot_cpu_has(X86_FEATURE_XSAVES)) { for (i = FIRST_EXTENDED_XFEATURE; i < XFEATURE_MAX; i++) {