From: lmingcsce Subject: About revoke write access of all the shadows Date: Thu, 26 Jul 2012 16:18:38 -0400 Message-ID: <7E3078CC-DDFB-49C4-98A9-CC14395A41ED@gmail.com> Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Hi all, Recently, I read codes about the shadow page table. I'm wondering whether the kernel has provided the function to revoke write access of all the shadows of one domain. If you know one with this function, please tell me about it. Thanks. BTW, I have my own idea to implement this. My idea is as follows: void sh_revoke_write_access_all(struct domain *d) { foreach_pinned_shadow(d, sp, t) { According to sp->u.sh.type, (like SH_type_l1_32_shadow ......), get each entry (shadow_l1e_get_flags) of the page table. Changes the flags to read only and then write the page table entry back (shadow_set_l1e). When going through the page table, I can use SHADOW_FOREACH_L1E (L2E, L3E, L4E) macro. However, I have one question. When dealing with shadow page table L2, L3, L4, can I use the same way as L1 page table to change flags and set flags ? } } Do you think my idea is possible? Thanks for giving me some suggestions. Best, Ming