提交 f4b3655e 编写于 作者: H Huacai Chen 提交者: Hongchen Zhang

LoongArch: Fix the !THP build

mainline inclusion
from mainline-v5.19-rc4
commit 501dcbe4
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5OHOB
CVE: NA

--------------------------------

Fix the !THP build by making pmd_pfn() available in all configurations.
Because pmd_pfn() is used in mm/page_vma_mapped.c whether or not THP is
configured.
Signed-off-by: NHuacai Chen <chenhuacai@loongson.cn>
上级 72580adc
...@@ -428,6 +428,11 @@ static inline void update_mmu_cache_pmd(struct vm_area_struct *vma, ...@@ -428,6 +428,11 @@ static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,
#define kern_addr_valid(addr) (1) #define kern_addr_valid(addr) (1)
static inline unsigned long pmd_pfn(pmd_t pmd)
{
return (pmd_val(pmd) & _PFN_MASK) >> _PFN_SHIFT;
}
#ifdef CONFIG_TRANSPARENT_HUGEPAGE #ifdef CONFIG_TRANSPARENT_HUGEPAGE
/* We don't have hardware dirty/accessed bits, generic_pmdp_establish is fine.*/ /* We don't have hardware dirty/accessed bits, generic_pmdp_establish is fine.*/
...@@ -499,11 +504,6 @@ static inline pmd_t pmd_mkyoung(pmd_t pmd) ...@@ -499,11 +504,6 @@ static inline pmd_t pmd_mkyoung(pmd_t pmd)
return pmd; return pmd;
} }
static inline unsigned long pmd_pfn(pmd_t pmd)
{
return (pmd_val(pmd) & _PFN_MASK) >> _PFN_SHIFT;
}
static inline struct page *pmd_page(pmd_t pmd) static inline struct page *pmd_page(pmd_t pmd)
{ {
if (pmd_trans_huge(pmd)) if (pmd_trans_huge(pmd))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册