From: "Jan Beulich" Subject: Re: [PATCH RFC V3 4/5] xen, libxc: Request page fault injection via libxc Date: Fri, 25 Jul 2014 08:50:52 +0100 Message-ID: <53D2287C0200007800025D6B@mail.emea.novell.com> References: <1406118884-16628-1-git-send-email-rcojocaru@bitdefender.com> <1406118884-16628-4-git-send-email-rcojocaru@bitdefender.com> <53D1421F0200007800025A53@mail.emea.novell.com> <53D131E6.6010606@bitdefender.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53D131E6.6010606@bitdefender.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Razvan Cojocaru Cc: kevin.tian@intel.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, eddie.dong@intel.com, xen-devel@lists.xen.org, andres@lagarcavilla.org, jun.nakajima@intel.com, Ian.Jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 24.07.14 at 18:18, wrote: > On 07/24/2014 06:27 PM, Jan Beulich wrote: >>>>> On 23.07.14 at 14:34, wrote: >>> +static void check_pf_injection(void) >>> +{ >>> + struct vcpu *curr = current; >>> + struct domain *d = curr->domain; >>> + struct hvm_hw_cpu ctxt; >>> + struct segment_register seg; >>> + int errcode = PFEC_user_mode; >>> + >>> + if ( !is_hvm_domain(d) >>> + || d->arch.hvm_domain.fault_info.virtual_address == 0 ) >>> + return; >>> + >>> + hvm_funcs.save_cpu_ctxt(curr, &ctxt); >> >> Isn't this a little heavy handed? > > It did seem that way to me too, but I couldn't find another way to get > to ctxt.pending_event and CR3 at this point in the code. Is there an > alternative I'm not aware of? The question was more towards "Wouldn't it be worthwhile introducing a way for you to get at just the information you need?" >>> @@ -1012,6 +1024,7 @@ struct xen_domctl { >>> #define XEN_DOMCTL_gdbsx_pausevcpu 1001 >>> #define XEN_DOMCTL_gdbsx_unpausevcpu 1002 >>> #define XEN_DOMCTL_gdbsx_domstatus 1003 >>> +#define XEN_DOMCTL_set_pagefault_info 1004 >> >> That doesn't look like the range you want to extend. > > Could you please elaborate? Thank you. Since your code is gdbsx unrelated, your addition belongs at the end of the "base" range (currently in the 70s) rather than at the end of the gdbsx one. Jan