Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp956651ybk; Sun, 10 May 2020 01:48:41 -0700 (PDT) X-Google-Smtp-Source: APiQypLOQ4jB7YnJw9guiNj7Kmr7vw+5EcnobyzQEZ0sJz72Lk7KUnI/9XA65v4IGWDY7EvM8WCW X-Received: by 2002:aa7:c0d1:: with SMTP id j17mr9006782edp.308.1589100521774; Sun, 10 May 2020 01:48:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589100521; cv=none; d=google.com; s=arc-20160816; b=w3s+wrPbzQlJUAI2aSXPiDs4xYBhkGswXMBwkkVGpuwxFT4QVKemzdfn2umIDhJwSp ES2tKONLnkQfwHWnzJyU9ooD7GKmvRujy9v6/0v5lvvn4wbntyIj3clTy0GtTAVBPwHg 6OS4iD3vRMYKTQPAuNUOKbTA/UAyunZmkxARFMlGDOZyS8KrAchJb3TCaeWj5zGP43K5 iYC+y08HiMzDm6KjHOBpCA8fZCvi1kDf+3xRYhdo4licmT+mhzdwZw2Mz7lsLvjTyiPp n7stmazKxsbVBg85ZDxsrsqnNoHGZWziJNv52wVd2pGqQwYd+RlBVOmIQT2NKBGxOcYp yypA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Jq2xwbGufTibiBAB161r3csXP9B+3Tf4QyudVtZUfEk=; b=loe8MEnoXRIglznB/40EE4JU+au3F5uVrhEWYVtipiJLLRg704oWbTnHJh/ufUU7Zg ano+h7hZOS7ofuLezTWpgIx1tyUAY9rkY4rTzuHatn44+loCultdFIgtmq6q40i6nYIM /TWtw6WDfhJZdKvh0ThpMdqevVWXlP6OD/NdtBAbJgDN0wnvCIQjansOY499ANV21p6M b/9fghjewWY9lw8fbRMhjQs7b1PR7yVcqG7Yabpit1JsrlzEsTz5RPdGn5C4n6K3KZ/n M1KUfrfuNqu8yyIqaKk/lGlnMTA/R3p2UmCaFElMTV6miC70X9CeCYh/0rZ8ni20WuN1 o/Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Ulu9azEv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j13si4130125edn.465.2020.05.10.01.48.17; Sun, 10 May 2020 01:48:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Ulu9azEv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727870AbgEJIqf (ORCPT + 99 others); Sun, 10 May 2020 04:46:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725839AbgEJIqf (ORCPT ); Sun, 10 May 2020 04:46:35 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1375EC061A0C for ; Sun, 10 May 2020 01:46:35 -0700 (PDT) Received: from zn.tnic (p200300EC2F286200C518754118B553FE.dip0.t-ipconnect.de [IPv6:2003:ec:2f28:6200:c518:7541:18b5:53fe]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 7F35A1EC02A1; Sun, 10 May 2020 10:46:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1589100392; 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: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=Jq2xwbGufTibiBAB161r3csXP9B+3Tf4QyudVtZUfEk=; b=Ulu9azEvfxpYU8zObFzx87nWsa8Hv7EZGGsgY5dPm0iq7soB47M724n7gKJfQiPEfzPC7S 0hbonqk6tw+y4kp5rIaNw/dDfD9Nk5P24QjU2hkoeivaK/k3900D1CktAddcYlHpf4whSS aM2c2AHrHBlY3dfIM1m4y8m/ERPf5gk= Date: Sun, 10 May 2020 10:46:25 +0200 From: Borislav Petkov To: Yu-cheng Yu Cc: 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" , Sebastian Andrzej Siewior , Fenghua Yu , Peter Zijlstra Subject: Re: [PATCH v3 09/10] x86/fpu/xstate: Preserve supervisor states for slow path of __fpu__restore_sig() Message-ID: <20200510084625.GA19352@zn.tnic> References: <20200328164307.17497-1-yu-cheng.yu@intel.com> <20200328164307.17497-10-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200328164307.17497-10-yu-cheng.yu@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 28, 2020 at 09:43:06AM -0700, Yu-cheng Yu wrote: > The signal return code is responsible for taking an XSAVE buffer present > in user memory and loading it into the hardware registers. This > operation only affects user XSAVE state and never affects supervisor state. > > The fast path through this code simply points XRSTOR directly at the > user buffer. However, due to page faults, this XRSTOR can fail. If it ^^^^^^^^^^^^^^^^^^ "However, since user memory is not guaranteed to be always mapped, ... " > fails, the signal return code falls back to a slow path which can > tolerate page faults. > > That slow path copies the xfeatures one by one out of the user buffer > into the task's fpu state area. However, by being in a context where it > can handle page faults, the code can also schedule. That exposes us to ^^ Pls use passive voice in your commit message: no "we" or "I", etc, and describe your changes in imperative mood. Fix this in all your commit messages pls. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette