From: Sean Christopherson <seanjc@google.com>
To: Sohil Mehta <sohil.mehta@intel.com>
Cc: Dave Hansen <dave.hansen@intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Borislav Petkov <bp@alien8.de>,
Thomas Gleixner <tglx@kernel.org>,
Ingo Molnar <mingo@redhat.com>,
x86@kernel.org, Xin Li <xin@zytor.com>,
Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Binbin Wu <binbin.wu@linux.intel.com>,
Tom Lendacky <thomas.lendacky@amd.com>,
"Chang S . Bae" <chang.seok.bae@intel.com>,
Chao Gao <chao.gao@intel.com>,
Paolo Bonzini <pbonzini@redhat.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86/fred: Consolidate the FRED stack pointer assignments
Date: Tue, 1 Dec 2026 13:53:41 -0800 [thread overview]
Message-ID: <aw9B5dbk-LiTawOe@seanjc-mac.roam.internal> (raw)
In-Reply-To: <c0016f0b-0513-415c-9a49-a5bd8b04c618@intel.com>
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.
next prev parent reply other threads:[~2026-12-01 21:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 20:06 Sohil Mehta
2026-11-30 22:43 ` Dave Hansen
2026-11-30 23:18 ` H. Peter Anvin
2026-11-30 23:38 ` Dave Hansen
2026-11-30 23:43 ` Sohil Mehta
2026-11-30 23:48 ` Dave Hansen
2026-12-01 0:02 ` Sohil Mehta
2026-12-01 0:06 ` H. Peter Anvin
2026-12-01 10:31 ` David Laight
2026-12-01 22:07 ` H. Peter Anvin
2026-12-01 21:53 ` Sean Christopherson [this message]
2026-11-30 23:37 ` Sohil Mehta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aw9B5dbk-LiTawOe@seanjc-mac.roam.internal \
--to=seanjc@google.com \
--cc=binbin.wu@linux.intel.com \
--cc=bp@alien8.de \
--cc=chang.seok.bae@intel.com \
--cc=chao.gao@intel.com \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=sohil.mehta@intel.com \
--cc=tglx@kernel.org \
--cc=thomas.lendacky@amd.com \
--cc=x86@kernel.org \
--cc=xin@zytor.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®