From mboxrd@z Thu Jan 1 00:00:00 1970 From: Razvan Cojocaru Subject: RIP register value in p2m_mem_access_check() Date: Wed, 06 Mar 2013 12:55:11 +0200 Message-ID: <5137208F.7000901@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Hello again, simple test case: added the following statement in xen/arch/x86/mm/p2m.c, in function p2m_mem_access_check(): printk("v->arch.user_regs.eip: 0x%016lx, __vmread(GUEST_RIP): 0x%016lx\n", v->arch.user_regs.eip, __vmread(GUEST_RIP)); (where v is current) which dutifully prints out (at the first page fault): (XEN) v->arch.user_regs.eip: 0xfffff80002c13a7b, __vmread(GUEST_RIP): 0xfffff8000269ec0a They're not equal, and furthermore __vmread(GUEST_RIP) is the correct one (the same value returned by xc_domain_hvm_getcontext_partial()). The questions: 1. What's the Xen-friendliest way to retrieve the _correct_ values for RIP and all the other registers usually put in a struct hvm_hw_cpu instance, in p2m_mem_access_check()? 2. What's the explanation for why things run as they do now? Thanks, Razvan Cojocaru