WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 2/2] Linux support for hugepages as a Xen PV gues

To: <dcm@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 2/2] Linux support for hugepages as a Xen PV guest
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Fri, 10 Oct 2008 14:38:23 +0100
Cc:
Delivery-date: Fri, 10 Oct 2008 06:38:48 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20081010133005.17293.29340.sendpatchset@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Ackq3XcJtWYXLpbQEd2CjQAWy6hiGQ==
Thread-topic: [PATCH 2/2] Linux support for hugepages as a Xen PV guest
User-agent: Microsoft-Entourage/11.4.0.080122
On 10/10/08 14:30, "dcm@xxxxxxxx" <dcm@xxxxxxxx> wrote:

> This patch adds support to Linux for hugepages as a Xen guest.  It is
> against the linux-2.6.18-xen on xenbits.xensource.com.
> 
> It currently assumes that the guest memory is physically aligned and
> contiguous.  Detection and avoidance of non-aligned memory will be
> available in a future patch.
> 
> Signed-off-by: Dave McCracken <dave.mccracken@xxxxxxxxxx>

hugetlbfs should only be enabled at runtime if supported by the hypervisor.
Perhaps we can enable the PSE CPUID flag if the hypervisor supports
superpages?

> --- 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 = __pgprot(pgprot_val(vma->vm_page_prot) | _PAGE_PRESENT);
> if (writable) {
> entry =
> -      pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
> +      pte_mkwrite(pte_mkdirty(mk_pte(page, pgprot)));
> } else {
> -  entry = pte_wrprotect(mk_pte(page, vma->vm_page_prot));
> +  entry = pte_wrprotect(mk_pte(page, pgprot));
> }
> entry = pte_mkyoung(entry);
> entry = pte_mkhuge(entry);

Why do we need to do something different for Xen here?

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel