From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0438EC282DD for ; Thu, 9 Jan 2020 21:17:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CDE752073A for ; Thu, 9 Jan 2020 21:17:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728247AbgAIVRA (ORCPT ); Thu, 9 Jan 2020 16:17:00 -0500 Received: from mga09.intel.com ([134.134.136.24]:44432 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725763AbgAIVQ7 (ORCPT ); Thu, 9 Jan 2020 16:16:59 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2020 13:16:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,414,1571727600"; d="scan'208";a="212025747" Received: from yyu32-desk.sc.intel.com ([143.183.136.51]) by orsmga007.jf.intel.com with ESMTP; 09 Jan 2020 13:16:58 -0800 From: Yu-cheng Yu To: linux-kernel@vger.kernel.org, x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Dave Hansen , Tony Luck , Andy Lutomirski , Borislav Petkov , Rik van Riel , "Ravi V. Shankar" , Sebastian Andrzej Siewior , Fenghua Yu , Peter Zijlstra Cc: Yu-cheng Yu Subject: [PATCH 0/3] Fix two issues in XSAVES offset calculation Date: Thu, 9 Jan 2020 13:14:49 -0800 Message-Id: <20200109211452.27369-1-yu-cheng.yu@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series fixes two issues in XSAVES offset calculation: - In setup_xstate_features(), supervisor xstate offsets are left as -1's, but still being tracked as last_good_offset; - In setup_xstate_comp(), alignments are being added to disabled xstate offsets. These issues have not been visible because supervisor xstates have not been enabled and there is no xfeature requiring alignment. They are triggered only when adding an aligned non-supervisor xstate after CET [1] supervisor states. To detect future potential issues, also add a patch to issue warnings when checking alignments of disabled xfeatures. Details are in each patch's commit log. [1] CET patches: https://lkml.kernel.org/r/20190813205225.12032-1-yu-cheng.yu@intel.com/ https://lkml.kernel.org/r/20190813205359.12196-1-yu-cheng.yu@intel.com/ Yu-cheng Yu (3): x86/fpu/xstate: Fix last_good_offset in setup_xstate_features() x86/fpu/xstate: Fix XSAVES offsets in setup_xstate_comp() x86/fpu/xstate: WARN_ONCE on checking alignment of disabled xfeatures arch/x86/kernel/fpu/xstate.c | 61 +++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 29 deletions(-) -- 2.21.0