mirror of https://gitee.com/openkylin/linux.git
x86: inline huge vmap supported functions
This allows unsupported levels to be constant folded away, and so p4d_free_pud_page can be removed because it's no longer linked to. Link: https://lkml.kernel.org/r/20210317062402.533919-10-npiggin@gmail.com Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Ding Tianhong <dingtianhong@huawei.com> Cc: Miaohe Lin <linmiaohe@huawei.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Russell King <linux@armlinux.org.uk> Cc: Uladzislau Rezki (Sony) <urezki@gmail.com> Cc: Will Deacon <will@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
168a633314
commit
97dc2a1548
|
@ -1,13 +1,29 @@
|
||||||
#ifndef _ASM_X86_VMALLOC_H
|
#ifndef _ASM_X86_VMALLOC_H
|
||||||
#define _ASM_X86_VMALLOC_H
|
#define _ASM_X86_VMALLOC_H
|
||||||
|
|
||||||
|
#include <asm/cpufeature.h>
|
||||||
#include <asm/page.h>
|
#include <asm/page.h>
|
||||||
#include <asm/pgtable_areas.h>
|
#include <asm/pgtable_areas.h>
|
||||||
|
|
||||||
#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
|
#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
|
||||||
bool arch_vmap_p4d_supported(pgprot_t prot);
|
static inline bool arch_vmap_p4d_supported(pgprot_t prot)
|
||||||
bool arch_vmap_pud_supported(pgprot_t prot);
|
{
|
||||||
bool arch_vmap_pmd_supported(pgprot_t prot);
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool arch_vmap_pud_supported(pgprot_t prot)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_X86_64
|
||||||
|
return boot_cpu_has(X86_FEATURE_GBPAGES);
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool arch_vmap_pmd_supported(pgprot_t prot)
|
||||||
|
{
|
||||||
|
return boot_cpu_has(X86_FEATURE_PSE);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _ASM_X86_VMALLOC_H */
|
#endif /* _ASM_X86_VMALLOC_H */
|
||||||
|
|
|
@ -481,27 +481,6 @@ void iounmap(volatile void __iomem *addr)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(iounmap);
|
EXPORT_SYMBOL(iounmap);
|
||||||
|
|
||||||
#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP
|
|
||||||
bool arch_vmap_p4d_supported(pgprot_t prot)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool arch_vmap_pud_supported(pgprot_t prot)
|
|
||||||
{
|
|
||||||
#ifdef CONFIG_X86_64
|
|
||||||
return boot_cpu_has(X86_FEATURE_GBPAGES);
|
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
bool arch_vmap_pmd_supported(pgprot_t prot)
|
|
||||||
{
|
|
||||||
return boot_cpu_has(X86_FEATURE_PSE);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert a physical pointer to a virtual kernel pointer for /dev/mem
|
* Convert a physical pointer to a virtual kernel pointer for /dev/mem
|
||||||
* access
|
* access
|
||||||
|
|
|
@ -780,14 +780,6 @@ int pmd_clear_huge(pmd_t *pmd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Until we support 512GB pages, skip them in the vmap area.
|
|
||||||
*/
|
|
||||||
int p4d_free_pud_page(p4d_t *p4d, unsigned long addr)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_X86_64
|
#ifdef CONFIG_X86_64
|
||||||
/**
|
/**
|
||||||
* pud_free_pmd_page - Clear pud entry and free pmd page.
|
* pud_free_pmd_page - Clear pud entry and free pmd page.
|
||||||
|
@ -861,11 +853,6 @@ int pmd_free_pte_page(pmd_t *pmd, unsigned long addr)
|
||||||
|
|
||||||
#else /* !CONFIG_X86_64 */
|
#else /* !CONFIG_X86_64 */
|
||||||
|
|
||||||
int pud_free_pmd_page(pud_t *pud, unsigned long addr)
|
|
||||||
{
|
|
||||||
return pud_none(*pud);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Disable free page handling on x86-PAE. This assures that ioremap()
|
* Disable free page handling on x86-PAE. This assures that ioremap()
|
||||||
* does not update sync'd pmd entries. See vmalloc_sync_one().
|
* does not update sync'd pmd entries. See vmalloc_sync_one().
|
||||||
|
|
Loading…
Reference in New Issue