From: Tim Deegan Subject: Re: RIP register value in p2m_mem_access_check() Date: Thu, 7 Mar 2013 16:49:28 +0000 Message-ID: <20130307164928.GF30110@ocelot.phlegethon.org> References: <5137208F.7000901@gmail.com> <5137335602000078000C3815@nat28.tlf.novell.com> <513729E8.2060007@gmail.com> <5137512C02000078000C394B@nat28.tlf.novell.com> <5137494D.7010901@gmail.com> <513761AF02000078000C39F0@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <513761AF02000078000C39F0@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: Razvan Cojocaru , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org At 14:33 +0000 on 06 Mar (1362580383), Jan Beulich wrote: > >>> On 06.03.13 at 14:49, Razvan Cojocaru wrote: > >> That wouldn't match your observation (the two values were > >> much farther apart), unless a call or jump got emulated. > >> > >> Further, after emulation, the user_regs.eip value should be the > >> canonical one. > > > > Well, I've downloaded and installed a fresh copy of Xen 4.2.0 from the > > official website, and added the printk() to p2m.c (the only modification > > I've done): > > > > 1311 req->vcpu_id = v->vcpu_id; > > 1312 > > 1313 printk("v->arch.user_regs.eip: 0x%016lx, > > __vmread(GUEST_RIP):0x%016lx\n", > > 1314 v->arch.user_regs.eip, __vmread(GUEST_RIP)); > > 1315 } > > I know close to nothing about the paths that can lead here, and > hence I can't assess whether expecting consistency at this point > is valid. All I can tell is that right after VM exit (i.e. at the top of > vmx_vmexit_handler()) the two values ought to be consistent. I don't think so -- v->arch.user_regs is only brought up to date during context switches. For the currently running vcpu you should be looking at guest_cpu_user_regs(). Cheers, Tim.