From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mick Jordan Subject: Re: 2MB page PV guest support clarification Date: Fri, 27 Feb 2009 17:37:14 -0800 Message-ID: <49A8954A.7080402@Sun.COM> References: <49A870E6.8050300@Sun.COM> <49A8770F.6070806@goop.org> <4FA716B1526C7C4DB0375C6DADBC4EA34172695B6F@LONPMAILBOX01.citrite.net> <49A88883.8090106@Sun.COM> <4FA716B1526C7C4DB0375C6DADBC4EA34172695B72@LONPMAILBOX01.citrite.net> Reply-To: Mick.Jordan@sun.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0857972967==" Return-path: In-reply-to: <4FA716B1526C7C4DB0375C6DADBC4EA34172695B72@LONPMAILBOX01.citrite.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Pratt Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --===============0857972967== Content-type: multipart/alternative; boundary="Boundary_(ID_x2FITbfsxmsPsXnGtCzF0g)" This is a multi-part message in MIME format. --Boundary_(ID_x2FITbfsxmsPsXnGtCzF0g) Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT On 02/27/09 17:28, Ian Pratt wrote: >> You remark about aliasing prompts me to ask a general question about >> that. I am currently mapping physical to virtual 1-1 (because that is >> what minis-os has always done) as well as mapping parts of that to >> other areas in virtual memory. Both of these are RW mappings. Is that >> ok? It perfectly possible for me to unmap the 1-1 mappings or make them >> RO if I have to. >> > > Any page that is part of a pagetable must be mapped RO in every mapping to it. Attempting to add a page that has RW mappings to a pagetable will fail (either when you make the hypercall to add the PTE, or when you pin a constructed pagetable or try switching to it). > > > Thus, you need to be careful with 1:1 maps to remove pages that may become PT pages. It's best to have a PT page allocator that tries to allocate PT's from contiguous regions and then recycles them. > > Ok. I need to check this. Certainly I am at some point taking already mapped pages and using them as pagetables. However, I am not getting any errors when adding the PTE. So perhaps the code does the mapping change already. Mick --Boundary_(ID_x2FITbfsxmsPsXnGtCzF0g) Content-type: text/html; charset=ISO-8859-1 Content-transfer-encoding: 7BIT On 02/27/09 17:28, Ian Pratt wrote:
You remark about aliasing prompts me to ask a general question about
that. I am currently mapping physical to virtual 1-1 (because that is
what minis-os has always done) as well as mapping parts of that to
other areas in virtual memory. Both of these are RW mappings. Is that
ok? It perfectly possible for me to unmap the 1-1 mappings or make them
RO if I have to.
    

Any page that is part of a pagetable must be mapped RO in every mapping to it. Attempting to add a page that has RW mappings to a pagetable will fail (either when you make the hypercall to add the PTE, or when you pin a constructed pagetable or try switching to it).

  
Thus, you need to be careful with 1:1 maps to remove pages that may become PT pages. It's best to have a PT page allocator that tries to allocate PT's from contiguous regions and then recycles them.

  
Ok. I need to check this. Certainly I am at some point taking already mapped pages and using them as pagetables. However, I am not getting any errors when adding the PTE. So perhaps the code does the mapping change already.

Mick

--Boundary_(ID_x2FITbfsxmsPsXnGtCzF0g)-- --===============0857972967== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0857972967==--