From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.199 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796162024; b=gFHyzwGZUfrWzHdtuB+/shTdw8nHrfCNRCGYNxMbya8JvIKZTjKLu3BeiYpGA5X6Vd5Z P805apZjJC2hn5A18Nm54NMP0YBB6AJymZyZhDQWr7x8hNklyG+A9hKFqRCUU2JU2WkRB UETgVutKwf3+ajt/D+q+e3t0Az0pQM7uluzj3+yWyqSaZhofysmAaPMhTKda3IhK55pQ9 QUQa16jJvJOUW7y80TID4ubTkv3Pn6Jlh5XPsYg6znt3/7b6bDmVe13ddngSNyrSbEmmT GQr7PdgR1WOmbzsN4adIhGIL9bRrkGw+X5lUjAYcoBi+ntcYTQ7IZseeM+VXHP1nDMw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796162024; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:Message-ID:Subject:From:To:Cc:Content-Type; bh=F3u0bXmWl892HXfvV9z9nnU8JLSbh8aLfil+CjUfXXo=; b=fadMUHPmA3R4MRFUQkGBfdpb4aHPPVR9fxwUYSIjg7C67R5LBWAv1bKN+U27ceFEZ8QI salt02hs1fAJVFsFsBcURPSVW4YU38k83uSDFNCGMRcIAMTXU6nmXsCWj++8SwETKMuiA B7t9EASrAWyD5rAi3QeUnEJpX+2dD+5ZLR9NNYcgallPoJsArT7SA8zVceo2NZ5huHm6E XQdvKdwztlOQg0/qmfElqR4/iijImQB7cKd73Yvzd0k9VIpJX/hKT9jWiQXBbYiVKI+1T CkOqVxCfmFZAa6NRAEYz5HtWqPHf3jeJs2Rxz6iDlKJLK94Gf9soQ1rhigQ6Mzf/lQg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=IhO+DEeo; arc=none smtp.remote-ip=209.85.214.199 Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C3B5606A31A for ; Tue, 1 Dec 2026 21:53:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9C3B5606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=IhO+DEeo Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2f0578f1d51so137161885ad.3 for ; Tue, 01 Dec 2026 13:53:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796162023; x=1796766823; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=F3u0bXmWl892HXfvV9z9nnU8JLSbh8aLfil+CjUfXXo=; b=IhO+DEeosX7d+cxFBfQBBiakZJ4xjV7qGFCqhvA14Fj5azru5t6T7ZF85+swyk0ANa pXMMGvFb0ZXjHIicUMYc4nauRT32lR65mallKLf8AlT7U1X3d4LlqxHm/v7O5YwFFmKW tQH2OEfMSZchAhBdQ2CbWEqvxZ+/vz8ZRerQnTcDWaA/vqCSyw4swWgQup8LNjxccCdb wRKV/yFuosjJvgBFto1EuBYcMxwmpm9KUGn7eMRnnzi/meYpCrJPkVyETnpychwvA2b7 GtXMp7zF5jwq/SqwvBNkqJkl8jgPgRF6rNdE6k9v1B3cB81j2HBX6PqZg2wp42LQErmC /snA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796162023; x=1796766823; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=F3u0bXmWl892HXfvV9z9nnU8JLSbh8aLfil+CjUfXXo=; b=M9ypohx+CP64SjziQh4jLOCgoqquuyHpBq5NK3KRTdud3PhFiJp+bPFCZrUzElsdD9 r8YxqaEdB/qp3vVPabARv3brBhkvVJED0NPnULaR+PG+7LxpzRScWbaWRgvVQylJqb2f 1fTs0+1enFuvhSbb9f0aj+MavNtf03ryPaxaiOzOtFS4G/Vpm/Uarq/lrwQBnKrA0PXf VN0+3shvE/oM2g28psi6o2CwEIi5s2XDRjqF6sx72qz+rIm3JT2BmpKprXS7eZUQG4tm cGWpr+8u9HEwwygriC6Yi+1lVabwSkyVQ16YCxUYeQjipwr7tyb+tQDN3wsDOuww7k0v 2G1g== X-Forwarded-Encrypted: i=1; AL+hErG9a9LJIwz4UCnaivO7XSz1DiwlEjtWsxpDVnfQcbkIGxPVbXQV5lUXldE0WOlnalHJ6i6+2+CuSS7o4Jw=@vger.kernel.org X-Gm-Message-State: APuU4Z9MJwFL4spkI7mNR0YynQzkuwCmo/vSPGhOsfK5AbMG/pBgm/Lr IjHO8xH2SkJioFJ1e3hniDnPK6JHcabYlu0IFGZgkQohB87u1XQhz/wOcsvUlZPuClKMpqzmqZK /FTsn/g== X-Received: from plbms16.prod.google.com ([2002:a17:903:ad0:b0:2ef:f76f:c4]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:902:e80b:b0:2ed:2b2f:8632 with SMTP id d9443c01a7336-2f03f11e582mr430457785ad.22.1796162022590; Tue, 01 Dec 2026 13:53:42 -0800 (PST) Date: Tue, 1 Dec 2026 13:53:41 -0800 In-Reply-To: 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 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: Subject: Re: [PATCH v2] x86/fred: Consolidate the FRED stack pointer assignments From: Sean Christopherson To: Sohil Mehta Cc: Dave Hansen , "H. Peter Anvin" , 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 , Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Mon, Nov 30, 2026, 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. KVM reads the value and > >> writes to the VMCS field HOST_IA32_FRED_RSP1. > > > > This is all optimization, right? How about the series just does rdmsr() > > for now. It's the smallest amount of code. Start there. Optimize later. > > Yes, we could do the optimization later. > > Sean's request originated here: > https://lore.kernel.org/all/aahchI7oiFrjFAmb@google.com/ > > "The simplest approach would be to read the actual MSR. _If_ using a > per-CPU read provides meaningful performance benefits over RDMSR, ... > then have the kernel provide a dedicated accessor." > > So, I am assuming he is still okay with deferring the optimization. Yes, absolutely. > FWIW, I measured the cycle difference between the per-CPU read and the > MSR read. It was ~6x more with the MSR read but with all the things > happening during vCPU load 3 MSR reads shouldn't matter much. It's not even vCPU load, it's specifically task migration (or technically if the vCPU is run on a different task that was bound to a different pCPU). That's why I emphasized "if" in my response long ago: the odds of three RDMSRs being meaningful is basically zero.