lkml.org 
[lkml]   [2015]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 19/36] HMM: handle HMM device page table entry on mirror page table fault and update.
Date
From: Jérôme Glisse <jglisse@redhat.com>

When faulting or updating the device page table properly handle the case of device
memory entry.

Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
---
mm/hmm.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/mm/hmm.c b/mm/hmm.c
index 761905a..e4585b7 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -613,6 +613,13 @@ static void hmm_mirror_update_pte(struct hmm_mirror *mirror,
goto out;
}

+ if (hmm_pte_test_valid_dev(hmm_pte)) {
+ *hmm_pte &= event->pte_mask;
+ if (!hmm_pte_test_valid_dev(hmm_pte))
+ hmm_pt_iter_directory_unref(iter, mirror->pt.llevel);
+ return;
+ }
+
if (!hmm_pte_test_valid_dma(hmm_pte))
return;

@@ -813,6 +820,13 @@ static int hmm_mirror_fault_pmd(pmd_t *pmdp,
do {
next = hmm_pt_level_next(&mirror->pt, addr, hmm_end,
mirror->pt.llevel);
+
+ if (hmm_pte_test_valid_dev(&hmm_pte[i])) {
+ if (write)
+ hmm_pte_set_write(&hmm_pte[i]);
+ continue;
+ }
+
if (!pte_present(*ptep) || (write && !pte_write(*ptep))) {
ret = -ENOENT;
ptep++;
--
1.9.3


\
 
 \ /
  Last update: 2015-05-21 22:01    [W:0.404 / U:3.528 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site