From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH 2/2] Linux support for hugepages as a Xen PVguest Date: Fri, 10 Oct 2008 16:35:23 +0100 Message-ID: <48EF925B.76E4.0078.0@novell.com> References: <200810101006.44389.dcm@mccr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <200810101006.44389.dcm@mccr.org> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Dave McCracken Cc: xen-devel@lists.xensource.com, Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> Dave McCracken 10.10.08 17:06 >>> >> > --- linux-2.6.18-xen//./mm/hugetlb.c 2008-07-17 09:54:19.000000000 = -0500 >> > +++ linux-hpage/./mm/hugetlb.c 2008-10-02 15:07:54.000000000 -0500 >> > @@ -294,12 +294,14 @@ static pte_t make_huge_pte(struct vm_are >> > int writable) >> > { >> > pte_t entry; >> > + pgprot_t pgprot; >> > >> > + pgprot =3D __pgprot(pgprot_val(vma->vm_page_prot) | _PAGE_PRESENT); >> > if (writable) { >> > entry =3D >> > - pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot))); >> > + pte_mkwrite(pte_mkdirty(mk_pte(page, pgprot))); >> > } else { >> > - entry =3D pte_wrprotect(mk_pte(page, vma->vm_page_prot)); >> > + entry =3D pte_wrprotect(mk_pte(page, pgprot)); >> > } >> > entry =3D pte_mkyoung(entry); >> > entry =3D pte_mkhuge(entry); >> >> Why do we need to do something different for Xen here? > >In the original implementation _PAGE_PRESENT is set in later macros. = Xen=20 >needs it early to trigger the proper phys_to_machine() translation. That should then better be taken care of in the place where _PAGE_PRESENT gets actually set. Also, doesn't vma->vm_page_prot already properly reflect the intended setting of _PAGE_PRESENT? Jan