Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa1762f4 authored by David Daney's avatar David Daney Committed by Ralf Baechle
Browse files

MIPS: Control huge tlb support via Kconfig symbol MIPS_HUGE_TLB_SUPPORT



We need Huge TLBs for HUGETLB_PAGE, or the soon to follow
TRANSPARENT_HUGEPAGE.  collect this information under a single Kconfig
symbol.

Signed-off-by: default avatarDavid Daney <david.daney@cavium.com>
parent c17a6554
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -1077,6 +1077,9 @@ config SYS_SUPPORTS_HUGETLBFS
	depends on CPU_SUPPORTS_HUGEPAGES && 64BIT
	depends on CPU_SUPPORTS_HUGEPAGES && 64BIT
	default y
	default y


config MIPS_HUGE_TLB_SUPPORT
	def_bool HUGETLB_PAGE || TRANSPARENT_HUGEPAGE

config IRQ_CPU
config IRQ_CPU
	bool
	bool


+1 −1
Original line number Original line Diff line number Diff line
@@ -240,7 +240,7 @@
#define PM_HUGE_MASK	PM_64M
#define PM_HUGE_MASK	PM_64M
#elif defined(CONFIG_PAGE_SIZE_64KB)
#elif defined(CONFIG_PAGE_SIZE_64KB)
#define PM_HUGE_MASK	PM_256M
#define PM_HUGE_MASK	PM_256M
#elif defined(CONFIG_HUGETLB_PAGE)
#elif defined(CONFIG_MIPS_HUGE_TLB_SUPPORT)
#error Bad page size configuration for hugetlbfs!
#error Bad page size configuration for hugetlbfs!
#endif
#endif


+3 −3
Original line number Original line Diff line number Diff line
@@ -33,17 +33,17 @@
#define PAGE_SIZE	(_AC(1,UL) << PAGE_SHIFT)
#define PAGE_SIZE	(_AC(1,UL) << PAGE_SHIFT)
#define PAGE_MASK       (~(PAGE_SIZE - 1))
#define PAGE_MASK       (~(PAGE_SIZE - 1))


#ifdef CONFIG_HUGETLB_PAGE
#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
#define HPAGE_SHIFT	(PAGE_SHIFT + PAGE_SHIFT - 3)
#define HPAGE_SHIFT	(PAGE_SHIFT + PAGE_SHIFT - 3)
#define HPAGE_SIZE	(_AC(1,UL) << HPAGE_SHIFT)
#define HPAGE_SIZE	(_AC(1,UL) << HPAGE_SHIFT)
#define HPAGE_MASK	(~(HPAGE_SIZE - 1))
#define HPAGE_MASK	(~(HPAGE_SIZE - 1))
#define HUGETLB_PAGE_ORDER	(HPAGE_SHIFT - PAGE_SHIFT)
#define HUGETLB_PAGE_ORDER	(HPAGE_SHIFT - PAGE_SHIFT)
#else /* !CONFIG_HUGETLB_PAGE */
#else /* !CONFIG_MIPS_HUGE_TLB_SUPPORT */
#define HPAGE_SHIFT	({BUILD_BUG(); 0; })
#define HPAGE_SHIFT	({BUILD_BUG(); 0; })
#define HPAGE_SIZE	({BUILD_BUG(); 0; })
#define HPAGE_SIZE	({BUILD_BUG(); 0; })
#define HPAGE_MASK	({BUILD_BUG(); 0; })
#define HPAGE_MASK	({BUILD_BUG(); 0; })
#define HUGETLB_PAGE_ORDER	({BUILD_BUG(); 0; })
#define HUGETLB_PAGE_ORDER	({BUILD_BUG(); 0; })
#endif /* CONFIG_HUGETLB_PAGE */
#endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */


#ifndef __ASSEMBLY__
#ifndef __ASSEMBLY__


+1 −1
Original line number Original line Diff line number Diff line
@@ -128,7 +128,7 @@
#define _PAGE_MODIFIED		(1 << _PAGE_MODIFIED_SHIFT)
#define _PAGE_MODIFIED		(1 << _PAGE_MODIFIED_SHIFT)
#define _PAGE_FILE		(_PAGE_MODIFIED)
#define _PAGE_FILE		(_PAGE_MODIFIED)


#ifdef CONFIG_HUGETLB_PAGE
#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
/* huge tlb page */
/* huge tlb page */
#define _PAGE_HUGE_SHIFT	(_PAGE_MODIFIED_SHIFT + 1)
#define _PAGE_HUGE_SHIFT	(_PAGE_MODIFIED_SHIFT + 1)
#define _PAGE_HUGE		(1 << _PAGE_HUGE_SHIFT)
#define _PAGE_HUGE		(1 << _PAGE_HUGE_SHIFT)
+1 −1
Original line number Original line Diff line number Diff line
@@ -6,7 +6,7 @@
 * SECTION_SIZE_BITS		2^N: how big each section will be
 * SECTION_SIZE_BITS		2^N: how big each section will be
 * MAX_PHYSMEM_BITS		2^N: how much memory we can have in that space
 * MAX_PHYSMEM_BITS		2^N: how much memory we can have in that space
 */
 */
#if defined(CONFIG_HUGETLB_PAGE) && defined(CONFIG_PAGE_SIZE_64KB)
#if defined(CONFIG_MIPS_HUGE_TLB_SUPPORT) && defined(CONFIG_PAGE_SIZE_64KB)
# define SECTION_SIZE_BITS	29
# define SECTION_SIZE_BITS	29
#else
#else
# define SECTION_SIZE_BITS	28
# define SECTION_SIZE_BITS	28
Loading