-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MMUv4 in HS38x cores supports Super Pages which are basis for Linux THP support. Normal and Super pages can co-exist (ofcourse not overlap) in TLB with a new bit "SZ" in TLB page desciptor to distinguish between them. Super Page size is configurable in hardware (4K to 16M), but fixed once RTL builds. The exact THP size a Linx configuration will support is a function of: - MMU page size (typical 8K, RTL fixed) - software page walker address split between PGD:PTE:PFN (typical 11:8:13, but can be changed with 1 line) So for above default, THP size supported is 8K * 256 = 2M Default Page Walker is 2 levels, PGD:PTE:PFN, which in THP regime reduces to 1 level (as PTE is folded into PGD and canonically referred to as PMD). Thus thp PMD accessors are implemented in terms of PTE (just like sparc) Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
- Loading branch information
Vineet Gupta
committed
Oct 17, 2015
1 parent
55ad769
commit fe6c1b8
Showing
6 changed files
with
192 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Copyright (C) 2013-15 Synopsys, Inc. (www.synopsys.com) | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
|
||
#ifndef _ASM_ARC_HUGEPAGE_H | ||
#define _ASM_ARC_HUGEPAGE_H | ||
|
||
#include <linux/types.h> | ||
#include <asm-generic/pgtable-nopmd.h> | ||
|
||
static inline pte_t pmd_pte(pmd_t pmd) | ||
{ | ||
return __pte(pmd_val(pmd)); | ||
} | ||
|
||
static inline pmd_t pte_pmd(pte_t pte) | ||
{ | ||
return __pmd(pte_val(pte)); | ||
} | ||
|
||
#define pmd_wrprotect(pmd) pte_pmd(pte_wrprotect(pmd_pte(pmd))) | ||
#define pmd_mkwrite(pmd) pte_pmd(pte_mkwrite(pmd_pte(pmd))) | ||
#define pmd_mkdirty(pmd) pte_pmd(pte_mkdirty(pmd_pte(pmd))) | ||
#define pmd_mkold(pmd) pte_pmd(pte_mkold(pmd_pte(pmd))) | ||
#define pmd_mkyoung(pmd) pte_pmd(pte_mkyoung(pmd_pte(pmd))) | ||
#define pmd_mkhuge(pmd) pte_pmd(pte_mkhuge(pmd_pte(pmd))) | ||
#define pmd_mknotpresent(pmd) pte_pmd(pte_mknotpresent(pmd_pte(pmd))) | ||
#define pmd_mksplitting(pmd) pte_pmd(pte_mkspecial(pmd_pte(pmd))) | ||
#define pmd_mkclean(pmd) pte_pmd(pte_mkclean(pmd_pte(pmd))) | ||
|
||
#define pmd_write(pmd) pte_write(pmd_pte(pmd)) | ||
#define pmd_young(pmd) pte_young(pmd_pte(pmd)) | ||
#define pmd_pfn(pmd) pte_pfn(pmd_pte(pmd)) | ||
#define pmd_dirty(pmd) pte_dirty(pmd_pte(pmd)) | ||
#define pmd_special(pmd) pte_special(pmd_pte(pmd)) | ||
|
||
#define mk_pmd(page, prot) pte_pmd(mk_pte(page, prot)) | ||
|
||
#define pmd_trans_huge(pmd) (pmd_val(pmd) & _PAGE_HW_SZ) | ||
#define pmd_trans_splitting(pmd) (pmd_trans_huge(pmd) && pmd_special(pmd)) | ||
|
||
#define pfn_pmd(pfn, prot) (__pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))) | ||
|
||
static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) | ||
{ | ||
/* | ||
* open-coded pte_modify() with additional retaining of HW_SZ bit | ||
* so that pmd_trans_huge() remains true for this PMD | ||
*/ | ||
return __pmd((pmd_val(pmd) & (_PAGE_CHG_MASK | _PAGE_HW_SZ)) | pgprot_val(newprot)); | ||
} | ||
|
||
static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr, | ||
pmd_t *pmdp, pmd_t pmd) | ||
{ | ||
*pmdp = pmd; | ||
} | ||
|
||
extern void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr, | ||
pmd_t *pmd); | ||
|
||
#define has_transparent_hugepage() 1 | ||
|
||
/* Generic variants assume pgtable_t is struct page *, hence need for these */ | ||
#define __HAVE_ARCH_PGTABLE_DEPOSIT | ||
extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, | ||
pgtable_t pgtable); | ||
|
||
#define __HAVE_ARCH_PGTABLE_WITHDRAW | ||
extern pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters