Commit cb2a2a5
committed
drm/shmem_helper: Make sure PMD entries get the writeable upgrade
Unlike PTEs which are automatically upgraded to writeable entries if
.pfn_mkwrite() returns 0, the PMD upgrades go through .huge_fault(),
and we currently pretend to have handled the make-writeable request
even though we only ever map things read-only. Make sure we pass the
proper "write" info to vmf_insert_pfn_pmd() in that case.
This also means we have to record the mkwrite event in the .huge_fault()
path now. Move the dirty tracking logic to a
drm_gem_shmem_record_mkwrite() helper so it can also be called from
drm_gem_shmem_pfn_mkwrite().
Note that this wasn't a problem before commit 28e3918
("drm/gem-shmem: Track folio accessed/dirty status in mmap"), because
the pgprot were not lowered to read-only before this commit (see the
vma_wants_writenotify() in vma_set_page_prot()).
Fixes: 28e3918 ("drm/gem-shmem: Track folio accessed/dirty status in mmap")
Cc: Biju Das <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: Tommaso Merciai <[email protected]>
Reviewed-by: Loïc Molinari <[email protected]>
Tested-by: Biju Das <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Tested-by: Tommaso Merciai <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Boris Brezillon <[email protected]>1 parent c636ae3 commit cb2a2a5
1 file changed
Lines changed: 32 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
557 | 572 | | |
558 | 573 | | |
559 | 574 | | |
| |||
566 | 581 | | |
567 | 582 | | |
568 | 583 | | |
| 584 | + | |
| 585 | + | |
569 | 586 | | |
570 | | - | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
571 | 601 | | |
572 | 602 | | |
573 | 603 | | |
| |||
655 | 685 | | |
656 | 686 | | |
657 | 687 | | |
658 | | - | |
659 | | - | |
660 | | - | |
661 | | - | |
662 | | - | |
663 | | - | |
664 | | - | |
665 | | - | |
666 | | - | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
| 688 | + | |
671 | 689 | | |
672 | 690 | | |
673 | 691 | | |
| |||
0 commit comments