Re: [PATCH v13 12/22] mm: pagewalk: Allow walking without vma

From: Steven Price
Date: Mon Oct 28 2019 - 06:47:19 EST


On 27/10/2019 07:59, kbuild test robot wrote:
> Hi Steven,
>
> Thank you for the patch! Yet something to improve:
>
> [auto build test ERROR on linus/master]
> [also build test ERROR on v5.4-rc4 next-20191025]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
>
> url: https://github.com/0day-ci/linux/commits/Steven-Price/Generic-page-walk-and-ptdump/20191027-140322
> base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5a1e843c66fa6438f389045981c37e4073917641
> config: arc-defconfig (attached as .config)
> compiler: arc-elf-gcc (GCC) 7.4.0
> reproduce:
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> GCC_VERSION=7.4.0 make.cross ARCH=arc

First off, these instructions don't work! make.cross attempts to
download a sparc toolchain.

However, the issue is actually quite easy to see if you look more
closely at patch 2:

> +#define pmd_leaf(x) (pmd_val(pmd) & _PAGE_HW_SZ)

That 'pmd' variable should really have been 'x'!

Below diff should fix this up - I'll repost with this squashed in shortly:

----8<----
diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h
index 5ec798e50836..b4a0cf27ac1c 100644
--- a/arch/arc/include/asm/pgtable.h
+++ b/arch/arc/include/asm/pgtable.h
@@ -274,7 +274,7 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep)
#define pmd_none(x) (!pmd_val(x))
#define pmd_bad(x) ((pmd_val(x) & ~PAGE_MASK))
#define pmd_present(x) (pmd_val(x))
-#define pmd_leaf(x) (pmd_val(pmd) & _PAGE_HW_SZ)
+#define pmd_leaf(x) (pmd_val(x) & _PAGE_HW_SZ)
#define pmd_clear(xp) do { pmd_val(*(xp)) = 0; } while (0)

#define pte_page(pte) pfn_to_page(pte_pfn(pte))