From: "Jan Beulich" Subject: Re: RIP register value in p2m_mem_access_check() Date: Wed, 06 Mar 2013 13:22:36 +0000 Message-ID: <5137512C02000078000C394B@nat28.tlf.novell.com> References: <5137208F.7000901@gmail.com> <5137335602000078000C3815@nat28.tlf.novell.com> <513729E8.2060007@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <513729E8.2060007@gmail.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: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org >>> On 06.03.13 at 12:35, Razvan Cojocaru wrote: >> v->arch.user_regs.eip is what you should look at. It's >> expected to be in sync with the VMCS value as long as >> nothing (e.g. emulation) modified the value. There's code in >> vmx_asm_vmexit_handler to sync the fields, and in >> vmx_asm_do_vmentry to sync them back in the opposite >> direction. > > Thank you for your answer. Isn't it possible that emulation is indeed > involved, since in p2m_mem_access_check() a page fault has occured, and > RIP might point to _after_ the offending instruction? 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. And finally, you said you took this right after a page fault occurred, and - just like for any fault - the RIP the fault refers to is the faulting instruction, not the one following it. Jan