From: Ian Campbell Subject: Re: [PATCH v4 8/9] xen/arm: Implement hypercall for dirty page tracing Date: Wed, 16 Oct 2013 14:44:08 +0100 Message-ID: <1381931048.27643.30.camel@kazak.uk.xensource.com> References: <25269810.259001381213751804.JavaMail.weblogic@epml25> <1381221960.9920.4.camel@kazak.uk.xensource.com> <007301cec40b$4a9fbcf0$dfdf36d0$%yoo@samsung.com> <5254268A.4010403@samsung.com> <5256B604.8070706@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5256B604.8070706@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: Eugene Fedotov , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2013-10-10 at 15:13 +0100, Julien Grall wrote: > On 10/08/2013 04:36 PM, Eugene Fedotov wrote: > > If we move necessary checking into handle_page_fault routine, so the > > resulting patch for traps.c will look more simple: > > > > --- a/xen/arch/arm/traps.c > > +++ b/xen/arch/arm/traps.c > > @@ -1313,6 +1313,8 @@ static void do_trap_data_abort_guest(struct > > cpu_user_regs *regs, > > const char *msg; > > int rc, level = -1; > > mmio_info_t info; > > + int page_fault = ( (dabt.dfsc & FSC_MASK) == > > + (FSC_FLT_PERM | FSC_3D_LEVEL) && dabt.write ); > > > > if ( !check_conditional_instr(regs, hsr) ) > > { > > @@ -1334,6 +1336,13 @@ static void do_trap_data_abort_guest(struct > > cpu_user_regs *regs, > > if ( rc == -EFAULT ) > > goto bad_data_abort; > > > > + /* domU page fault handling for guest live migration */ > > + /* dabt.valid can be 0 here */ > > + if ( page_fault && handle_page_fault(current->domain, info.gpa) ) > > + { > > + /* Do not modify pc after page fault to repeat memory operation */ > > + return; > > + } > > /* XXX: Decode the instruction if ISS is not valid */ > > if ( !dabt.valid ) > > goto bad_data_abort; > > > > Will it be acceptable, or you think "else" statement looks more better? > > I'm fine with this solution. Looks good to me too, assuming you are happy with the ordering of MMIO handling vs page faults. > > Cheers, >