diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-04-23 11:37:17 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-04-23 11:45:20 +0200 |
commit | 6dd29b3df975582ef429b5b93c899e6575785940 (patch) | |
tree | f7f214935c45eb7ea9096fccd4cdace3baa99e68 /arch/x86/include/asm/pgtable.h | |
parent | ace2fb5a8b65d6aba530068ea9331f18e10ef565 (diff) | |
download | op-kernel-dev-6dd29b3df975582ef429b5b93c899e6575785940.zip op-kernel-dev-6dd29b3df975582ef429b5b93c899e6575785940.tar.gz |
Revert "x86/mm/gup: Switch GUP to the generic get_user_page_fast() implementation"
This reverts commit 2947ba054a4dabbd82848728d765346886050029.
Dan Williams reported dax-pmem kernel warnings with the following signature:
WARNING: CPU: 8 PID: 245 at lib/percpu-refcount.c:155 percpu_ref_switch_to_atomic_rcu+0x1f5/0x200
percpu ref (dax_pmem_percpu_release [dax_pmem]) <= 0 (0) after switching to atomic
... and bisected it to this commit, which suggests possible memory corruption
caused by the x86 fast-GUP conversion.
He also pointed out:
"
This is similar to the backtrace when we were not properly handling
pud faults and was fixed with this commit: 220ced1676c4 "mm: fix
get_user_pages() vs device-dax pud mappings"
I've found some missing _devmap checks in the generic
get_user_pages_fast() path, but this does not fix the regression
[...]
"
So given that there are known bugs, and a pretty robust looking bisection
points to this commit suggesting that are unknown bugs in the conversion
as well, revert it for the time being - we'll re-try in v4.13.
Reported-by: Dan Williams <dan.j.williams@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: aneesh.kumar@linux.vnet.ibm.com
Cc: dann.frazier@canonical.com
Cc: dave.hansen@intel.com
Cc: steve.capper@linaro.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/include/asm/pgtable.h')
-rw-r--r-- | arch/x86/include/asm/pgtable.h | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 942482a..f5af95a 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -244,11 +244,6 @@ static inline int pud_devmap(pud_t pud) return 0; } #endif - -static inline int pgd_devmap(pgd_t pgd) -{ - return 0; -} #endif #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ @@ -1190,54 +1185,6 @@ static inline u16 pte_flags_pkey(unsigned long pte_flags) #endif } -static inline bool __pkru_allows_pkey(u16 pkey, bool write) -{ - u32 pkru = read_pkru(); - - if (!__pkru_allows_read(pkru, pkey)) - return false; - if (write && !__pkru_allows_write(pkru, pkey)) - return false; - - return true; -} - -/* - * 'pteval' can come from a PTE, PMD or PUD. We only check - * _PAGE_PRESENT, _PAGE_USER, and _PAGE_RW in here which are the - * same value on all 3 types. - */ -static inline bool __pte_access_permitted(unsigned long pteval, bool write) -{ - unsigned long need_pte_bits = _PAGE_PRESENT|_PAGE_USER; - - if (write) - need_pte_bits |= _PAGE_RW; - - if ((pteval & need_pte_bits) != need_pte_bits) - return 0; - - return __pkru_allows_pkey(pte_flags_pkey(pteval), write); -} - -#define pte_access_permitted pte_access_permitted -static inline bool pte_access_permitted(pte_t pte, bool write) -{ - return __pte_access_permitted(pte_val(pte), write); -} - -#define pmd_access_permitted pmd_access_permitted -static inline bool pmd_access_permitted(pmd_t pmd, bool write) -{ - return __pte_access_permitted(pmd_val(pmd), write); -} - -#define pud_access_permitted pud_access_permitted -static inline bool pud_access_permitted(pud_t pud, bool write) -{ - return __pte_access_permitted(pud_val(pud), write); -} - #include <asm-generic/pgtable.h> #endif /* __ASSEMBLY__ */ |