Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp940000ybl; Wed, 21 Aug 2019 07:46:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqx96ZkIv1KKyqRb5vXvXpO32VAFlj/23Cys38fmJHaV7+Zs1TSsN9TMEyuutVeTxlmiS6EI X-Received: by 2002:a63:3006:: with SMTP id w6mr29742260pgw.440.1566398816005; Wed, 21 Aug 2019 07:46:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566398815; cv=none; d=google.com; s=arc-20160816; b=dIR6K0BhC2+K2lUqVD+asLiR1xdtTZvBV0QNOcRd1gFXrFilvdQhLqPhZCDf2+c0+i LoY4TAkaIh20pUQw1pn5RwqsIy41Wg7CLvnGiXf6Y1vsvES4TGM8kSxJQckjzHTloMq4 +DydQxQqYpfbviFIBtJLU1SJrTHiryfY5jgW3b5O42kipkKUAYgxdQ7cNwns3+Xs8klw rwk0046yL1qpi3JJ37oZivbfHvRGujiEq5Vg+6xn+bsJHDtuWqJPMklgNEnLNtedvXwz 8l/E2sUjVK9+yKPtbYF9AsrYY4CdUfj51DQieu8nUlQVDvk/ONGCqhjV4GUoCiUrRPv+ KtBQ== 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=lTbUTRWT7/yDYikPZXnxrPfidgHBKAk129d3QMAlBN8=; b=KM4z97TH+VtA0WEfxc6Htf8xo8gpEFA+VugLwjiHMsY9DTdofon4o2vZljVFD3GVvs H3cO0NCzsCaLtBjOl7LAERz8hJfDt4WZ5tYqjo9lW1iDrcciZlaqXRkhA3f01JJSsgqd ch4rx9/6ftX43W+Hdq/DDhKeIn5BDptSZnikVM06p9PQktXxqF5xsP90IIvLjr3nn5PI WPP7adaDA8LHtn8E6iizZa5N4EiUScIdyUev2Exxp8X9OmxUiu6Z6XpoxiUHCiko/RnA 3EgOKSpukg9ON0CdgSyXZ7AwLfqHtpN5J9r95Xt2zc30O9uu5CLdL1IToD8Ps51k21bh 1uaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=UkT303Q6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bh6si13582875plb.285.2019.08.21.07.46.40; Wed, 21 Aug 2019 07:46:55 -0700 (PDT) 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; dkim=pass header.i=@alien8.de header.s=dkim header.b=UkT303Q6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729524AbfHUOpp (ORCPT + 99 others); Wed, 21 Aug 2019 10:45:45 -0400 Received: from mail.skyhub.de ([5.9.137.197]:59090 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728608AbfHUOpp (ORCPT ); Wed, 21 Aug 2019 10:45:45 -0400 Received: from zn.tnic (p200300EC2F0A6300AD34BF75F4F01B21.dip0.t-ipconnect.de [IPv6:2003:ec:2f0a:6300:ad34:bf75:f4f0:1b21]) (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 640051EC02FE; Wed, 21 Aug 2019 16:45:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1566398743; 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=lTbUTRWT7/yDYikPZXnxrPfidgHBKAk129d3QMAlBN8=; b=UkT303Q6PQdQLRjF8bKFTVDYvf4/veO5tJOiyCziZe8EFQW68CVP7lBVMYQ6nGizmgFJKg FXELQvYm+ouBqgeO8bgrwK4zZB6waqhJ19Svr+ncvTHiXIWFyPkdLQkYqVzmPMYB1QhKcy UQ+ZL3nw4KcOvt+o5NmnqkpKAJ1PVOU= Date: Wed, 21 Aug 2019 16:45:37 +0200 From: Borislav Petkov To: Yu-cheng Yu Cc: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin Subject: Re: [PATCH v8 03/27] x86/fpu/xstate: Change names to separate XSAVES system and user states Message-ID: <20190821144537.GE6752@zn.tnic> References: <20190813205225.12032-1-yu-cheng.yu@intel.com> <20190813205225.12032-4-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190813205225.12032-4-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 Tue, Aug 13, 2019 at 01:52:01PM -0700, Yu-cheng Yu wrote: > Control-flow Enforcement (CET) MSR contents are XSAVES system states. > To support CET, introduce XSAVES system states first. > > XSAVES is a "supervisor" instruction and, comparing to XSAVE, saves > additional "supervisor" states that can be modified only from CPL 0. > However, these states are per-task and not kernel's own. Rename > "supervisor" states to "system" states to clearly separate them from > "user" states. > > Signed-off-by: Yu-cheng Yu > --- > arch/x86/include/asm/fpu/internal.h | 4 +- > arch/x86/include/asm/fpu/xstate.h | 20 +++---- > arch/x86/kernel/fpu/init.c | 2 +- > arch/x86/kernel/fpu/signal.c | 10 ++-- > arch/x86/kernel/fpu/xstate.c | 86 ++++++++++++++--------------- > 5 files changed, 60 insertions(+), 62 deletions(-) ... > diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c > index e5cb67d67c03..d560e8861a3c 100644 > --- a/arch/x86/kernel/fpu/xstate.c > +++ b/arch/x86/kernel/fpu/xstate.c > @@ -54,13 +54,16 @@ static short xsave_cpuid_features[] __initdata = { > }; > > /* > - * Mask of xstate features supported by the CPU and the kernel: > + * XSAVES system states can only be modified from CPL 0 and saved by > + * XSAVES. The rest are user states. The following is a mask of > + * supported user state features derived from boot_cpu_has() and ...derived from detected CPUID feature flags and SUPPORTED_XFEATURES_MASK. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.