All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rzvncj@gmail.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: RIP register value in p2m_mem_access_check()
Date: Wed, 06 Mar 2013 16:26:29 +0200	[thread overview]
Message-ID: <51375215.3040009@gmail.com> (raw)
In-Reply-To: <5137494D.7010901@gmail.com>

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

  reply	other threads:[~2013-03-06 14:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-06 10:55 RIP register value in p2m_mem_access_check() Razvan Cojocaru
2013-03-06 11:15 ` Jan Beulich
2013-03-06 11:35   ` Razvan Cojocaru
2013-03-06 13:22     ` Jan Beulich
2013-03-06 13:25       ` Razvan Cojocaru
2013-03-06 13:49       ` Razvan Cojocaru
2013-03-06 14:26         ` Razvan Cojocaru [this message]
2013-03-06 14:33         ` Jan Beulich
2013-03-06 14:47           ` Razvan Cojocaru
2013-03-07 16:49           ` Tim Deegan
2013-03-07 17:04             ` Jan Beulich
2013-03-07 17:31             ` Razvan Cojocaru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51375215.3040009@gmail.com \
    --to=rzvncj@gmail.com \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.