From: James Hogan <james.hogan@imgtec.com>
To: "Maciej W. Rozycki" <macro@linux-mips.org>,
Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Ralf Baechle <ralf@linux-mips.org>,
David Daney <david.daney@cavium.com>, <linux-mips@linux-mips.org>,
<linux-kernel@vger.kernel.org>,
Hemmo Nieminen <hemmo.nieminen@iki.fi>, <stable@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] MIPS: fix kernel lockup or crash after CPU offline/online
Date: Fri, 30 Jan 2015 14:59:57 +0000 [thread overview]
Message-ID: <54CB9C6D.1080506@imgtec.com> (raw)
In-Reply-To: <alpine.LFD.2.11.1501301242080.28301@eddie.linux-mips.org>
[-- Attachment #1: Type: text/plain, Size: 1535 bytes --]
On 30/01/15 12:47, Maciej W. Rozycki wrote:
> On Fri, 30 Jan 2015, James Hogan wrote:
>
>>> Hmm, why can a call to `printk' cause a TLB miss, what's so special about
>>> this function? Does it use kernel mapped addresses for any purpose such
>>> as `vmalloc'?
>>
>> It would be the fact netconsole (or whatever other console is in use) is
>> built as a kernel module, memory for which is allocated from the vmalloc
>> area.
>
> Ah, I see, thanks for enlightening me. But in that case wouldn't it be
> possible to postpone console output from `printk' until it is safe to
> access the device? In a manner similar to how for example we handle calls
> to `printk' made from the hardirq context. That would make things less
> fragile.
Hmm, kernel/printk/printk.c does have:
static inline int can_use_console(unsigned int cpu)
{
return cpu_online(cpu) || have_callable_console();
}
which should prevent it dumping printk buffer to console. CPU shouldn't
be marked online that early, which suggests that the console has the
CON_ANYTIME flag set, which it probably shouldn't if it depends on
module code. call_console_drivers() seems to ensure the CPU is online or
has CON_ANYTIME before calling the console write callback.
A quick glance and I can't see any evidence of netconsole being able to
get CON_ANYTIME.
serial8250_console does appear to set that flag *and* is tristate
though, which is slightly worrying.
Aaro, what is the content of your /proc/consoles?
Cheers
James
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-01-30 14:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-15 21:01 [PATCH v2 1/2] MIPS: OCTEON: fix kernel crash when offlining a CPU Aaro Koskinen
2015-01-15 21:01 ` [PATCH v2 2/2] MIPS: fix kernel lockup or crash after CPU offline/online Aaro Koskinen
2015-01-30 9:25 ` Maciej W. Rozycki
2015-01-30 10:22 ` James Hogan
2015-01-30 12:47 ` Maciej W. Rozycki
2015-01-30 14:59 ` James Hogan [this message]
2015-01-30 17:55 ` Aaro Koskinen
2015-01-30 18:23 ` James Hogan
2015-01-30 18:53 ` Maciej W. Rozycki
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=54CB9C6D.1080506@imgtec.com \
--to=james.hogan@imgtec.com \
--cc=aaro.koskinen@iki.fi \
--cc=david.daney@cavium.com \
--cc=hemmo.nieminen@iki.fi \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=macro@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=stable@vger.kernel.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