From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: About revoke write access of all the shadows Date: Tue, 7 Aug 2012 10:40:42 +0100 Message-ID: <20120807094042.GA84051@ocelot.phlegethon.org> References: <7E3078CC-DDFB-49C4-98A9-CC14395A41ED@gmail.com> <20120802104741.GB11437@ocelot.phlegethon.org> <033B5345-93F0-412C-822A-5F952694BD30@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <033B5345-93F0-412C-822A-5F952694BD30@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: lmingcsce Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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.