Re: [PATCH v9 08/22] KVM: VMX: Set FRED MSR intercepts

From: Xin Li

Date: Thu Mar 05 2026 - 01:16:58 EST




> On Mar 4, 2026, at 4:48 PM, Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> On Wed, Nov 12, 2025, Chao Gao wrote:
>> On Sun, Oct 26, 2025 at 01:18:56PM -0700, Xin Li (Intel) wrote:
>>> From: Xin Li <xin3.li@xxxxxxxxx>
>>>
>>> On a userspace MSR filter change, set FRED MSR intercepts.
>>>
>>> The eight FRED MSRs, MSR_IA32_FRED_RSP[123], MSR_IA32_FRED_STKLVLS,
>>> MSR_IA32_FRED_SSP[123] and MSR_IA32_FRED_CONFIG, are all safe to
>>> passthrough, because each has a corresponding host and guest field
>>> in VMCS.
>>
>> Sean prefers to pass through MSRs only when there is a reason to do that rather
>> than just because it is free. My thinking is that RSPs and SSPs are per-task
>> and are context-switched frequently, so we need to pass through them. But I am
>> not sure if there is a reason for STKLVLS and CONFIG.
>
> There are VMCS fields, at which point intercepting and emulating is probably
> more work than just letting the guest access directly. :-/
>
> Ah, and there needs to be VMCS fields because presumably everything needs to be
> switch atomically, e.g. an NMI that arrives shortly after VM-Exit presumbably
> consumes STKLVLS and CONFIG.

Yes, first it is a correctness issue and I assumed it’s obvious (like we
need a valid IDT/GDT immediately after VM exit).

Anyway, Peter had given a much better write-up and I switched to it.