Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3066804imu; Sun, 11 Nov 2018 07:00:52 -0800 (PST) X-Google-Smtp-Source: AJdET5fwggnZ6FBRKPg9Jy6TomnEbZPhUbGmbyNJL6VU7qEbJOY5qVZTg85jQLhtOM4wOwTNnJAk X-Received: by 2002:a65:594b:: with SMTP id g11-v6mr13817720pgu.229.1541948452305; Sun, 11 Nov 2018 07:00:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541948452; cv=none; d=google.com; s=arc-20160816; b=h2WHVKyb0owBG4gSlrzxZQEpedVJbpgfaFX7vN7a+dxRIc+j2Lzq0DA5b+gHjiXcNX f0Op9TrfKSdjp5ThaiMNY1J4/H/6mXFn/fT/gk3VuSguCsC9I8FBxxtf+fWlDKs4kguX M+KuiHe1shWCjx5YrPxQezhmhlG+i3RmHh95X0aGYY85Zw30VsRy+vP5jFldd8jwpCJu Gsgl4pU8JtheExBg12NzmsnHQAmn/8uKiIJstciDRdeN63737epRcVWZNGBzEAxv1eZd aG4W4axSz4urpsqpGpEsUHDLImwt78OKFzDk7XAvc7rfT9IdZ8602vNHavVNP10Anqdh PYYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=cHMilXDw5bUH21G67l5k/4SMtxENZT+u2nIi09szgtg=; b=R/pG7I/dXNvLPq/LreBE3pyWbqPrXmBIlROmHSTy3LELz8mTRiD850tGvdvnSHjn7a +xZ9+kfSH1FLPs2bGKsIiVRM0FMC1EDQB7dJnPlyAvuvKbyBu07Cl9Kv6SU1GnBN+7Od d+hu/Cb1RdsUkTNVnK2NSl+POdso6KTbX/GpYR/MhrU3FuEk1sTnQakUaMeEyoMwZ2V6 aXOns+r5ELljFZ2m7BsUw1vRbN0MR0UJDTjnVAsLVxf6dFibvV5iu8ig6PoAGYhKoB/u NiVMccCLNrN5LtEtFitPLu1oae97M0drVMzM9hOzvuFmOdSxCvADWuu7kw17V2o78CW3 vccg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=VUEtPQcS; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 19-v6si17642005pfb.113.2018.11.11.07.00.28; Sun, 11 Nov 2018 07:00:52 -0800 (PST) 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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=VUEtPQcS; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728331AbeKLAsP (ORCPT + 99 others); Sun, 11 Nov 2018 19:48:15 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43188 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728440AbeKLAsP (ORCPT ); Sun, 11 Nov 2018 19:48:15 -0500 Received: by mail-pg1-f196.google.com with SMTP id n10-v6so2877852pgv.10 for ; Sun, 11 Nov 2018 06:59:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=cHMilXDw5bUH21G67l5k/4SMtxENZT+u2nIi09szgtg=; b=VUEtPQcSNtpd4xatCW/9XAdxj9mvvPthKzgeKrLJMJ6X8vXylFtUjvwieZTRu1zTeo Nn//7iQGmhIlUyv33f7Lsj2PGv8j3aYcyrkkCXsmTEdB9C9vJbTvyNTbMKIww7JigqyG UtDrKElDXWc6TdXy4HQaEpqIzNxm6dUWU6otSQLvD+jc1iN6i2UqW67sVwO6/+qXxcLB cyEP4MHcm+0+ZkpNHhwSfJOTsaGhZIotyr5WrKVuF705Zfla715+piRR/RXJIbco7kZ4 7cOJRv0rpsdGE33VX3kj3A9clE2QankaVSdDjVUrBUTn522XuiKOH8CpKaiFu/a+BOmT ktIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=cHMilXDw5bUH21G67l5k/4SMtxENZT+u2nIi09szgtg=; b=PCbh+UDTNsjTWolWAn88L9fQSWyixu0b3EZ+WXeaS4yU8BRF7fTw7qi3MWxSB6B+PZ SoZtR3YXpA5y6IPnwLTN7T48KUrPNT+wkdna5nlEbnmO9/EBVAckFuskHjq9uD1gzhck AOE9CUewaegv49GzPaiSQwXkVp+1zipGIW0YO8VLDNEVWcvrihB4e9aAJFRk9ZsNuDTE Ag7la21Czv1zueC0zIr/o2H7toY5MN6+0VThHGykBWIkk82TISjX2n3DKQCOSrQ5t1dn 975QU1aALhkDfiM7lqyGtDw5PZkoS8NWUqT4DhPUV51vtTPW/txO8IT+CqfBVnPBk4VH 55Lw== X-Gm-Message-State: AGRZ1gJvQhqrauoiKPq36mzBVS75YhlBNo1of/oDFhLVsTrmrmfZsTKH iAbCGtUDt4rYW61s0NMHjTkABQ== X-Received: by 2002:a63:e54:: with SMTP id 20-v6mr13210060pgo.369.1541948367818; Sun, 11 Nov 2018 06:59:27 -0800 (PST) Received: from ?IPv6:2600:1010:b064:bb40:4943:9d87:c587:e641? ([2600:1010:b064:bb40:4943:9d87:c587:e641]) by smtp.gmail.com with ESMTPSA id v20-v6sm27195306pfj.107.2018.11.11.06.59.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 06:59:26 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v5 04/27] x86/fpu/xstate: Add XSAVES system states for shadow stack From: Andy Lutomirski X-Mailer: iPhone Mail (16A404) In-Reply-To: <20181111113103.GG27666@amd> Date: Sun, 11 Nov 2018 06:59:24 -0800 Cc: Borislav Petkov , Yu-cheng Yu , 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 , 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 , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue Content-Transfer-Encoding: quoted-printable Message-Id: <4E917DA9-5192-48E2-8857-08C3ABE08AFE@amacapital.net> References: <20181011151523.27101-1-yu-cheng.yu@intel.com> <20181011151523.27101-5-yu-cheng.yu@intel.com> <20181108184038.GJ7543@zn.tnic> <20181111113103.GG27666@amd> To: Pavel Machek Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Nov 11, 2018, at 3:31 AM, Pavel Machek wrote: >=20 > Hi! >=20 >>> +/* >>> + * State component 12 is Control flow Enforcement kernel states >>> + */ >>> +struct cet_kernel_state { >>> + u64 kernel_ssp; /* kernel shadow stack */ >>> + u64 pl1_ssp; /* ring-1 shadow stack */ >>> + u64 pl2_ssp; /* ring-2 shadow stack */ >>=20 >> Just write "privilege level" everywhere - not "ring". >=20 > Please just use word "ring". It is well estabilished terminology. >=20 > Which ring is priviledge level 1, given that we have SMM and > virtualization support? To the contrary: CPL, DPL, and RPL are very well defined terms in the archit= ecture manuals. =E2=80=9CPL=E2=80=9D is privilege level. PL 1 is very well d= efined. SMM is SMM, full stop (unless dual mode or whatever it=E2=80=99s called is o= n, but AFAIK no one uses it). VMX non-root CPL 1 is *still* privilege level= 1. In contrast, the security community likes to call SMM =E2=80=9Cring -1=E2=80= =9D, which is cute, but wrong from a systems programmer view. For example, S= MM=E2=80=99s CPL can still range from 0-3. >=20 > Pavel > --=20 > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/bl= og.html