All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rzvncj@gmail.com>
To: xen-devel@lists.xen.org
Subject: Re: Mem_event API and MEM_EVENT_REASON_SINGLESTEP
Date: Thu, 29 Nov 2012 18:20:27 +0200	[thread overview]
Message-ID: <50B78B4B.2050106@gmail.com> (raw)
In-Reply-To: <20121129155831.GE80627@ocelot.phlegethon.org>

Hello, thank you for the quick reply!
> That might work for single-vcpu guests.  On multi-vcpu, you'd have to
> pause the whole VM, unprotect the page, single-step the one vcpu that
> trapped, re-protect the page, and unpause the VM.  That might be
> unacceptably slow.

Ah, the simple fact that the words "unacceptably slow" could be employed 
to describe the situation makes this approach very unlikely to fit my 
purposes.

I'm still interested in how the debugger API works, though. Maybe, just 
maybe, it'll just be acceptably slow. :)

> You could try:
>   - pause the domain
>   - copy out the contents of the page
>   - use XENMEM_decrease_reservation to remove the page from the guest
>   - unpause the domain
>
> Then all accesses to that page will get emulated by Xen and forwarded to
> qemu, just like happens for emulated MMIO devices.  In qemu, you can
> emulate the read or write access, and do anything else you like at the
> same time.
>
> That won't work for memory that's accessed in non-trivial ways
> (e.g. used for pagetables or descriptor tables) or using instructions
> that are unsupported/buggy in Xen's instruction emulator.

Well, I need it to be able to work on _all_ memory, however accessed. 
Also, with this approach I might have to copy out the contents of all of 
the domain's pages in the worst case scenario - isn't that something to 
avoid?

Thanks,
Razvan Cojocaru

  reply	other threads:[~2012-11-29 16:20 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
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 [this message]
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=50B78B4B.2050106@gmail.com \
    --to=rzvncj@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.