From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Zhang Haoyu" Subject: RE: [PATCH] KVM: x86: reset RVI upon system reset Date: Fri, 12 Dec 2014 17:56:50 +0800 Message-ID: <201412121756500480610@sangfor.com> References: <1415156023-1349-1-git-send-email-wei.w.wang@intel.com>, <5459C020.20103@intel.com>, <286AC319A985734F985F78AFA26841F77F3FCD@shsmsx102.ccr.corp.intel.com>, <5459DA93.6060104@intel.com>, <286AC319A985734F985F78AFA26841F77F404A@shsmsx102.ccr.corp.intel.com>, <5459E794.6020500@intel.com>, <5459F5AB.1050302@redhat.com>, , <201412111615355608149@sangfor.com>, Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 7bit To: "Zhang, Yang Z" , "Paolo Bonzini" , "Chen, Tiejun" , "Wang, Wei W" , "kvm@vger.kernel.org" Return-path: Received: from smtp.sangfor.com ([202.131.75.66]:45105 "EHLO mail.sangfor.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934514AbaLLJ5I (ORCPT ); Fri, 12 Dec 2014 04:57:08 -0500 Sender: kvm-owner@vger.kernel.org List-ID: On 2014-12-11 19:06:33, Zhang, Yang Z wrote: >Zhang Haoyu wrote on 2014-12-11: >> Then? > >It's already in upstream KVM > Strange, I didn't find this commit in https://git.kernel.org/cgit/virt/kvm/kvm.git/log/ but found it from the repository downloaded by git clone git://git.kernel.org/pub/scm/virt/kvm/kvm.git Thanks, Zhang Haoyu >commit 4114c27d450bef228be9c7b0c40a888e18a3a636 >Author: Wei Wang >Date: Wed Nov 5 10:53:43 2014 +0800 > > KVM: x86: reset RVI upon system reset > > A bug was reported as follows: when running Windows 7 32-bit guests on qemu-kvm, > sometimes the guests run into blue screen during reboot. The problem was that a > guest's RVI was not cleared when it rebooted. This patch has fixed the problem. > > Signed-off-by: Wei Wang > Signed-off-by: Yang Zhang > Tested-by: Rongrong Liu , Da Chun > Signed-off-by: Paolo Bonzini > > >> >>>> On 05/11/2014 10:02, Chen, Tiejun wrote: >>>>>> I think both are ok. >>>>>> If we zero max_irr in vmx_set_rvi(), we still need this check: >>>>>> if ((is_guest_mode(vcpu) && nested_exit_on_intr(vcpu)) || max_irr >>>>>> == >>>>>> -1) >>>>> >>>>> No, I don't think we need to add this. >>>> >>>> You don't, because the code will look like: >>>> >>>> if (is_guest_mode(vcpu) && nested_exit_on_intr(vcpu)) >>>> return; if (!is_guest_mode(vcpu)) { >>>> vmx_set_rvi(max_irr); return; >>>> } >>>> >>>> if (max_irr == -1) >>>> return; >>>> and thus vmx_set_rvi() is never reached if is_guest_mode(vcpu) && >>>> !nested_exit_on_intr(vcpu). >>> >>> I don't think the above code is perfect. Since hwapic_irr_update() is >>> a hot point, >> it's better to move the first check after the second check. In this >> case, Wei's patch looks more reasonable. >>> >>>> >>>> I applied the lapic.c part of Wei's patch, and the vmx.c part of Tiejun's patch. >>>> >>>> Paolo >>> >>> >>> Best regards, > > >Best regards, >Yang