Re: [PATCH v10 00/28] KVM: Enable FRED support with KVM VMX

From: Sohil Mehta

Date: Wed Nov 18 2026 - 05:01:53 EST


On 10/30/2026 1:53 PM, Chang S. Bae wrote:
> On 9/11/2026 2:36 PM, Sohil Mehta wrote:
>>
>> Patch structure
>> ---------------
>
> So I'm more interested in how those pieces could be organized to make
> easier to follow, review, and integrate going forward.

Thanks! This is good feedback. I've been thinking about splitting and
making this easier to review as well.

>
>> Patches   1-6: Enable the VMX controls and export the host stacks
>
> These seem to be preparatory changes for supporting the state and
> extending event delivery later in this series.
>
> Would it make sense to put the x86 core preparation up front rather than
> having it in the middle of the KVM changes?
>

Sure, I can move the x86 preparatory changes to the front of the series.

Actually, some of the x86 patches are good cleanups independent of the
FRED KVM support. I am thinking of posting them separately and maybe
those can be merged sooner to reduce the load on this series.

As you suggested below, it would be great if we can separate out the
nested VMX support as well. But there are issues (like the one discussed
in patch 19) that link the L1 guest support with the nested support.

I believe if we separate out the secondary VM-exit controls
infrastructure (L1 and nested - independent of FRED) then it will get
rid of the dependency.

Here's the rough structure I am working towards:

Part 1) Core x86 prep (3 patches)
Part 2) Secondary VM-exit control infra (3-4 patches)
Part 3) FRED guest support (16–18 patches)
Part 4) Nested FRED support (5-7 patches)

Parts 1 and 2 are independent of each other and can be posted and
reviewed in parallel. The selftests can be posted with the relevant
parts if appropriate.

>> Patches  7-19: Virtualize the FRED context and advertise it to userspace
>
> I think there are a few sub-groups here:
>  (1) patch07-10: Support FRED state context switching
>  (2) patch11-14: Extend event delivery
>  (3) patch15-17: Handle CR4
>  (4) patch18-19: Advertise the feature, etc.
>


> At glance, (2) looks a little difficult to follow. Patch 13/14 in
> particular appear to mix the FRED support itself with some preparatory
> changes. IIUC, the code is saying everything outside of the
> is_fred_enabled() path has no functional change.
>

Sure, I'll try to incorporate this.

> Perhaps, the changes outside of is_fred_enabled() could be separated
> out. That would make the actual is_fred_enabled() path easier to follow.
> Also, the part introduces the ABI immediately after adding
> is_fred_enabled(), before showing up the callsite of is_fred_enabled().
> This flow is a bit abrupt.
>

Yes, I have identified a couple of simplifications to make the flow easier.

> For example, extending kvm_requeue_exception() alone could be one step.
> The next step could add the code under is_fred_enabled(), initially with
> is_fred_enabled() as a placeholder that simply returns false. I think
> that would better highlight which parts are actually FRED-specific and
> why this dynamic check is needed.
>

I am not sure if the is_fred_enabled() false placeholder would buy us
anything. is_fred_enabled() is expected to be false until the feature is
advertised to guest. But I get the gist - Separating the non
FRED-specific parts would make it easier to follow the FRED-specific ones.

>> Patches 20-25: Extend FRED virtualization to nested VMX
>
> Since nVMX support comes after exposing the feature, does that also mean
> the series could be partitioned into two parts, one up through the
> advertisement (and tests) and another for nVMX support? Splitting up a
> complex series like this may make review and integration easier going
> forward.
>

Yes, I am working towards making this possible.

> Thanks,
> Chang