From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: changing attributes of a page! Date: Tue, 10 Jan 2012 09:37:09 +0000 Message-ID: <20120110093709.GA81891@ocelot.phlegethon.org> References: <20120109100956.GE26595@ocelot.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Mohamad Rezaei Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Hi, Please don't top-post. At 14:41 +0330 on 09 Jan (1326120068), Mohamad Rezaei wrote: > I have started Dom0 with dom0_shadow=1. So it must be running with a > read-only page table. I thought p2m is responsible for updating the > dom0's page-table. PV guests don't have p2m in the hypervisor -- they take care of their own p2m translations and make pagetables that already point to machihe addresses. > I have looked at _sh_propagate() but I couldn't > find any option to change page attributes like RWX. Look again. :) That function makes the PTE that the hardware will see. So all you need to do is mask _PAGE_RW out of the sflags when you see an l1 entry where target_mfn is one of the MFNs you're protecting. Look at how log-dirty is handled, for example. Of course, once you've done that, you also need to handle the pagefaults that will happen if the guest writes to that memory! Tim.