All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corentin Labbe <clabbe.montjoie@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: herbert@gondor.apana.org.au, mripard@kernel.org, wens@csie.org,
	linux-arm-kernel@lists.infradead.org,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: crypto: sun4i-ss: error with kmap
Date: Wed, 2 Dec 2020 20:55:01 +0100	[thread overview]
Message-ID: <20201202195501.GA29296@Red> (raw)
In-Reply-To: <87v9dlfthf.fsf@nanos.tec.linutronix.de>

On Tue, Dec 01, 2020 at 04:15:08PM +0100, Thomas Gleixner wrote:
> On Tue, Dec 01 2020 at 15:45, Corentin Labbe wrote:
> > On Tue, Dec 01, 2020 at 03:16:36PM +0100, Thomas Gleixner wrote:
> > In fact the warn was a bit later so I added:
> >        preempt_disable();
> >         idx = arch_kmap_local_unmap_idx(kmap_local_idx(), addr);
> > -       WARN_ON_ONCE(addr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
> > +       if (WARN_ON_ONCE(addr != __fix_to_virt(FIX_KMAP_BEGIN + idx)))
> > +               pr_err("kunmap_local: vaddr %lx\n", (unsigned long) vaddr);
> >  
> >         arch_kmap_local_pre_unmap(addr);
> >         pte_clear(&init_mm, addr, kmap_pte - idx);
> >
> > and this give kunmap_local: vaddr ffefe000
> 
> which looks like a valid one.
> 
> Can you apply the patch below and add 'ftrace_dump_on_oops' on the
> command line or enable it in /proc/sys/kernel/ftrace_dump_on_oops before
> starting the test.
> 
> That should spill out the trace after crashing.
> 
> Thanks,
> 
>         tglx
> ---
> diff --git a/mm/highmem.c b/mm/highmem.c
> index b49364a306b8..461fe2c26107 100644
> --- a/mm/highmem.c
> +++ b/mm/highmem.c
> @@ -485,6 +485,7 @@ static inline bool kmap_high_unmap_local(unsigned long vaddr)
>  {
>  #ifdef ARCH_NEEDS_KMAP_HIGH_GET
>  	if (vaddr >= PKMAP_ADDR(0) && vaddr < PKMAP_ADDR(LAST_PKMAP)) {
> +		trace_printk("kunmap_high: %lx\n", vaddr);
>  		kunmap_high(pte_page(pkmap_page_table[PKMAP_NR(vaddr)]));
>  		return true;
>  	}
> @@ -520,6 +521,7 @@ void *__kmap_local_pfn_prot(unsigned long pfn, pgprot_t prot)
>  	preempt_disable();
>  	idx = arch_kmap_local_map_idx(kmap_local_idx_push(), pfn);
>  	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
> +	trace_printk("kmap_local_pfn: %d %lx\n", idx, (unsigned long) vaddr);
>  	BUG_ON(!pte_none(*(kmap_pte - idx)));
>  	pteval = pfn_pte(pfn, prot);
>  	set_pte_at(&init_mm, vaddr, kmap_pte - idx, pteval);
> @@ -545,8 +547,10 @@ void *__kmap_local_page_prot(struct page *page, pgprot_t prot)
>  
>  	/* Try kmap_high_get() if architecture has it enabled */
>  	kmap = arch_kmap_local_high_get(page);
> -	if (kmap)
> +	if (kmap) {
> +		trace_printk("kmap_local_high_get: %lx\n", (unsigned long) kmap);
>  		return kmap;
> +	}
>  
>  	return __kmap_local_pfn_prot(page_to_pfn(page), prot);
>  }
> @@ -578,6 +582,7 @@ void kunmap_local_indexed(void *vaddr)
>  
>  	preempt_disable();
>  	idx = arch_kmap_local_unmap_idx(kmap_local_idx(), addr);
> +	trace_printk("kunmap_local: %i %lx\n", idx, (unsigned long) vaddr);
>  	WARN_ON_ONCE(addr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
>  
>  	arch_kmap_local_pre_unmap(addr);
> 

The result could be seen at http://kernel.montjoie.ovh/129768.log
The log is 9Mb, but the ftrace dump seems not terminated, tell me if you need more.

Regards

WARNING: multiple messages have this Message-ID (diff)
From: Corentin Labbe <clabbe.montjoie@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: herbert@gondor.apana.org.au, linux-kernel@vger.kernel.org,
	mripard@kernel.org, wens@csie.org, linux-crypto@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: crypto: sun4i-ss: error with kmap
Date: Wed, 2 Dec 2020 20:55:01 +0100	[thread overview]
Message-ID: <20201202195501.GA29296@Red> (raw)
In-Reply-To: <87v9dlfthf.fsf@nanos.tec.linutronix.de>

On Tue, Dec 01, 2020 at 04:15:08PM +0100, Thomas Gleixner wrote:
> On Tue, Dec 01 2020 at 15:45, Corentin Labbe wrote:
> > On Tue, Dec 01, 2020 at 03:16:36PM +0100, Thomas Gleixner wrote:
> > In fact the warn was a bit later so I added:
> >        preempt_disable();
> >         idx = arch_kmap_local_unmap_idx(kmap_local_idx(), addr);
> > -       WARN_ON_ONCE(addr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
> > +       if (WARN_ON_ONCE(addr != __fix_to_virt(FIX_KMAP_BEGIN + idx)))
> > +               pr_err("kunmap_local: vaddr %lx\n", (unsigned long) vaddr);
> >  
> >         arch_kmap_local_pre_unmap(addr);
> >         pte_clear(&init_mm, addr, kmap_pte - idx);
> >
> > and this give kunmap_local: vaddr ffefe000
> 
> which looks like a valid one.
> 
> Can you apply the patch below and add 'ftrace_dump_on_oops' on the
> command line or enable it in /proc/sys/kernel/ftrace_dump_on_oops before
> starting the test.
> 
> That should spill out the trace after crashing.
> 
> Thanks,
> 
>         tglx
> ---
> diff --git a/mm/highmem.c b/mm/highmem.c
> index b49364a306b8..461fe2c26107 100644
> --- a/mm/highmem.c
> +++ b/mm/highmem.c
> @@ -485,6 +485,7 @@ static inline bool kmap_high_unmap_local(unsigned long vaddr)
>  {
>  #ifdef ARCH_NEEDS_KMAP_HIGH_GET
>  	if (vaddr >= PKMAP_ADDR(0) && vaddr < PKMAP_ADDR(LAST_PKMAP)) {
> +		trace_printk("kunmap_high: %lx\n", vaddr);
>  		kunmap_high(pte_page(pkmap_page_table[PKMAP_NR(vaddr)]));
>  		return true;
>  	}
> @@ -520,6 +521,7 @@ void *__kmap_local_pfn_prot(unsigned long pfn, pgprot_t prot)
>  	preempt_disable();
>  	idx = arch_kmap_local_map_idx(kmap_local_idx_push(), pfn);
>  	vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
> +	trace_printk("kmap_local_pfn: %d %lx\n", idx, (unsigned long) vaddr);
>  	BUG_ON(!pte_none(*(kmap_pte - idx)));
>  	pteval = pfn_pte(pfn, prot);
>  	set_pte_at(&init_mm, vaddr, kmap_pte - idx, pteval);
> @@ -545,8 +547,10 @@ void *__kmap_local_page_prot(struct page *page, pgprot_t prot)
>  
>  	/* Try kmap_high_get() if architecture has it enabled */
>  	kmap = arch_kmap_local_high_get(page);
> -	if (kmap)
> +	if (kmap) {
> +		trace_printk("kmap_local_high_get: %lx\n", (unsigned long) kmap);
>  		return kmap;
> +	}
>  
>  	return __kmap_local_pfn_prot(page_to_pfn(page), prot);
>  }
> @@ -578,6 +582,7 @@ void kunmap_local_indexed(void *vaddr)
>  
>  	preempt_disable();
>  	idx = arch_kmap_local_unmap_idx(kmap_local_idx(), addr);
> +	trace_printk("kunmap_local: %i %lx\n", idx, (unsigned long) vaddr);
>  	WARN_ON_ONCE(addr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
>  
>  	arch_kmap_local_pre_unmap(addr);
> 

The result could be seen at http://kernel.montjoie.ovh/129768.log
The log is 9Mb, but the ftrace dump seems not terminated, tell me if you need more.

Regards

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-12-02 19:56 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 13:01 crypto: sun4i-ss: error with kmap Corentin Labbe
2020-12-01 13:01 ` Corentin Labbe
2020-12-01 13:28 ` Thomas Gleixner
2020-12-01 13:28   ` Thomas Gleixner
2020-12-01 13:52   ` Corentin Labbe
2020-12-01 13:52     ` Corentin Labbe
2020-12-01 14:16     ` Thomas Gleixner
2020-12-01 14:16       ` Thomas Gleixner
2020-12-01 14:45       ` Corentin Labbe
2020-12-01 14:45         ` Corentin Labbe
2020-12-01 15:15         ` Thomas Gleixner
2020-12-01 15:15           ` Thomas Gleixner
2020-12-02 19:55           ` Corentin Labbe [this message]
2020-12-02 19:55             ` Corentin Labbe
2020-12-02 20:59             ` Thomas Gleixner
2020-12-02 20:59               ` Thomas Gleixner
2020-12-03 17:38               ` Corentin Labbe
2020-12-03 17:38                 ` Corentin Labbe
2020-12-03 23:34                 ` Thomas Gleixner
2020-12-03 23:34                   ` Thomas Gleixner
2020-12-03 23:34                   ` Thomas Gleixner
2020-12-04 13:26                   ` Corentin Labbe
2020-12-04 13:26                     ` Corentin Labbe
2020-12-04 15:08                     ` Thomas Gleixner
2020-12-04 15:08                       ` Thomas Gleixner
2020-12-04 19:27                       ` Corentin Labbe
2020-12-04 19:27                         ` Corentin Labbe
2020-12-04 20:58                         ` Thomas Gleixner
2020-12-04 20:58                           ` Thomas Gleixner
2020-12-05 18:43                           ` Corentin Labbe
2020-12-05 18:43                             ` Corentin Labbe
2020-12-05 19:48                             ` Thomas Gleixner
2020-12-05 19:48                               ` Thomas Gleixner
2020-12-05 19:48                               ` Thomas Gleixner
2020-12-05 20:16                               ` Julia Lawall
2020-12-05 20:16                                 ` Julia Lawall
2020-12-06 21:40                               ` Corentin Labbe
2020-12-06 21:40                                 ` Corentin Labbe
2020-12-07  0:15                                 ` Thomas Gleixner
2020-12-07  0:15                                   ` Thomas Gleixner
2020-12-07  0:15                                   ` Thomas Gleixner
2020-12-07 12:18                                   ` Corentin Labbe
2020-12-07 12:18                                     ` Corentin Labbe
2020-12-07 15:53                                     ` Thomas Gleixner
2020-12-07 15:53                                       ` Thomas Gleixner

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=20201202195501.GA29296@Red \
    --to=clabbe.montjoie@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mripard@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wens@csie.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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.