From mboxrd@z Thu Jan 1 00:00:00 1970 From: Razvan Cojocaru Subject: EIP, xc_domain_hvm_getcontext_partial() and page fault events Date: Tue, 05 Mar 2013 16:30:18 +0200 Message-ID: <5136017A.50004@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, I'm using page fault mem_events from dom0 userspace. When I receive one such mem_event, I'm retrieving register values for the VCPU that has caused it, using xc_domain_hvm_getcontext_partial(). At the same time, I'm printing out v->arch.user_regs.eip from p2m_mem_access_check() in arch/x86/mm/p2m.c, and I'm noticing that the EIP value I'm getting from xc_domain_hvm_getcontext_partial() is less than the EIP value stored in v->arch.user_regs.eip. This, I assume, can be explained by the fact that in p2m_mem_access_check() EIP points to the instruction _after_ the instruction that caused the page fault, and it's being rewound by the time I query it from dom0 userspace. Now, what I am after is a way to get the "proper", rewound, EIP (and the rest of the registers from when EIP was _before_ the fault instruction) in p2m_mem_access_check(). Is there a way to achieve this? Thanks, Razvan Cojocaru