Re: [PATCH v3 8/8] KVM: x86: avoid loading PDPTRs after migration when possible

From: Paolo Bonzini
Date: Sat Jun 19 2021 - 03:03:30 EST


On 18/06/21 22:53, Sean Christopherson wrote:
The bool is essentially an extension of
KVM_REQ_GET_NESTED_STATE_PAGES, I think it makes sense to clear the flag whenever
KVM_REQ_GET_NESTED_STATE_PAGES is cleared.

So in vcpu_enter_guest?

Another thing that's not obvious is the required ordering between KVM_SET_SREGS2
and KVM_SET_NESTED_STATE. AFAICT it's not documented, but that may be PEBKAC on
my end. E.g. what happens if walk_mmu == &root_mmu (L1 active in targte KVM)
when SET_SREGS2 is called, and_then_ KVM_SET_NESTED_STATE is called?

Either ordering should work.

Paolo