From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Subject: Re: [PATCH v10 00/26] Control-flow Enforcement: Shadow Stack Date: Thu, 23 Jul 2020 09:41:37 -0700 Message-ID: <2e9806a3-7485-a0d0-b63d-f112fcff954c@intel.com> References: <20200429220732.31602-1-yu-cheng.yu@intel.com> <20200723162531.GF21891@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20200723162531.GF21891@linux.intel.com> Content-Language: en-US Sender: linux-doc-owner@vger.kernel.org To: Sean Christopherson , 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 , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit List-Id: linux-arch.vger.kernel.org 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? ;) I thought KVM had its own vcpu->arch.guest_fpu buffers which mirrored the size and format of task->fpu. Can we have KVM support today without task->fpu support? I see some XSS munging in the KVM code so I think this might be *possible*, but I don't see all of the plumbing that would make it actually work. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH v10 00/26] Control-flow Enforcement: Shadow Stack References: <20200429220732.31602-1-yu-cheng.yu@intel.com> <20200723162531.GF21891@linux.intel.com> From: Dave Hansen Message-ID: <2e9806a3-7485-a0d0-b63d-f112fcff954c@intel.com> Date: Thu, 23 Jul 2020 09:41:37 -0700 MIME-Version: 1.0 In-Reply-To: <20200723162531.GF21891@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-doc-owner@vger.kernel.org To: Sean Christopherson , 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 , 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: <20200723164137.ZJ76D8EZETKOgyAN9EBrExOrTIg3UzTr5BkeaIH1Zac@z> 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? ;) I thought KVM had its own vcpu->arch.guest_fpu buffers which mirrored the size and format of task->fpu. Can we have KVM support today without task->fpu support? I see some XSS munging in the KVM code so I think this might be *possible*, but I don't see all of the plumbing that would make it actually work.