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=1796163331; b=uWhHCdKOJ2efqE+UuQgwX3v2wae0Gp+lMZgA5MCNqBCe1cFtGk9eDQyC7mIeZ4mFFhnz VURQRoid46Ue7Vhmjstg2TNYW325EfrkmDKN8XWU8S9SGGcvz1up7D+1YrLGIzU1IqZBt AKY8pPlfOJymS8wNsEGrLIOz3m8VG7WIB+sWfWAayve421YsNiDBRhfaSDVe+qEBw8Hgy Ygmbuf8ouaNS7GXqQM6unMHvRH0vvDww70tJw1feMQDcO6hQ7QvPCq3hPaLJwZPidFcOM i14Zj6yQo4vWoTNWmB+uoJUZOzTNBWucp2hGSjGQak/SXwWvoPS9yIt6R88MqOn+3tA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796163331; 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=KOZiIuw/yDkbUrlpizNkYNsDEwDkn2e+GnExq2SbV34=; b=jG1cvWLZeIa7dYxzSaI1yL6GUMdIAT+4b96QUM3noSOv8M+u+2Iv9Q4xpRRnMlj7O+He e6xgjXpNHSYt2XdKEM3KHXXB7Na/TmuZkXKhiOXN476jk1TvQ/7B9bqOk5KQzsjidhjK2 3yV+Shk10bzN+rORYZr4wrNFQOAOiZyt1E2EClMagbmK0klX3ct7cIwsdweDUKDYnKmki GCpu26gDXhU+jSbaxRTvD1i0NQl5TYKisAmFdyNngv2haKe67pM/bZTJk++uAsk1sykZJ C21oJkcjfOJVQW5mrOevjjNMN5HA+fSC1Z6LlKZ+9bxj3k85ALex86lj1Sxb4s9+7VA== 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=XJNiyk4v; 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 7CBEB606A31A; Tue, 1 Dec 2026 22:15:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7CBEB606A31A 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, unprotected) header.d=zytor.com header.i=@zytor.com header.a=rsa-sha256 header.s=2026112801 header.b=XJNiyk4v 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 6B1M7ooW1496911 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Tue, 1 Dec 2026 14:07:50 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 6B1M7ooW1496911 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2026112801; t=1796162871; bh=KOZiIuw/yDkbUrlpizNkYNsDEwDkn2e+GnExq2SbV34=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=XJNiyk4vFDa1NjW4DEVIwofFJiivkg4tZKrPjaSqrnmk+1o8sqlMeMfLfzNvf0lsQ UkqRMK/fdS7Fpp2gYX2KdFeaVJ4/ifkIti/D0Jiqrk8Tc2UBZefOg6mfP5B1tUbXkw rrznAkzodmMsom4Kb/QG1ggpA/dKAu9Skv9NhBSLaWRYj0qx/63NTAgyQR4+sn14M6 we1zyynV0ThTbE1bTGmVzaKbU4eMrpIjjLZKalGAsY1Ag0iYOhvOhWGqeAQK8+qA0d 0VBi9eITA4OHfsQQovhaDLzrDJgZef++pH7873JebJNNon0XatP0mHCMMT0/FUwoZm MYnHcEgRMVwDg== Date: Tue, 01 Dec 2026 14:07:44 -0800 From: "H. Peter Anvin" To: David Laight CC: Sohil Mehta , Dave Hansen , Dave Hansen , Borislav Petkov , 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: <20261201103159.2e083365@pumpkin> 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> <712DC603-0E37-4B39-AE44-3446A198B40A@zytor.com> <20261201103159.2e083365@pumpkin> Message-ID: <85B98D70-A2E3-4797-9998-14854B7AE7AC@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 December 1, 2026 2:31:59 AM PST, David Laight wrote: >On Mon, 30 Nov 2026 16:06:43 -0800 >"H=2E Peter Anvin" wrote: > >> On November 30, 2026 4:02:52 PM PST, Sohil Mehta wrote: >> >On 11/30/2026 3:48 PM, Dave Hansen wrote: =20 >> >> On 11/30/26 15:43, Sohil Mehta wrote: =20 >> >>> KVM doesn't write to the same MSR as the kernel=2E KVM reads the va= lue and >> >>> writes to the VMCS field HOST_IA32_FRED_RSP1=2E =20 >> >>=20 >> >> This is all optimization, right? How about the series just does rdms= r() >> >> for now=2E It's the smallest amount of code=2E Start there=2E Optimi= ze later=2E =20 >> > >> >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 >> > >> > =20 >>=20 >> The one reason I see to avoid rdmsr is the idea of "frustrate an attack= er" by resetting fixed-value control registers when convenient=2E >>=20 > >Unless you make writes to the per-cpu variables fault aren't they likely >to be just as easy to overwrite? > >David That would, in fact, be a good thing to do (ro_after_init percpu variables= =2E)