Re: [PATCH] KVM: nSVM: prepare guest save area while is_guest_mode is true

2021-02-22 Thread Vitaly Kuznetsov
Paolo Bonzini writes: > Right now, enter_svm_guest_mode is calling nested_prepare_vmcb_save and > nested_prepare_vmcb_control. This results in is_guest_mode being false > until the end of nested_prepare_vmcb_control. > > This is a problem because nested_prepare_vmcb_save can in turn cause > chan

Re: [PATCH] KVM: nSVM: prepare guest save area while is_guest_mode is true

2021-02-18 Thread Paolo Bonzini
On 18/02/21 19:12, Sean Christopherson wrote: Yeah, the problem is I don't understand why 06fc7772690d fixed things in 11 year old KVM instead of breaking them, because effectively this patch is reverting it. 11 year old KVM didn't grab a different VMCB when updating the intercepts, it had alre

Re: [PATCH] KVM: nSVM: prepare guest save area while is_guest_mode is true

2021-02-18 Thread Sean Christopherson
On Thu, Feb 18, 2021, Paolo Bonzini wrote: > On 18/02/21 18:42, Sean Christopherson wrote: > > > The bug is present since commit 06fc7772690d ("KVM: SVM: Activate nested > > > state only when guest state is complete", 2010-04-25). Unfortunately, > > > it is not clear from the commit message what i

Re: [PATCH] KVM: nSVM: prepare guest save area while is_guest_mode is true

2021-02-18 Thread Paolo Bonzini
On 18/02/21 18:42, Sean Christopherson wrote: The bug is present since commit 06fc7772690d ("KVM: SVM: Activate nested state only when guest state is complete", 2010-04-25). Unfortunately, it is not clear from the commit message what issue exactly led to the change back then. It was probably re

Re: [PATCH] KVM: nSVM: prepare guest save area while is_guest_mode is true

2021-02-18 Thread Sean Christopherson
On Thu, Feb 18, 2021, Paolo Bonzini wrote: > Right now, enter_svm_guest_mode is calling nested_prepare_vmcb_save and > nested_prepare_vmcb_control. This results in is_guest_mode being false > until the end of nested_prepare_vmcb_control. > > This is a problem because nested_prepare_vmcb_save can

[PATCH] KVM: nSVM: prepare guest save area while is_guest_mode is true

2021-02-18 Thread Paolo Bonzini
Right now, enter_svm_guest_mode is calling nested_prepare_vmcb_save and nested_prepare_vmcb_control. This results in is_guest_mode being false until the end of nested_prepare_vmcb_control. This is a problem because nested_prepare_vmcb_save can in turn cause changes to the intercepts and these hav