From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yu-cheng Yu Subject: Re: [PATCH v10 00/26] Control-flow Enforcement: Shadow Stack Date: Thu, 23 Jul 2020 20:40:33 -0700 Message-ID: References: <20200429220732.31602-1-yu-cheng.yu@intel.com> <20200723162531.GF21891@linux.intel.com> <2e9806a3-7485-a0d0-b63d-f112fcff954c@intel.com> <20200723165649.GG21891@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: Received: from mga06.intel.com ([134.134.136.31]:43724 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726525AbgGXDle (ORCPT ); Thu, 23 Jul 2020 23:41:34 -0400 In-Reply-To: Sender: linux-arch-owner@vger.kernel.org List-ID: To: Dave Hansen , Sean Christopherson 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 , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit On Thu, 2020-07-23 at 11:41 -0700, Dave Hansen wrote: > On 7/23/20 9:56 AM, Sean Christopherson wrote: > > On Thu, Jul 23, 2020 at 09:41:37AM -0700, Dave Hansen wrote: > > > On 7/23/20 9:25 AM, Sean Christopherson wrote: > > > > How would people feel about taking the above two patches (02 and 03 in the > > > > series) through the KVM tree to enable KVM virtualization of CET before the > > > > kernel itself gains CET support? I.e. add the MSR and feature bits, along > > > > with the XSAVES context switching. The feature definitons could use "" to > > > > suppress displaying them in /proc/cpuinfo to avoid falsely advertising CET > > > > to userspace. > > > > > > > > AIUI, there are ABI issues that need to be sorted out, and that is likely > > > > going to drag on for some time. > > > > > > > > Is this a "hell no" sort of idea, or something that would be feasible if we > > > > can show that there are no negative impacts to the kernel? > > > Negative impacts like bloating every task->fpu with XSAVE state that > > > will never get used? ;) > > Gah, should have qualified that with "meaningful or measurable negative > > impacts". E.g. the extra 40 bytes for CET XSAVE state seems like it would > > be acceptable overhead, but noticeably increasing the latency of XSAVES > > and/or XRSTORS would not be acceptable. > > It's 40 bytes, but it's 40 bytes of just pure, unadulterated waste. It > would have no *chance* of being used. It's also quite precisely > measurable on a given system: > > cat /proc/slabinfo | grep task_struct | awk '{print $3 * 40}' If there is value in getting these two patches merged first, we can move XFEATURE_MASK_CET_USER to XFEATURE_MASK_SUPERVISOR_UNSUPPORTED for now, until CET is eventually merged. That way, there is no space wasted. Yu-cheng From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: Subject: Re: [PATCH v10 00/26] Control-flow Enforcement: Shadow Stack From: Yu-cheng Yu Date: Thu, 23 Jul 2020 20:40:33 -0700 In-Reply-To: References: <20200429220732.31602-1-yu-cheng.yu@intel.com> <20200723162531.GF21891@linux.intel.com> <2e9806a3-7485-a0d0-b63d-f112fcff954c@intel.com> <20200723165649.GG21891@linux.intel.com> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-doc-owner@vger.kernel.org To: Dave Hansen , Sean Christopherson 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 , 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 , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang List-ID: Message-ID: <20200724034033.ISYxhmyMtML99jqkjhUQIXAi0MH14ipBWOOCxdjeGvw@z> On Thu, 2020-07-23 at 11:41 -0700, Dave Hansen wrote: > On 7/23/20 9:56 AM, Sean Christopherson wrote: > > On Thu, Jul 23, 2020 at 09:41:37AM -0700, Dave Hansen wrote: > > > On 7/23/20 9:25 AM, Sean Christopherson wrote: > > > > How would people feel about taking the above two patches (02 and 03 in the > > > > series) through the KVM tree to enable KVM virtualization of CET before the > > > > kernel itself gains CET support? I.e. add the MSR and feature bits, along > > > > with the XSAVES context switching. The feature definitons could use "" to > > > > suppress displaying them in /proc/cpuinfo to avoid falsely advertising CET > > > > to userspace. > > > > > > > > AIUI, there are ABI issues that need to be sorted out, and that is likely > > > > going to drag on for some time. > > > > > > > > Is this a "hell no" sort of idea, or something that would be feasible if we > > > > can show that there are no negative impacts to the kernel? > > > Negative impacts like bloating every task->fpu with XSAVE state that > > > will never get used? ;) > > Gah, should have qualified that with "meaningful or measurable negative > > impacts". E.g. the extra 40 bytes for CET XSAVE state seems like it would > > be acceptable overhead, but noticeably increasing the latency of XSAVES > > and/or XRSTORS would not be acceptable. > > It's 40 bytes, but it's 40 bytes of just pure, unadulterated waste. It > would have no *chance* of being used. It's also quite precisely > measurable on a given system: > > cat /proc/slabinfo | grep task_struct | awk '{print $3 * 40}' If there is value in getting these two patches merged first, we can move XFEATURE_MASK_CET_USER to XFEATURE_MASK_SUPERVISOR_UNSUPPORTED for now, until CET is eventually merged. That way, there is no space wasted. Yu-cheng