From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.137.202.136 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796083656; b=bmE0qOJEUVhhNMvpB2kWIYdOatbwhfB+RRaJhacSNhJBchgizNUh5xrytiizDd9/hDSa FQuwngZHc70e0Kn/JVkIz9E9YeevK938i9yTHHAdlfi2rjSh3Gv4f5/toWbACoTBqjiUn e0ks6CwS9mR4G51zAiFBNteukUjw2Lvm4zu0/ZsWsOzaSDSBORomJnn4gouDW4r00lPr7 giVyE3xKe0TC7nqtn7Pif3kEmWdh+uthB4/4cTUtWsLd8bcjO2w+r7AM3B9tdXYC0ISMU BcOVOYb2vzCv92ff/Lxl6LQz0TgT/cQIIhejwSiaaPyzDuaUXN1GGpbdTT0S6EMiEMg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796083656; h=DMARC-Filter:Received:DKIM-Filter:DKIM-Signature:Date:From:To:CC: Subject:User-Agent:In-Reply-To:References:Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding; bh=yewgSafZKJgXdeLfiKlKMIQZ9Dc4+KuZ21gSrmpJtb8=; b=4o5X23X1JBFEt7da9lKR1SlCfjmbwUuukNhRGADarG5bRVEweIvizuF84ED2rMu4P8aj dp9aiZhLUuEslsO7NqRvjRBofzEI3qfZrmnoIbvrJiX7MOCxhukGVFmIyruRFpWyrcjMB UyZlUj9ip4bsl7ye8rIJWop3fFwvvgZw7N5l/97JfycT3ZlLUgt6ROAiwzM7YqmtgHupw t/wE6pZNbV+vCZmScfNLyxxEzKA20nuLD5O97sZivxEmKd97gS/KTgCwEJhXs+0os5WxH 4OUAlfreABWTcvV6t9IOEhVaAaS+UdhF20cWCKoP22xMcrqMuiJancbhR/StHl9/0/g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass header.d=zytor.com header.i=@zytor.com header.a=rsa-sha256 header.s=2026112801 header.b=PcByBoyf; arc=none smtp.remote-ip=198.137.202.136 Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D631606A31A; Tue, 1 Dec 2026 00:07:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6D631606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.a=rsa-sha256 header.s=2026112801 header.b=PcByBoyf Received: from ehlo.thunderbird.net (c-76-133-66-138.hsd1.ca.comcast.net [76.133.66.138]) (authenticated bits=0) by mail.zytor.com (8.18.1/8.17.1) with ESMTPSA id 6B106nZZ2886540 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Mon, 30 Nov 2026 16:06:50 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 6B106nZZ2886540 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2026112801; t=1796083611; bh=yewgSafZKJgXdeLfiKlKMIQZ9Dc4+KuZ21gSrmpJtb8=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=PcByBoyfywJbkjAgHtcLqJm2EfaenQbL5eLUExBk5AURN8ckkYulRzFt2doDHuRW/ 60YwXVEdpBkKttNbeQhjeuVNc0XSKpOWoMXBNIGTdoimsvpmnLI0rTCxa5bRrJmeW3 nwGWXjW5n9tfPIkHz9u4OtnD9Ks89zSGQVPIpiQVxkeJ+WJgHirQpw//px/pjcP+gw qyGmy99bCxnc27o1zKB6LSm66fhwkMSw3v7A8QoDJa3ge7SbKHSljorFah8LjKk7eC SYUXTxb7zAwQ1aQr1QpUeaJHmlT2YzXu4+4VpmRqRmnCiIMnigow2kx0uIYiMWQJu0 NcJLRRgHVbBYw== Date: Mon, 30 Nov 2026 16:06:43 -0800 From: "H. Peter Anvin" To: Sohil Mehta , Dave Hansen , Dave Hansen , Borislav Petkov CC: Thomas Gleixner , Ingo Molnar , x86@kernel.org, Xin Li , Andy Lutomirski , Peter Zijlstra , Binbin Wu , Tom Lendacky , "Chang S . Bae" , Chao Gao , Sean Christopherson , Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_v2=5D_x86/fred=3A_Consolidat?= =?US-ASCII?Q?e_the_FRED_stack_pointer_assignments?= User-Agent: K-9 Mail for Android In-Reply-To: References: <20261124200659.471685-1-sohil.mehta@intel.com> <8525439b-5b3e-4eed-a09f-f387d8377013@intel.com> <6F472667-8E3B-4CA7-BC38-27C55B8354AA@zytor.com> <1a3ebcfc-dbb0-48eb-9674-7c34e5fdcb2d@intel.com> Message-ID: <712DC603-0E37-4B39-AE44-3446A198B40A@zytor.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On November 30, 2026 4:02:52 PM PST, Sohil Mehta wrote: >On 11/30/2026 3:48 PM, Dave Hansen wrote: >> On 11/30/26 15:43, Sohil Mehta wrote: >>> KVM doesn't write to the same MSR as the kernel=2E KVM reads the value= and >>> writes to the VMCS field HOST_IA32_FRED_RSP1=2E >>=20 >> This is all optimization, right? How about the series just does rdmsr() >> for now=2E It's the smallest amount of code=2E Start there=2E Optimize = later=2E > >Yes, we could do the optimization later=2E > >Sean's request originated here: >https://lore=2Ekernel=2Eorg/all/aahchI7oiFrjFAmb@google=2Ecom/ > >"The simplest approach would be to read the actual MSR=2E _If_ using a >per-CPU read provides meaningful performance benefits over RDMSR, =2E=2E= =2E >then have the kernel provide a dedicated accessor=2E" > >So, I am assuming he is still okay with deferring the optimization=2E > >FWIW, I measured the cycle difference between the per-CPU read and the >MSR read=2E It was ~6x more with the MSR read but with all the things >happening during vCPU load 3 MSR reads shouldn't matter much=2E > > The one reason I see to avoid rdmsr is the idea of "frustrate an attacker"= by resetting fixed-value control registers when convenient=2E