mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 22:50:41 +00:00
kmemcheck: don't track page tables
As these are allocated using the page allocator, we need to pass __GFP_NOTRACK before we add page allocator support to kmemcheck. Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
This commit is contained in:
parent
33f65df7ed
commit
9e730237c2
@ -104,7 +104,7 @@ static __ref void *spp_getpage(void)
|
|||||||
void *ptr;
|
void *ptr;
|
||||||
|
|
||||||
if (after_bootmem)
|
if (after_bootmem)
|
||||||
ptr = (void *) get_zeroed_page(GFP_ATOMIC);
|
ptr = (void *) get_zeroed_page(GFP_ATOMIC | __GFP_NOTRACK);
|
||||||
else
|
else
|
||||||
ptr = alloc_bootmem_pages(PAGE_SIZE);
|
ptr = alloc_bootmem_pages(PAGE_SIZE);
|
||||||
|
|
||||||
@ -281,7 +281,7 @@ static __ref void *alloc_low_page(unsigned long *phys)
|
|||||||
void *adr;
|
void *adr;
|
||||||
|
|
||||||
if (after_bootmem) {
|
if (after_bootmem) {
|
||||||
adr = (void *)get_zeroed_page(GFP_ATOMIC);
|
adr = (void *)get_zeroed_page(GFP_ATOMIC | __GFP_NOTRACK);
|
||||||
*phys = __pa(adr);
|
*phys = __pa(adr);
|
||||||
|
|
||||||
return adr;
|
return adr;
|
||||||
|
@ -470,7 +470,7 @@ static int split_large_page(pte_t *kpte, unsigned long address)
|
|||||||
|
|
||||||
if (!debug_pagealloc)
|
if (!debug_pagealloc)
|
||||||
spin_unlock(&cpa_lock);
|
spin_unlock(&cpa_lock);
|
||||||
base = alloc_pages(GFP_KERNEL, 0);
|
base = alloc_pages(GFP_KERNEL | __GFP_NOTRACK, 0);
|
||||||
if (!debug_pagealloc)
|
if (!debug_pagealloc)
|
||||||
spin_lock(&cpa_lock);
|
spin_lock(&cpa_lock);
|
||||||
if (!base)
|
if (!base)
|
||||||
|
@ -4,9 +4,11 @@
|
|||||||
#include <asm/tlb.h>
|
#include <asm/tlb.h>
|
||||||
#include <asm/fixmap.h>
|
#include <asm/fixmap.h>
|
||||||
|
|
||||||
|
#define PGALLOC_GFP GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO
|
||||||
|
|
||||||
pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
|
pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
|
||||||
{
|
{
|
||||||
return (pte_t *)__get_free_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
|
return (pte_t *)__get_free_page(PGALLOC_GFP);
|
||||||
}
|
}
|
||||||
|
|
||||||
pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
|
pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
|
||||||
@ -14,9 +16,9 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
|
|||||||
struct page *pte;
|
struct page *pte;
|
||||||
|
|
||||||
#ifdef CONFIG_HIGHPTE
|
#ifdef CONFIG_HIGHPTE
|
||||||
pte = alloc_pages(GFP_KERNEL|__GFP_HIGHMEM|__GFP_REPEAT|__GFP_ZERO, 0);
|
pte = alloc_pages(PGALLOC_GFP | __GFP_HIGHMEM, 0);
|
||||||
#else
|
#else
|
||||||
pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
|
pte = alloc_pages(PGALLOC_GFP, 0);
|
||||||
#endif
|
#endif
|
||||||
if (pte)
|
if (pte)
|
||||||
pgtable_page_ctor(pte);
|
pgtable_page_ctor(pte);
|
||||||
@ -161,7 +163,7 @@ static int preallocate_pmds(pmd_t *pmds[])
|
|||||||
bool failed = false;
|
bool failed = false;
|
||||||
|
|
||||||
for(i = 0; i < PREALLOCATED_PMDS; i++) {
|
for(i = 0; i < PREALLOCATED_PMDS; i++) {
|
||||||
pmd_t *pmd = (pmd_t *)get_zeroed_page(GFP_KERNEL|__GFP_REPEAT);
|
pmd_t *pmd = (pmd_t *)__get_free_page(PGALLOC_GFP);
|
||||||
if (pmd == NULL)
|
if (pmd == NULL)
|
||||||
failed = true;
|
failed = true;
|
||||||
pmds[i] = pmd;
|
pmds[i] = pmd;
|
||||||
@ -228,7 +230,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
|
|||||||
pmd_t *pmds[PREALLOCATED_PMDS];
|
pmd_t *pmds[PREALLOCATED_PMDS];
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
pgd = (pgd_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
|
pgd = (pgd_t *)__get_free_page(PGALLOC_GFP);
|
||||||
|
|
||||||
if (pgd == NULL)
|
if (pgd == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user