xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Tim Deegan <tim@xen.org>
To: lmingcsce <lmingcsce@gmail.com>
Cc: xen-devel@lists.xen.org
Subject: Re: About revoke write access of all the shadows
Date: Tue, 7 Aug 2012 10:40:42 +0100	[thread overview]
Message-ID: <20120807094042.GA84051@ocelot.phlegethon.org> (raw)
In-Reply-To: <033B5345-93F0-412C-822A-5F952694BD30@gmail.com>

At 09:35 -0400 on 04 Aug (1344072926), lmingcsce wrote:
> From shadow_blow_tables function of the log dirty mode mechanism, I
> find it uses this way. However, through debugging
> foreach_pinned_shadow(d, sp, t), I find that all the pages I get are
> L2_pae_shadow or L2h_page_shadow, there is no L1 page type.
> Can you help explain why this happen?

shadow_blow_tables() only touches the topmost tables (i.e. on PAE, L2,
and on 64-bit, L4).  What it does is drop the reference count on the
tables (or clear their entries), and lets the reference-counting
mechanism take care of clearing and freeing the lower-level tables that
they point to.

> If so, how can I get all the L1 page type of one domain? What I want
> to do is to set all the shadow tables as read only.

To get at all the L1 entries, you should use hash_foreach(), with a 
mask and callbacks that contain all the L1 types.  You can copy that
from sh_remove_write_access() or sh_remove_all_mappings(), but you'll
need to make a new callback function (in multi.c) to handle each L1
page.

Cheers,

Tim.

      reply	other threads:[~2012-08-07  9:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-26 20:18 About revoke write access of all the shadows lmingcsce
2012-08-02 10:47 ` Tim Deegan
2012-08-04 13:35   ` lmingcsce
2012-08-07  9:40     ` Tim Deegan [this message]

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=20120807094042.GA84051@ocelot.phlegethon.org \
    --to=tim@xen.org \
    --cc=lmingcsce@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).