Re: [PATCH] KVM: SVM: Use a separate vmcb for the nested L2 guest

From: Paolo Bonzini
Date: Thu Oct 08 2020 - 01:53:01 EST


On 08/10/20 00:14, Maxim Levitsky wrote:
>>
>> + if (svm->vmcb01->control.asid == 0)
>> + svm->vmcb01->control.asid = svm->nested.vmcb02->control.asid;
>
> I think that the above should be done always. The asid field is currently host
> controlled only (that is L2 value is ignored, selective ASID tlb flush is not
> advertized to the guest and lnvlpga is emulated as invlpg).

Yes, in fact I suggested that ASID should be in svm->asid and moved to
svm->vmcb->asid in svm_vcpu_run. Then there's no need to special case
it in nested code.

This should be a patch coming before this one.

>
> 1. Something wrong with memory types - like guest is using UC memory for everything.
> I can't completely rule that out yet

You can print g_pat and see if it is all zeroes.

In general I think it's better to be explicit with vmcb01 vs. vmcb02,
like Cathy did, but I can see it's a matter of personal preference to
some extent.

Paolo