From: Guenter Roeck <linux@roeck-us.net>
To: James Hogan <james.hogan@imgtec.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Justin Chen <justinpopo6@gmail.com>,
Justin Chen <justin.chen@broadcom.com>,
linux-mips@linux-mips.org, bcm-kernel-feedback-list@broadcom.com,
Ralf Baechle <ralf@linux-mips.org>
Subject: Re: Crash in -next due to 'MIPS: Add cacheinfo support'
Date: Fri, 10 Feb 2017 14:48:19 -0800 [thread overview]
Message-ID: <20170210224819.GA6552@roeck-us.net> (raw)
In-Reply-To: <20170210223932.GA9246@jhogan-linux.le.imgtec.org>
On Fri, Feb 10, 2017 at 10:39:32PM +0000, James Hogan wrote:
> >
> > > and essentially Justin's commit just made problem 1) to occur, but is
> > > not the root cause of the crash you are seeing?
> >
> > That would not necessarily be my conclusion. Of course, the code appears
> > to be heavily SMP related, so it may well be that it exposes some
> > problem associated with cache handling or support in non-SMP configurations.
> >
> > Of course, it might also be possible that there is a qemu problem somewhere
> > which only manifests itself on non-SMP mips images with Justin's commit
> > applied. That appears to be somewhat unlikely, though I have no hard data
> > supporting this guess.
> >
> > I'll do some more testing and try to find the actual crash location.
> > Tricky though since it almost looks like there is a not completely
> > initialized workqueue. Making things worse, the problem "goes away"
> > if I add some debug log into process_one_work(), meaning there may
> > be a heisenbug.
>
> cracked it by moving around an early return error. populate_cache()
> macro has multiple statements with no do while (0) around it. The
> c->scache.waysize condition in populate_cache_leaves then only
> conditionalises the first statement in the macro and in absense of l2
> (or l3 for that matter) it'll continue to write beyond the end of the
> array allocated in detect_cache_attributes(). Badness ensues.
>
Outch. Yes, after you mention it, the problem is easy to see.
> The SMP calls in arch/mips/kernel/cacheinfo.c file are pretty redundant
> too since all the cache info is read from the cpu info structures.
>
> I'll write a patch. Thanks for reporting Guenter!
>
Thank you for tracking it down!
Guenter
next prev parent reply other threads:[~2017-02-10 22:48 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-08 23:45 Crash in -next due to 'MIPS: Add cacheinfo support' Guenter Roeck
2017-02-10 0:01 ` Justin Chen
2017-02-10 4:50 ` Guenter Roeck
2017-02-10 9:40 ` James Hogan
2017-02-10 9:40 ` James Hogan
2017-02-10 10:39 ` James Hogan
2017-02-10 10:39 ` James Hogan
2017-02-10 17:46 ` Guenter Roeck
2017-02-10 19:15 ` Florian Fainelli
2017-02-10 22:11 ` Guenter Roeck
2017-02-10 22:39 ` James Hogan
2017-02-10 22:39 ` James Hogan
2017-02-10 22:43 ` Florian Fainelli
2017-02-10 22:48 ` Guenter Roeck [this message]
2017-02-10 13:30 ` Guenter Roeck
2017-02-10 23:01 ` [PATCH] MIPS: Fix cacheinfo overflow James Hogan
2017-02-10 23:01 ` James Hogan
2017-02-10 23:10 ` Justin Chen
2017-02-10 23:44 ` James Hogan
2017-02-10 23:44 ` James Hogan
2017-02-10 23:48 ` Justin Chen
2017-02-11 1:25 ` Guenter Roeck
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=20170210224819.GA6552@roeck-us.net \
--to=linux@roeck-us.net \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=f.fainelli@gmail.com \
--cc=james.hogan@imgtec.com \
--cc=justin.chen@broadcom.com \
--cc=justinpopo6@gmail.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox