diff options
Diffstat (limited to 'arch/x86/mm/pgtable.c')
-rw-r--r-- | arch/x86/mm/pgtable.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index 3feec5af4e67..6cbdff26bb96 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c | |||
@@ -445,6 +445,26 @@ int pmdp_set_access_flags(struct vm_area_struct *vma, | |||
445 | 445 | ||
446 | return changed; | 446 | return changed; |
447 | } | 447 | } |
448 | |||
449 | int pudp_set_access_flags(struct vm_area_struct *vma, unsigned long address, | ||
450 | pud_t *pudp, pud_t entry, int dirty) | ||
451 | { | ||
452 | int changed = !pud_same(*pudp, entry); | ||
453 | |||
454 | VM_BUG_ON(address & ~HPAGE_PUD_MASK); | ||
455 | |||
456 | if (changed && dirty) { | ||
457 | *pudp = entry; | ||
458 | /* | ||
459 | * We had a write-protection fault here and changed the pud | ||
460 | * to to more permissive. No need to flush the TLB for that, | ||
461 | * #PF is architecturally guaranteed to do that and in the | ||
462 | * worst-case we'll generate a spurious fault. | ||
463 | */ | ||
464 | } | ||
465 | |||
466 | return changed; | ||
467 | } | ||
448 | #endif | 468 | #endif |
449 | 469 | ||
450 | int ptep_test_and_clear_young(struct vm_area_struct *vma, | 470 | int ptep_test_and_clear_young(struct vm_area_struct *vma, |
@@ -474,6 +494,17 @@ int pmdp_test_and_clear_young(struct vm_area_struct *vma, | |||
474 | 494 | ||
475 | return ret; | 495 | return ret; |
476 | } | 496 | } |
497 | int pudp_test_and_clear_young(struct vm_area_struct *vma, | ||
498 | unsigned long addr, pud_t *pudp) | ||
499 | { | ||
500 | int ret = 0; | ||
501 | |||
502 | if (pud_young(*pudp)) | ||
503 | ret = test_and_clear_bit(_PAGE_BIT_ACCESSED, | ||
504 | (unsigned long *)pudp); | ||
505 | |||
506 | return ret; | ||
507 | } | ||
477 | #endif | 508 | #endif |
478 | 509 | ||
479 | int ptep_clear_flush_young(struct vm_area_struct *vma, | 510 | int ptep_clear_flush_young(struct vm_area_struct *vma, |