Re: [PATCH 5/8] KVM: nSVM: implement ondemand allocation of the nested state

2020-08-20 Thread Paolo Bonzini
On 20/08/20 11:13, Maxim Levitsky wrote: > @@ -3912,6 +3914,14 @@ static int svm_pre_leave_smm(struct kvm_vcpu *vcpu, > const char *smstate) > vmcb_gpa = GET_SMSTATE(u64, smstate, 0x7ee0); > > if (guest) { > + /* > + * This can happen if SVM was not enabled p

Re: [PATCH 5/8] KVM: nSVM: implement ondemand allocation of the nested state

2020-08-20 Thread Maxim Levitsky
On Thu, 2020-08-20 at 11:58 +0200, Paolo Bonzini wrote: > On 20/08/20 11:13, Maxim Levitsky wrote: > > @@ -3912,6 +3914,14 @@ static int svm_pre_leave_smm(struct kvm_vcpu *vcpu, > > const char *smstate) > > vmcb_gpa = GET_SMSTATE(u64, smstate, 0x7ee0); > > > > if (guest) { > > +

[PATCH 5/8] KVM: nSVM: implement ondemand allocation of the nested state

2020-08-20 Thread Maxim Levitsky
This way we don't waste memory on VMs which don't enable nesting virtualization Signed-off-by: Maxim Levitsky --- arch/x86/kvm/svm/nested.c | 43 +++ arch/x86/kvm/svm/svm.c| 62 +++ arch/x86/kvm/svm/svm.h| 6 3 files chang