Messages in this thread Patch in this message | | | From | Wei Yang <> | Subject | [PATCH] x86/mm: fix return value of p[um]dp_set_access_flags | Date | Thu, 19 Sep 2019 16:25:49 +0800 |
| |
Function p[um]dp_set_access_flags is used with update_mmu_cache_p[um]d and the return value from p[um]dp_set_access_flags indicates whether it is necessary to do the cache update.
From current code logic, only when changed && dirty, related page table entry would be updated. It is not necessary to update cache when the real page table entry is not changed.
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com> --- arch/x86/mm/pgtable.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index 44816ff6411f..ba910f8ab43a 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c @@ -509,9 +509,10 @@ int pmdp_set_access_flags(struct vm_area_struct *vma, * #PF is architecturally guaranteed to do that and in the * worst-case we'll generate a spurious fault. */ + return true; } - return changed; + return false; } int pudp_set_access_flags(struct vm_area_struct *vma, unsigned long address, @@ -529,9 +530,10 @@ int pudp_set_access_flags(struct vm_area_struct *vma, unsigned long address, * #PF is architecturally guaranteed to do that and in the * worst-case we'll generate a spurious fault. */ + return true; } - return changed; + return false; } #endif -- 2.17.1
| |