Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6023594pxb; Mon, 14 Feb 2022 13:21:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxQthbIt4BQNamWLb9wmq5DO5i/jNnMS08QK6ixZ9S5pCTB5CSEyTi/sdLZXLSl00KTy14B X-Received: by 2002:a17:902:b414:: with SMTP id x20mr819271plr.14.1644873684131; Mon, 14 Feb 2022 13:21:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644873684; cv=none; d=google.com; s=arc-20160816; b=uu8du+UMgQD7A2C9gV3fhWfc5VraCOTfBNueV67UXxKxP61hDklq+GQH6g5XyaLOV8 +eLnA6tXumtp2RCYd64ywoH9sHOdFHQ7Du801Rg1R6mG2mOlyB2HpsS2hq6qor4NG4qb jTDiyqw8+gWTIzRGbEwDE6xSOq8lvlRw7xx7fPSMWLTfC9hXl+0yx+xZtZN4qPpJzwib lbolcuLmW69xnDBFxcOMgrCl0EZMMwL8DVopBlCk/3nuCRTb2mX/5ASO7eoKuVjbT+Dc gws5DKfqQzBuFy1T7+Lkuy0mxVgqUsrrNjA9bXapG3p5NdQo4iPaYcfFgLhiIZQT7rYL 7Xkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=6u+9ukH/LMw94uKfwNeZ9i+1qIyH8VG4ZBJe2dC9f/0=; b=G1po/4m4r+h3ETW1x8thGA4gK433jTVuMhBUB943VEnlQOSKThOseedpH3YSqB+loq rs6U+wnlTWEuyUg2jn5/DV8RIjkb4LDQLfVXMvrn42RuIzjMvusmy7I/g9eyZUznUdqh 5D+tPLJK6AMRCNxGnjjXcKSNxWCMEoNrb48qQa9pYp7+oJEuEBo2RCrZtvo50vuvJDAB 64lcFCAktV1X803Vx5K7gO/VfHO8nPQVgzMbo0zOcO9bG0tolwHA+/8iSBW9s86EBGTu QhZPnf1CjXZsGTDgWi0JV5xHyW+JWPaaswiv4I4aT+8+bItpKxHPXpi9j4NmHWH/32lG E75w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XGdQRUoI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id bh11si882417pgb.473.2022.02.14.13.21.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 13:21:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XGdQRUoI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8E0959D4F0; Mon, 14 Feb 2022 12:37:49 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242866AbiBLALN (ORCPT + 93 others); Fri, 11 Feb 2022 19:11:13 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354337AbiBLALJ (ORCPT ); Fri, 11 Feb 2022 19:11:09 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B433D71; Fri, 11 Feb 2022 16:11:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644624668; x=1676160668; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=VdSJ8eY/U+4hpxtDAQ/eHvpH0QesMIBN4OIVk8QPpY0=; b=XGdQRUoIGJzAerK6Qqom3H9IGMQzIctNG2B+2LE2p6K8hySfLHXiaCwN kWmVOWonWsiDdPp38zPyyFds+CmkuzMzAt8G4o86rz7bBYR1ZDBalgMzE CTqQQC7PKEvwWe4P+AoathTD4EtPMPmL6lFDZsmQkRAhb3RvlKkeb37/o vgejXMDfdERt/Y6EVfSGbEsFpCWNtCn463rYB2jgb0K3TWDNld1Psk5Cc S0xGFbovdO09klMV4HFOxTIe+R/PugJGOa+izdVLl/7JfTkYyLn0xXqZg BKPFoTGjOkRioBkQ8G1FGmmMYPiHUziEClVXOhGhAsrA+EllvEz6P1bSM Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10255"; a="274395593" X-IronPort-AV: E=Sophos;i="5.88,361,1635231600"; d="scan'208";a="274395593" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2022 16:11:07 -0800 X-IronPort-AV: E=Sophos;i="5.88,361,1635231600"; d="scan'208";a="542295349" Received: from nsmdimra-mobl.amr.corp.intel.com (HELO [10.209.96.127]) ([10.209.96.127]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2022 16:11:06 -0800 Message-ID: Date: Fri, 11 Feb 2022 16:11:03 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: Andy Lutomirski , Rick P Edgecombe , the arch/x86 maintainers , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Linux Kernel Mailing List , linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, Linux API , Arnd Bergmann , Balbir Singh , Borislav Petkov , 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 (Intel)" , Randy Dunlap , "Shankar, Ravi V" , Dave Martin , Weijiang Yang , "Kirill A. Shutemov" , "Moreira, Joao" , "john.allen@amd.com" , "kcc@google.com" , "Eranian, Stephane" Cc: Yu-cheng Yu References: <20220130211838.8382-1-rick.p.edgecombe@intel.com> <20220130211838.8382-26-rick.p.edgecombe@intel.com> <4eeab037-502c-4d8d-84da-e29203dad6ad@www.fastmail.com> From: Dave Hansen Subject: Re: [PATCH 25/35] x86/cet/shstk: Add user-mode shadow stack support In-Reply-To: <4eeab037-502c-4d8d-84da-e29203dad6ad@www.fastmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/11/22 16:07, Andy Lutomirski wrote: > On Fri, Feb 11, 2022, at 3:37 PM, Dave Hansen wrote: >> On 1/30/22 13:18, Rick Edgecombe wrote: >>> Add the user shadow stack MSRs to the xsave helpers, so they can be used >>> to implement the functionality. >> Do these MSRs ever affect kernel-mode operation? >> >> If so, we might need to switch them more aggressively at context-switch >> time like PKRU. >> >> If not, they can continue to be context-switched with the PASID state >> which does not affect kernel-mode operation. > PASID? PASID is all kinds of weird. I assume you mean switching it > with all the normal state. I was grouping PASID along with the CET MSRs because they're the only supervisor state. But, yeah, it's all XRSTOR'd at the same spot right now, user or kernel.