Re: [PATCH v3 04/10] KVM: nVMX: Switch to vmcs01 to update PML controls on-demand if L2 is active
From: Chao Gao
Date: Wed Dec 24 2025 - 02:54:05 EST
On Fri, Dec 05, 2025 at 03:19:07PM -0800, Sean Christopherson wrote:
>If KVM toggles "CPU dirty logging", a.k.a. Page-Modification Logging (PML),
>while L2 is active, temporarily load vmcs01 and immediately update the
>relevant controls instead of deferring the update until the next nested
>VM-Exit. For PML, deferring the update is relatively straightforward, but
>for several APICv related updates, deferring updates creates ordering and
>state consistency problems, e.g. KVM at-large thinks APICv is enabled, but
>vmcs01 is still running with stale (and effectively unknown) state.
>
>Convert PML first precisely because it's the simplest case to handle: if
>something is broken with the vmcs01 <=> vmcs02 dance, then hopefully bugs
>will bisect here.
>
>Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Reviewed-by: Chao Gao <chao.gao@xxxxxxxxx>