Displaying 6 results from an estimated 6 matches for "clearpagepde".
2007 Apr 18
1
[PATCH 1/5] Add pagetable allocation notifiers
...if (PTRS_PER_PMD == 1) {
 		memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
+		SetPagePDE(virt_to_page(pgd));
 		spin_lock_irqsave(&pgd_lock, flags);
 	}
 
@@ -227,6 +228,7 @@ void pgd_dtor(void *pgd, kmem_cache_t *c
 {
 	unsigned long flags; /* can be called from interrupt context */
 
+	ClearPagePDE(virt_to_page(pgd));
 	spin_lock_irqsave(&pgd_lock, flags);
 	pgd_list_del(pgd);
 	spin_unlock_irqrestore(&pgd_lock, flags);
@@ -244,13 +246,16 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 		pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
 		if (!pmd)
 			goto out_oom;
+		SetPagePDE(virt...
2007 Apr 18
1
[PATCH 1/5] Add pagetable allocation notifiers
...if (PTRS_PER_PMD == 1) {
 		memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
+		SetPagePDE(virt_to_page(pgd));
 		spin_lock_irqsave(&pgd_lock, flags);
 	}
 
@@ -227,6 +228,7 @@ void pgd_dtor(void *pgd, kmem_cache_t *c
 {
 	unsigned long flags; /* can be called from interrupt context */
 
+	ClearPagePDE(virt_to_page(pgd));
 	spin_lock_irqsave(&pgd_lock, flags);
 	pgd_list_del(pgd);
 	spin_unlock_irqrestore(&pgd_lock, flags);
@@ -244,13 +246,16 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 		pmd_t *pmd = kmem_cache_alloc(pmd_cache, GFP_KERNEL);
 		if (!pmd)
 			goto out_oom;
+		SetPagePDE(virt...
2007 Apr 18
2
pgd_alloc and [cd]tors
Is there any real use in having a ctor/dtor for the pgd cache?  Given
that all pgd allocation happens via pgd_alloc/pgd_free, why not just
fold the [cd]tor in?
I'm asking because Xen wants pgd[3] to be unshared in the PAE case, and
it looks to me like the easiest way to handle that is by making
pgd_alloc/free pv-ops and doing the appropriate thing in the Xen code. 
Would need to sort out the
2007 Apr 18
2
pgd_alloc and [cd]tors
Is there any real use in having a ctor/dtor for the pgd cache?  Given
that all pgd allocation happens via pgd_alloc/pgd_free, why not just
fold the [cd]tor in?
I'm asking because Xen wants pgd[3] to be unshared in the PAE case, and
it looks to me like the easiest way to handle that is by making
pgd_alloc/free pv-ops and doing the appropriate thing in the Xen code. 
Would need to sort out the
2007 Apr 18
0
[PATCH 2/2] Use page present for pae pdpes
...0700
@@ -247,14 +247,14 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 		if (!pmd)
 			goto out_oom;
 		SetPagePDE(virt_to_page(pmd));
-		set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
+		set_pgd(&pgd[i], __pgd(_PAGE_PRESENT | __pa(pmd)));
 	}
 	return pgd;
 
 out_oom:
 	for (i--; i >= 0; i--) {
 		ClearPagePDE(pfn_to_page(pgd_val(pgd[i]) >> PAGE_SHIFT));
-		kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
+		kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i]) & PAGE_MASK));
 	}
 	kmem_cache_free(pgd_cache, pgd);
 	return NULL;
@@ -268,7 +268,7 @@ void pgd_free(pgd_t *pgd)
 	if (...
2007 Apr 18
0
[PATCH 2/2] Use page present for pae pdpes
...0700
@@ -247,14 +247,14 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
 		if (!pmd)
 			goto out_oom;
 		SetPagePDE(virt_to_page(pmd));
-		set_pgd(&pgd[i], __pgd(1 + __pa(pmd)));
+		set_pgd(&pgd[i], __pgd(_PAGE_PRESENT | __pa(pmd)));
 	}
 	return pgd;
 
 out_oom:
 	for (i--; i >= 0; i--) {
 		ClearPagePDE(pfn_to_page(pgd_val(pgd[i]) >> PAGE_SHIFT));
-		kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i])-1));
+		kmem_cache_free(pmd_cache, (void *)__va(pgd_val(pgd[i]) & PAGE_MASK));
 	}
 	kmem_cache_free(pgd_cache, pgd);
 	return NULL;
@@ -268,7 +268,7 @@ void pgd_free(pgd_t *pgd)
 	if (...