From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Herongguang (Stephen)" Subject: Re: [PATCH] KVM: x86: handle KVM_SET_VCPU_EVENTS/KVM_VCPUEVENT_VALID_SMM properly Date: Sat, 8 Oct 2016 11:31:59 +0800 Message-ID: <57F868AF.7030806@huawei.com> References: <1474606751-17100-1-git-send-email-herongguang.he@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Cc: , , , , To: , , Return-path: Received: from szxga01-in.huawei.com ([58.251.152.64]:65357 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752065AbcJHDc6 (ORCPT ); Fri, 7 Oct 2016 23:32:58 -0400 In-Reply-To: <1474606751-17100-1-git-send-email-herongguang.he@huawei.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2016/9/23 12:59, herongguang wrote: > From: He Rongguang > > handle KVM_VCPUEVENT_VALID_SMM properly, or kvm-kmod/kernel will crash > in migration destination in gfn_to_rmap() since kvm_memslots_for_spte_role > is false, whilst (vcpu->arch.hflags & HF_SMM_MASK) is true > > Signed-off-by: herongguang > --- > arch/x86/kvm/x86.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 699f872..7ebcb59 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -3028,6 +3028,7 @@ static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu, > else > clear_bit(KVM_APIC_INIT, &vcpu->arch.apic->pending_events); > } > + kvm_mmu_reset_context(vcpu); > } > > kvm_make_request(KVM_REQ_EVENT, vcpu); > Hi, do you think this is OK for linux 4.9? From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsiNs-0007B6-Am for qemu-devel@nongnu.org; Fri, 07 Oct 2016 23:33:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsiNp-0002Um-5N for qemu-devel@nongnu.org; Fri, 07 Oct 2016 23:33:12 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:3215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsiNo-0002O7-EG for qemu-devel@nongnu.org; Fri, 07 Oct 2016 23:33:09 -0400 References: <1474606751-17100-1-git-send-email-herongguang.he@huawei.com> From: "Herongguang (Stephen)" Message-ID: <57F868AF.7030806@huawei.com> Date: Sat, 8 Oct 2016 11:31:59 +0800 MIME-Version: 1.0 In-Reply-To: <1474606751-17100-1-git-send-email-herongguang.he@huawei.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] KVM: x86: handle KVM_SET_VCPU_EVENTS/KVM_VCPUEVENT_VALID_SMM properly List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: pbonzini@redhat.com, rkrcmar@redhat.com, kvm@vger.kernel.org Cc: quintela@redhat.com, amit.shah@redhat.com, qemu-devel@nongnu.org, arei.gonglei@huawei.com, weidong.huang@huawei.com On 2016/9/23 12:59, herongguang wrote: > From: He Rongguang > > handle KVM_VCPUEVENT_VALID_SMM properly, or kvm-kmod/kernel will crash > in migration destination in gfn_to_rmap() since kvm_memslots_for_spte_role > is false, whilst (vcpu->arch.hflags & HF_SMM_MASK) is true > > Signed-off-by: herongguang > --- > arch/x86/kvm/x86.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 699f872..7ebcb59 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -3028,6 +3028,7 @@ static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu, > else > clear_bit(KVM_APIC_INIT, &vcpu->arch.apic->pending_events); > } > + kvm_mmu_reset_context(vcpu); > } > > kvm_make_request(KVM_REQ_EVENT, vcpu); > Hi, do you think this is OK for linux 4.9?