xen-devel.lists.xenproject.org archive mirror
 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 23:04:41 +0200	[thread overview]
Message-ID: <50B91F69.3040506@gmail.com> (raw)
In-Reply-To: <CAGU+autfQNe5V8rZ6z56NXUra2_jcRQmQHwMY454Xk=8dXpV+w@mail.gmail.com>

> Not sure what the difference is between first write operation and
> first write mem_event.

The difference is this: a write operation will only trigger a write
event for a page marked rx. So if we're in single step mode and a write
happens on a page marked rwx, this will not trigger a 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
> 
> Do you mean rx? If you mark a page rw you will not get a write mem_event for it.

Yes, I meant rx. Sorry (it's late where I'm writing from).

> You could track the EIP and GFN and if you single step more than one
> instruction you can mark the page RX and stop single stepping. You
> will get control again on the next write. Though if there are jmp,
> things could get tricky.

So if I understand you correctly, simply single-stepping for only the
duration of one MEM_EVENT_REASON_SINGLESTEP, which should be the write
operation (ignoring the gfn/gla fields of the mem_event), should do the
trick?

Thanks,
Razvan Cojocaru

  reply	other threads:[~2012-11-30 21:04 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
2012-11-30 20:56           ` AP
2012-11-30 21:04             ` Razvan Cojocaru [this message]
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=50B91F69.3040506@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).