Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc489f12

Browse files
hnaztorvalds
authored andcommitted
thp: add pmd_modify
Add pmd_modify() for use with mprotect() on huge pmds.Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>Reviewed-by: Rik van Riel <riel@redhat.com>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent0ca1634 commitc489f12

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

‎arch/x86/include/asm/pgtable.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,16 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
325325
return__pte(val);
326326
}
327327

328+
staticinlinepmd_tpmd_modify(pmd_tpmd,pgprot_tnewprot)
329+
{
330+
pmdval_tval=pmd_val(pmd);
331+
332+
val &=_HPAGE_CHG_MASK;
333+
val |=massage_pgprot(newprot)& ~_HPAGE_CHG_MASK;
334+
335+
return__pmd(val);
336+
}
337+
328338
/* mprotect needs to preserve PAT bits when updating vm_page_prot */
329339
#definepgprot_modify pgprot_modify
330340
staticinlinepgprot_tpgprot_modify(pgprot_toldprot,pgprot_tnewprot)

‎arch/x86/include/asm/pgtable_types.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
/* Set of bits not changed in pte_modify */
7373
#define_PAGE_CHG_MASK(PTE_PFN_MASK | _PAGE_PCD | _PAGE_PWT |\
7474
_PAGE_SPECIAL | _PAGE_ACCESSED | _PAGE_DIRTY)
75+
#define_HPAGE_CHG_MASK (_PAGE_CHG_MASK | _PAGE_PSE)
7576

7677
#define_PAGE_CACHE_MASK(_PAGE_PCD | _PAGE_PWT)
7778
#define_PAGE_CACHE_WB(0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp