From mboxrd@z Thu Jan 1 00:00:00 1970 From: Razvan Cojocaru Subject: Re: RIP register value in p2m_mem_access_check() Date: Wed, 06 Mar 2013 16:26:29 +0200 Message-ID: <51375215.3040009@gmail.com> References: <5137208F.7000901@gmail.com> <5137335602000078000C3815@nat28.tlf.novell.com> <513729E8.2060007@gmail.com> <5137512C02000078000C394B@nat28.tlf.novell.com> <5137494D.7010901@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5137494D.7010901@gmail.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: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Furthermore (with the fresh install of Xen 4.2.0), when modifying xen-access.c to fetch the registers and print RIP out: 624 case MEM_EVENT_REASON_VIOLATION: 625 { 626 struct hvm_hw_cpu hwcpu; 627 628 if (xc_domain_hvm_getcontext_partial(xch, domain_id, HVM_SAVE_CODE(CPU), 629 req.vcpu_id, &hwcpu, sizeof(hwcpu)) != 0) 630 { 631 ERROR("xc_domain_hvm_getcontext_partial() failed\n"); 632 interrupted = -1; 633 continue; 634 } 635 636 printf("RIP: 0x%016lx\n", hwCpu.rip); 637 fflush(stdout); the RIP it prints out is always the __vmread(GUEST_RIP), not v->arch.user_regs.eip: xen-access output: Got event from Xen RIP: 0x0000000000003272 Got event from Xen PAGE ACCESS: -w- for GFN 25 (offset 0001ba) gla 00000000000251ba (vcpu 0) RIP: 0x000000000000fed9 Got event from Xen PAGE ACCESS: -w- for GFN 0 (offset 00046c) gla 000000000000046c (vcpu 0) RIP: 0x0000000000000643 Got event from Xen PAGE ACCESS: -w- for GFN 9f (offset 000e54) gla 000000000009fe54 (vcpu 0) RIP: 0x0000000000000643 Got event from Xen PAGE ACCESS: -w- for GFN 32 (offset 000042) gla 0000000000032042 (vcpu 0) RIP: 0x000000000000009b Got event from Xen PAGE ACCESS: -w- for GFN 9a (offset 0003d9) gla 000000000009a3d9 (vcpu 0) RIP: 0x0000000000000269 corresponding hypervisor log: (XEN) v->arch.user_regs.eip: 0x0000000000003272, __vmread(GUEST_RIP):0x0000000000003272 (XEN) v->arch.user_regs.eip: 0x0000000000003272, __vmread(GUEST_RIP):0x000000000000fed9 (XEN) v->arch.user_regs.eip: 0x000000000000fed9, __vmread(GUEST_RIP):0x0000000000000643 (XEN) v->arch.user_regs.eip: 0x0000000000000643, __vmread(GUEST_RIP):0x0000000000000643 (XEN) v->arch.user_regs.eip: 0x0000000000000643, __vmread(GUEST_RIP):0x000000000000009b (XEN) v->arch.user_regs.eip: 0x000000000000009b, __vmread(GUEST_RIP):0x0000000000000269 Hope this helps, Razvan Cojocaru