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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 481B4C3F2D1 for ; Fri, 28 Feb 2020 12:52:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 25E5B20665 for ; Fri, 28 Feb 2020 12:52:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726614AbgB1MwA (ORCPT ); Fri, 28 Feb 2020 07:52:00 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:36639 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbgB1MwA (ORCPT ); Fri, 28 Feb 2020 07:52:00 -0500 Received: from bigeasy by Galois.linutronix.de with local (Exim 4.80) (envelope-from ) id 1j7f7Q-000737-MY; Fri, 28 Feb 2020 13:51:52 +0100 Date: Fri, 28 Feb 2020 13:51:52 +0100 From: Sebastian Andrzej Siewior To: Borislav Petkov Cc: Yu-cheng Yu , linux-kernel@vger.kernel.org, x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Dave Hansen , Tony Luck , Andy Lutomirski , Rik van Riel , "Ravi V. Shankar" , Fenghua Yu , Peter Zijlstra Subject: Re: [PATCH v2 8/8] x86/fpu/xstate: Restore supervisor xstates for __fpu__restore_sig() Message-ID: <20200228125152.nxp6vntmxconc4bj@linutronix.de> References: <20200121201843.12047-1-yu-cheng.yu@intel.com> <20200121201843.12047-9-yu-cheng.yu@intel.com> <20200221175859.GL25747@zn.tnic> <77f3841a92df5d0c819699ee3612118d566b7445.camel@intel.com> <20200228121724.GA25261@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200228121724.GA25261@zn.tnic> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-02-28 13:17:24 [+0100], Borislav Petkov wrote: > On Thu, Feb 27, 2020 at 02:52:12PM -0800, Yu-cheng Yu wrote: > > If TIF_NEED_FPU_LOAD is set, then xstates are already in the xsave buffer. > > We can skip saving them again. > > Ok, then pls use test_and_set_thread_flag(). I've been told not to do this while I crafted kernel_fpu_begin() because this would introduce an atomic operation which we want avoid. Sebastian