提交 c0f0bb55 编写于 作者: G guomengqi 提交者: Yang Yingliang

share_pool: k2u hugepage READONLY prot bug fix

ascend inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4EUVI
CVE: NA

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

Modified hugetlb_insert_hugepage_pte_by_pa to assure
k2u hugepages can be set as READONLY.
Signed-off-by: Nguomengqi <guomengqi3@huawei.com>
Reviewed-by: NDing Tianhong <dingtianhong@huawei.com>
Signed-off-by: NZhou Guanghui <zhouguanghui1@huawei.com>
Reviewed-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 3cb89bc9
...@@ -5374,7 +5374,8 @@ int hugetlb_insert_hugepage_pte_by_pa(struct mm_struct *mm, ...@@ -5374,7 +5374,8 @@ int hugetlb_insert_hugepage_pte_by_pa(struct mm_struct *mm,
entry = pfn_pte(phy_addr >> PAGE_SHIFT, prot); entry = pfn_pte(phy_addr >> PAGE_SHIFT, prot);
entry = huge_pte_mkdirty(entry); entry = huge_pte_mkdirty(entry);
entry = huge_pte_mkwrite(entry); if (!(pgprot_val(prot) & PTE_RDONLY))
entry = huge_pte_mkwrite(entry);
entry = pte_mkyoung(entry); entry = pte_mkyoung(entry);
entry = pte_mkhuge(entry); entry = pte_mkhuge(entry);
entry = pte_mkspecial(entry); entry = pte_mkspecial(entry);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册