Re: [PATCH 20/22] KVM: SVM: enable GMET and set it in MMU role
From: Nikunj A. Dadhania
Date: Wed Mar 25 2026 - 05:45:50 EST
On 3/25/2026 2:59 PM, Paolo Bonzini wrote:
> On Wed, Mar 25, 2026 at 10:26 AM Nikunj A. Dadhania <nikunj@xxxxxxx> wrote:
>>
>>
>>
>> On 3/21/2026 5:39 AM, Paolo Bonzini wrote:
>>> @@ -1184,6 +1187,10 @@ static void init_vmcb(struct kvm_vcpu *vcpu)
>>> save->g_pat = vcpu->arch.pat;
>>> save->cr3 = 0;
>>> }
>>> +
>>> + if (gmet_enabled)
>>
>> if (gmet_enabled && guest_cpu_cap_has(vcpu, X86_FEATURE_GMET))
>
> No, this is the non-nested case (vmcb01) and I'm enabling GMET on
> purpose for easier testing.
Win11 guest with memory isolation stops booting after this patch. Boots if I pass gmet=0.
>
> guest_cpu_cap_has(GMET) only matters for nested guests and is added by patch 22:
>
> vmcb02->control.nested_ctl &= ~SVM_NESTED_CTL_GMET_ENABLE;
> if (guest_cpu_cap_has(vcpu, X86_FEATURE_GMET))
> vmcb02->control.nested_ctl |=
> (svm->nested.ctl.nested_ctl & SVM_NESTED_CTL_GMET_ENABLE);
Right, I noticed that.
Regards
Nikunj