From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37600 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHuFv-0004Xh-VM for qemu-devel@nongnu.org; Fri, 28 May 2010 03:45:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHuFu-0006rb-Ve for qemu-devel@nongnu.org; Fri, 28 May 2010 03:45:23 -0400 Received: from hera.amn.nl ([213.189.22.5]:4221 helo=AMN.nl) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHuFu-0006r4-QD for qemu-devel@nongnu.org; Fri, 28 May 2010 03:45:22 -0400 Message-ID: <4BFF7485.3000606@cs.vu.nl> Date: Fri, 28 May 2010 09:45:09 +0200 From: Erik van der Kouwe MIME-Version: 1.0 References: <4BFE8F13.2000009@cs.vu.nl> <4BFEBF9E.90600@web.de> <20100528072405.GB3266@amd.com> In-Reply-To: <20100528072405.GB3266@amd.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: SVM emulation: EVENTINJ marked valid when a pagefault happens while issuing a software interrupt List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Roedel, Joerg" Cc: Jan Kiszka , "qemu-devel@nongnu.org" , Gleb Natapov Hi, Thankss for your answer. > SVM always clears the vmcb.eventinj on vmrun because every exception is > injected right after vmrun finished and cpu is in guest mode. It can > happen (for example if taking the exception causes a page fault) that > the vmcb.eventinj field is copied to vmcb.exit_int_info. Yes, this s what I have been experiencing. > In nested-svm you can get a valid exit_int_info when an interrupt or nmi > is pending too. In the software implementation these intercepts are > taken before the event is delivered and you find the event in > vmcb.exit_int_info. > This is not forbidden in the svm architecture and I have not found a > hypervisor that has a problem with this different behavior. I have a > patch here which changes this in nested-svm, but it introduces more > problems than it fixes. This is a ok, the problem is the event_inj field rather than the exit_int_info field. From what I've seen the SVM specification neither specifies that the CPU writes to this field nor does it explicitly forbid it. Given the unclarity of the specification it may safest to deal with this in the same way as the hardware does (although I don't know which way this is, it seems inuitively unlikely that the hardware would set event_inj to valid). With kind regards, Erik