LinuxPPC-Dev Archive on lore.kernel.org
 help / color / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v4 13/13] mm/debug_vm_pgtable: Avoid none pte in pte_clear_test
Date: Thu, 10 Sep 2020 19:13:58 -0700
Message-ID: <20200911021358.GA3656343@ubuntu-n2-xlarge-x86> (raw)
In-Reply-To: <20200902114222.181353-14-aneesh.kumar@linux.ibm.com>

On Wed, Sep 02, 2020 at 05:12:22PM +0530, Aneesh Kumar K.V wrote:
> pte_clear_tests operate on an existing pte entry. Make sure that
> is not a none pte entry.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> ---
>  mm/debug_vm_pgtable.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c
> index 9afa1354326b..c36530c69e33 100644
> --- a/mm/debug_vm_pgtable.c
> +++ b/mm/debug_vm_pgtable.c
> @@ -542,9 +542,10 @@ static void __init pgd_populate_tests(struct mm_struct *mm, pgd_t *pgdp,
>  #endif /* PAGETABLE_P4D_FOLDED */
>  
>  static void __init pte_clear_tests(struct mm_struct *mm, pte_t *ptep,
> -				   unsigned long vaddr)
> +				   unsigned long pfn, unsigned long vaddr,
> +				   pgprot_t prot)
>  {
> -	pte_t pte = ptep_get(ptep);
> +	pte_t pte = pfn_pte(pfn, prot);
>  
>  	pr_debug("Validating PTE clear\n");
>  	pte = __pte(pte_val(pte) | RANDOM_ORVALUE);
> @@ -1049,7 +1050,7 @@ static int __init debug_vm_pgtable(void)
>  
>  	ptl = pte_lockptr(mm, pmdp);
>  	spin_lock(ptl);
> -	pte_clear_tests(mm, ptep, vaddr);
> +	pte_clear_tests(mm, ptep, pte_aligned, vaddr, prot);
>  	pte_advanced_tests(mm, vma, ptep, pte_aligned, vaddr, prot);
>  	pte_unmap_unlock(ptep, ptl);
>  
> -- 
> 2.26.2
> 
> 

This patch causes a panic at boot for RISC-V defconfig. The rootfs is here if it is needed:
https://github.com/ClangBuiltLinux/boot-utils/blob/3b21a5b71451742866349ba4f18638c5a754e660/images/riscv/rootfs.cpio.zst

$ make -skj"$(nproc)" ARCH=riscv CROSS_COMPILE=riscv64-linux- O=out/riscv distclean defconfig Image

$ qemu-system-riscv64 -bios default -M virt -display none -initrd rootfs.cpio -kernel Image -m 512m -nodefaults -serial mon:stdio
...

OpenSBI v0.6
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name          : QEMU Virt Machine
Platform HART Features : RV64ACDFIMSU
Platform Max HARTs     : 8
Current Hart           : 0
Firmware Base          : 0x80000000
Firmware Size          : 120 KB
Runtime SBI Version    : 0.2

MIDELEG : 0x0000000000000222
MEDELEG : 0x000000000000b109
PMP0    : 0x0000000080000000-0x000000008001ffff (A)
PMP1    : 0x0000000000000000-0xffffffffffffffff (A,R,W,X)
[    0.000000] Linux version 5.9.0-rc4-next-20200910 (nathan@ubuntu-n2-xlarge-x86) (riscv64-linux-gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 SMP Thu Sep 10 19:10:43 MST 2020
...
[    0.294593] NET: Registered protocol family 17
[    0.295781] 9pnet: Installing 9P2000 support
[    0.296153] Key type dns_resolver registered
[    0.296694] debug_vm_pgtable: [debug_vm_pgtable         ]: Validating architecture page table helpers
[    0.297635] Unable to handle kernel paging request at virtual address 0a7fffe01dafefc8
[    0.298029] Oops [#1]
[    0.298153] Modules linked in:
[    0.298433] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.9.0-rc4-next-20200910 #1
[    0.298792] epc: ffffffe000205afc ra : ffffffe0008be0aa sp : ffffffe01ae73d40
[    0.299078]  gp : ffffffe0010b9b48 tp : ffffffe01ae68000 t0 : ffffffe008152000
[    0.299362]  t1 : 0000000000000000 t2 : 0000000000000000 s0 : ffffffe01ae73d60
[    0.299648]  s1 : bffffffffffffffb a0 : 0a7fffe01dafefc8 a1 : bffffffffffffffb
[    0.299948]  a2 : ffffffe0010a2698 a3 : 0000000000000001 a4 : 0000000000000003
[    0.300231]  a5 : 0000000000000800 a6 : fffffffff0000080 a7 : 000000001b642000
[    0.300521]  s2 : ffffffe0081517b8 s3 : ffffffe008150a80 s4 : ffffffe01af30000
[    0.300806]  s5 : ffffffe01f8ca9b8 s6 : ffffffe008150000 s7 : ffffffe0010bb100
[    0.301161]  s8 : ffffffe0010bb108 s9 : 0000000000080202 s10: ffffffe0010bb928
[    0.301481]  s11: 000000002008085b t3 : 0000000000000000 t4 : 0000000000000000
[    0.301722]  t5 : 0000000000000000 t6 : ffffffe008150000
[    0.301947] status: 0000000000000120 badaddr: 0a7fffe01dafefc8 cause: 000000000000000f
[    0.302569] ---[ end trace 7ffb153d816164cf ]---
[    0.302797] note: swapper/0[1] exited with preempt_count 1
[    0.303101] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    0.303614] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---

$ git bisect log
# bad: [7ce53e3a447bced7b85ed181c4d027e93c062e07] Add linux-next specific files for 20200910
# good: [34d4ddd359dbcdf6c5fb3f85a179243d7a1cb7f8] Merge tag 'linux-kselftest-5.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
git bisect start '7ce53e3a447bced7b85ed181c4d027e93c062e07' '34d4ddd359dbcdf6c5fb3f85a179243d7a1cb7f8'
# good: [bb1f09d126618aa1ec776d87d7f85136edbed485] Merge remote-tracking branch 'crypto/master' into master
git bisect good bb1f09d126618aa1ec776d87d7f85136edbed485
# good: [1fb7e980a0f9a0aa4c7daba1a7e35d12c97820ea] Merge remote-tracking branch 'audit/next' into master
git bisect good 1fb7e980a0f9a0aa4c7daba1a7e35d12c97820ea
# good: [afdf05baff78a658843c1013855985e7a6871406] Merge remote-tracking branch 'thunderbolt/next' into master
git bisect good afdf05baff78a658843c1013855985e7a6871406
# good: [c5f3c031bd4b8ef5fb6b07352abc284603c3edee] Merge remote-tracking branch 'kselftest/next' into master
git bisect good c5f3c031bd4b8ef5fb6b07352abc284603c3edee
# bad: [671aca25e253f2773850aefb0837a225c691e336] lib: bitmap: delete duplicated words
git bisect bad 671aca25e253f2773850aefb0837a225c691e336
# bad: [e42ac710a849403b7fe582cc555dc3b7bf5b6fa9] tools/testing/selftests/vm/hmm-tests.c: use the new SKIP() macro
git bisect bad e42ac710a849403b7fe582cc555dc3b7bf5b6fa9
# good: [1443e3384317a9dfaf1381e8134a69c1e3fc7130] device-dax: kill dax_kmem_res
git bisect good 1443e3384317a9dfaf1381e8134a69c1e3fc7130
# good: [e2aad6f1d232b457ea6a3194992dd4c0a83534a5] mm/debug_vm_pgtable/locks: take correct page table lock
git bisect good e2aad6f1d232b457ea6a3194992dd4c0a83534a5
# bad: [08075d21b791241ba9f1366f814afa4a77372250] mm: workingset: ignore slab memory size when calculating shadows pressure
git bisect bad 08075d21b791241ba9f1366f814afa4a77372250
# bad: [42e9e63856020953cc3645a2032a70179364a1d8] mm-gup-dont-permit-users-to-call-get_user_pages-with-foll_longterm-fix
git bisect bad 42e9e63856020953cc3645a2032a70179364a1d8
# good: [b77bfa2ce4c2e30c1b1d1b3eb18c5b57397277f9] mm/debug_vm_pgtable/hugetlb: disable hugetlb test on ppc64
git bisect good b77bfa2ce4c2e30c1b1d1b3eb18c5b57397277f9
# bad: [90b612d56df39666f0f6fa6a033b4a7ec2e0a16c] mm/gup_benchmark: use pin_user_pages for FOLL_LONGTERM flag
git bisect bad 90b612d56df39666f0f6fa6a033b4a7ec2e0a16c
# bad: [060e70ecf865e55d82282995b4cb478126a1163c] mm/debug_vm_pgtable: avoid none pte in pte_clear_test
git bisect bad 060e70ecf865e55d82282995b4cb478126a1163c
# first bad commit: [060e70ecf865e55d82282995b4cb478126a1163c] mm/debug_vm_pgtable: avoid none pte in pte_clear_test

Cheers,
Nathan

  reply index

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02 11:42 [PATCH v4 00/13] mm/debug_vm_pgtable fixes Aneesh Kumar K.V
2020-09-02 11:42 ` [PATCH v4 01/13] powerpc/mm: Add DEBUG_VM WARN for pmd_clear Aneesh Kumar K.V
2020-09-02 11:42 ` [PATCH v4 02/13] powerpc/mm: Move setting pte specific flags to pfn_pte Aneesh Kumar K.V
2020-09-02 12:30   ` Christophe Leroy
2020-09-02 11:42 ` [PATCH v4 03/13] mm/debug_vm_pgtable/ppc64: Avoid setting top bits in radom value Aneesh Kumar K.V
2020-09-04  4:03   ` Anshuman Khandual
2020-09-02 11:42 ` [PATCH v4 04/13] mm/debug_vm_pgtables/hugevmap: Use the arch helper to identify huge vmap support Aneesh Kumar K.V
2020-09-02 12:40   ` Christophe Leroy
2020-09-02 12:53     ` Aneesh Kumar K.V
2020-09-04  4:08   ` Anshuman Khandual
2020-09-02 11:42 ` [PATCH v4 05/13] mm/debug_vm_pgtable/savedwrite: Enable savedwrite test with CONFIG_NUMA_BALANCING Aneesh Kumar K.V
2020-09-04  4:09   ` Anshuman Khandual
2020-09-02 11:42 ` [PATCH v4 06/13] mm/debug_vm_pgtable/THP: Mark the pte entry huge before using set_pmd/pud_at Aneesh Kumar K.V
2020-09-04  5:21   ` Anshuman Khandual
2020-09-02 11:42 ` [PATCH v4 07/13] mm/debug_vm_pgtable/set_pte/pmd/pud: Don't use set_*_at to update an existing pte entry Aneesh Kumar K.V
2020-09-04  5:34   ` Anshuman Khandual
2020-09-02 11:42 ` [PATCH v4 08/13] mm/debug_vm_pgtable/locks: Move non page table modifying test together Aneesh Kumar K.V
2020-09-04  3:58   ` Anshuman Khandual
2020-09-02 11:42 ` [PATCH v4 09/13] mm/debug_vm_pgtable/locks: Take correct page table lock Aneesh Kumar K.V
2020-09-04  5:39   ` Anshuman Khandual
2020-09-02 11:42 ` [PATCH v4 10/13] mm/debug_vm_pgtable/thp: Use page table depost/withdraw with THP Aneesh Kumar K.V
2020-09-04  4:21   ` Anshuman Khandual
2020-09-02 11:42 ` [PATCH v4 11/13] mm/debug_vm_pgtable/pmd_clear: Don't use pmd/pud_clear on pte entries Aneesh Kumar K.V
2020-09-04  6:03   ` Anshuman Khandual
2020-09-02 11:42 ` [PATCH v4 12/13] mm/debug_vm_pgtable/hugetlb: Disable hugetlb test on ppc64 Aneesh Kumar K.V
2020-09-04  6:19   ` Anshuman Khandual
2020-09-02 11:42 ` [PATCH v4 13/13] mm/debug_vm_pgtable: Avoid none pte in pte_clear_test Aneesh Kumar K.V
2020-09-11  2:13   ` Nathan Chancellor [this message]
2020-09-11  5:21     ` Aneesh Kumar K.V
2020-09-23  3:14       ` Anshuman Khandual
2020-10-11 20:02   ` Guenter Roeck
2020-10-12  4:29     ` Aneesh Kumar K.V
2020-09-02 11:46 ` Aneesh Kumar K.V
2020-09-04  4:16   ` Anshuman Khandual
2020-09-04  6:48 ` [PATCH v4 00/13] mm/debug_vm_pgtable fixes Anshuman Khandual
2020-09-04 15:26   ` Gerald Schaefer
2020-09-04 16:01     ` Gerald Schaefer
2020-09-04 17:53       ` Gerald Schaefer
2020-09-09  8:38         ` Anshuman Khandual
2020-09-08 15:39       ` Gerald Schaefer
2020-09-09  6:08         ` Aneesh Kumar K.V
2020-09-09 11:16           ` Gerald Schaefer
2020-09-09  8:15       ` Anshuman Khandual
2020-09-09 11:10         ` Gerald Schaefer
2020-09-09  8:08     ` Anshuman Khandual
2020-09-09 11:36       ` Gerald Schaefer
2020-09-13 11:03 ` [PATCH] mm/debug_vm_pgtable: Avoid doing memory allocation with pgtable_t mapped Aneesh Kumar K.V
2020-09-13 13:42   ` Matthew Wilcox
2020-10-13 20:58 ` [PATCH v4 00/13] mm/debug_vm_pgtable fixes Andrew Morton
2020-10-14  3:15   ` Aneesh Kumar K.V
2020-10-14 20:36     ` Andrew Morton
2020-10-15  2:59       ` Anshuman Khandual

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200911021358.GA3656343@ubuntu-n2-xlarge-x86 \
    --to=natechancellor@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=anshuman.khandual@arm.com \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LinuxPPC-Dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linuxppc-dev/0 linuxppc-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linuxppc-dev linuxppc-dev/ https://lore.kernel.org/linuxppc-dev \
		linuxppc-dev@lists.ozlabs.org linuxppc-dev@ozlabs.org
	public-inbox-index linuxppc-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.ozlabs.lists.linuxppc-dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git