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 7BDEDC43603 for ; Thu, 5 Dec 2019 18:41:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 521002464D for ; Thu, 5 Dec 2019 18:41:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729915AbfLESlK (ORCPT ); Thu, 5 Dec 2019 13:41:10 -0500 Received: from mga17.intel.com ([192.55.52.151]:4158 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729290AbfLESlJ (ORCPT ); Thu, 5 Dec 2019 13:41:09 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Dec 2019 10:41:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,282,1571727600"; d="scan'208";a="214263511" Received: from yyu32-desk1.sc.intel.com ([10.144.153.205]) by orsmga003.jf.intel.com with ESMTP; 05 Dec 2019 10:41:07 -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 small issues in XSAVES Date: Thu, 5 Dec 2019 10:26:45 -0800 Message-Id: <20191205182648.32257-1-yu-cheng.yu@intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The first two patches in this series are split from my supervisor xstate patches [1]. The third is to fix a vital issue in __fpu_restore_sig(), and more RFC than the others. All three are not directly related to supervisor xstates or CET, split them out and submit first. I will re-submit supervisor xstate patches shortly. When__fpu_restore_sig() fails, partially cleared FPU registers still belong to the previous owner task. That causes that task to use corrupted xregs. Fix it by doing __cpu_invalidate_fpregs_state() in functions that copy into fpregs. Further details are in the commit log of patch #3. [1] Support XSAVES supervisor states https://lkml.kernel.org/r/20190925151022.21688-1-yu-cheng.yu@intel.com/ [2] 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 small issues before adding supervisor xstates x86/fpu/xstate: Make xfeature_is_supervisor()/xfeature_is_user() return bool x86/fpu/xstate: Invalidate fpregs when __fpu_restore_sig() fails arch/x86/include/asm/fpu/internal.h | 14 ++++++++++++++ arch/x86/kernel/fpu/core.c | 15 +++++++++++++-- arch/x86/kernel/fpu/xstate.c | 22 ++++++++++------------ 3 files changed, 37 insertions(+), 14 deletions(-) -- 2.17.1