From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [PATCH 10/17] PVH xen: introduce vmx_pvh.c and pvh.c Date: Thu, 2 May 2013 18:03:42 -0700 Message-ID: <20130502180342.2125fc9d@mantra.us.oracle.com> References: <1366752366-16594-1-git-send-email-mukesh.rathor@oracle.com> <1366752366-16594-11-git-send-email-mukesh.rathor@oracle.com> <5177B85B02000078000D03CA@nat28.tlf.novell.com> <20130430175130.7cd4a1e5@mantra.us.oracle.com> <51812C2B0200007800099AF7@nat28.tlf.novell.com> <20130501181028.3d321a8f@mantra.us.oracle.com> <518226E802000078000D26CC@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <518226E802000078000D26CC@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 Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 02 May 2013 07:42:16 +0100 "Jan Beulich" wrote: > >>> On 02.05.13 at 03:10, Mukesh Rathor > >>> wrote: > > On Wed, 01 May 2013 14:52:27 +0100 > > "Jan Beulich" wrote: > >> >> > +static int vmxit_invalid_op(struct cpu_user_regs *regs) > >> >> > +{ > >> >> > + ulong addr = 0; > >> >> > + > >> >> > + if ( guest_kernel_mode(current, regs) || > >> >> > + emulate_forced_invalid_op(regs, &addr) == 0 ) > >> >> > + { > >> >> > + hvm_inject_hw_exception(TRAP_invalid_op, > >> >> > HVM_DELIVER_NO_ERROR_CODE); > >> >> > + return 0; > >> >> > + } > >> >> > + if ( addr ) > >> >> > + hvm_inject_page_fault(0, addr); > >> >> > >> >> This cannot be conditional upon addr being non-zero. > >> > > >> >Why not? rc = emulate_forced_invalid_op(): > >> > >> Because zero can be a valid address that a fault occurred on. > > > > Hmm... for that to happen, the guest would have to cause vmxit > > with invalid op at address 000H. I didn't think that was possible. > > Why would it not. You have to cover all guest kernels, and not > misbehave on malicious ones (i.e. those ought to get an > exception injected if so needed, no matter what address it > occurred on). > > > Alternate would be to add a new return code: EXCRET_inject_pf. > > Something along those lines, yes. Actually, sigh, I realized I missed emulate_privileged_op() and the macro insn_fetch which calls propagate_page_fault for PVH also. So I am thinking of just giving in and writing up a pvh_propagate_page_fault() function that propagate_page_fault() can just call. Then emulate_forced_invalid_op() can remain as is. Mukesh