All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rzvncj@gmail.com>
To: AP <apxeng@gmail.com>
Cc: jepstein98@gmail.com,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: Mem_event API and MEM_EVENT_REASON_SINGLESTEP
Date: Fri, 30 Nov 2012 22:45:20 +0200	[thread overview]
Message-ID: <50B91AE0.1040206@gmail.com> (raw)
In-Reply-To: <CAGU+ausjwgy+NO4RynjrdXyyPrHO6_MqrwXpqYHAOXrr0vmzrg@mail.gmail.com>

>> I do see single step mem_events after. I've tried it on a SMP HVM
>> Slackware guest. What behaviour am I observing? The gla and gfn values
>> are being printed out - but I don't know how to detect a write operation
>> based on them. Tim Deegan has kindly suggested that I pass those values
> 
> You will not be able to detect a write event based on them as you have
> marked the page rwx. One option is to mark the page rx and continue
> single stepping the page. The on the next write to that page should
> give you a write violation and there you can stop single stepping the
> page.

I'm not trying to detect a write event - the write event has already
been detected: before the "case MEM_EVENT_REASON_VIOLATION" part of the
code, I've put "xc_hvm_set_mem_access(xch, domain_id, default_access, 0,
xenaccess->domain_info->max_pages);". Default_access, in the
xen-access.c file, is rx, and after_first_access is rwx.

What I am trying to do is catch the first write operation (that's why
I'm single stepping), not the first write mem_event.

My scenario is this: I'd like to mark _all_ of the domain's pages rw,
then when I get a write mem_event, mark only one page rwx, allow that
write (single stepping), then mark that one page rw again. This would
allow me to catch more than one write per unique domain page, as
xen-access.c does. Xen-access.c does not catch subsequent writes to a
page once it received a write mem_event about it.

Thanks,
Razvan Cojocaru

  reply	other threads:[~2012-11-30 20:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-29 14:38 Mem_event API and MEM_EVENT_REASON_SINGLESTEP Razvan Cojocaru
2012-11-29 15:18 ` Razvan Cojocaru
2012-11-30 19:50   ` AP
2012-11-30 20:09     ` Razvan Cojocaru
2012-11-30 20:24       ` AP
2012-11-30 20:45         ` Razvan Cojocaru [this message]
2012-11-30 20:56           ` AP
2012-11-30 21:04             ` Razvan Cojocaru
2012-11-30 21:17               ` AP
2012-12-04  7:23                 ` Razvan Cojocaru
2012-11-30 21:07       ` Tim Deegan
2012-11-30 21:14         ` Razvan Cojocaru
2012-11-29 15:58 ` Tim Deegan
2012-11-29 16:20   ` Razvan Cojocaru
2012-11-29 18:05     ` Tim Deegan

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=50B91AE0.1040206@gmail.com \
    --to=rzvncj@gmail.com \
    --cc=apxeng@gmail.com \
    --cc=jepstein98@gmail.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.