From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] vmx: Allow software (user defined) interrupts to be injected in to the guest Date: Fri, 20 Apr 2012 11:12:47 +0100 Message-ID: References: <4F914060020000780007EC9D@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4F914060020000780007EC9D@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , Aravindh Puthiyaparambil Cc: Eddie Dong , "Nakajima, Jun" , xen-devel List-Id: xen-devel@lists.xenproject.org On 20/04/2012 09:54, "Jan Beulich" wrote: > I doubt this is generally correct, in particular for the use you appear > to desire: When the injection is not the result of an INT nn > instruction (which I would guess to be the case when coming from > libxc), you shouldn't set a non-zero instruction length. I believe this > is also wrong for the INT3 code above. > > Additionally the problem should not be limited to injection coming > from libxc - injection originating from x86_emulate() should be > affected as much. > > Jun, Eddie - I further wonder why #OF is not being handled according > to the documentation here either (should also result in > X86_EVENTTYPE_SW_EXCEPTION). And the fall-through from > TRAP_debug to TRAP_int3 is suspicious too (at the very minimum it > should be annotated with a comment saying why fall-through is > intended here). Nor does the documentation state that TRAP_debug > should ever result in X86_EVENTTYPE_SW_EXCEPTION. > > Finally, the whole injection logic (including the patch here) doesn't > appear to cope with INT nn being used by a guest with nn < 32, nor > with any (pointless) prefixes used on INT3 or INT nn. Agreed, I applied the patch because at least it doesn't mess with any existing logic for vectors < 32, but really this function is now an overloaded mess. vmx_inject_hw_exception() should deal *only* with hw exceptions, and a more general function should be provided for the more general callers. Or something. It needs a bit of thought and is certainly not 4.2 material now. -- Keir