From: Andrew Morton <akpm@osdl.org>
To: Fernando Luis Vazquez Cao <fernando@intellilink.co.jp>
Cc: ebiederm@xmission.com, ak@suse.de, vgoyal@in.ibm.com,
linux-kernel@vger.kernel.org, fastboot@lists.osdl.org
Subject: Re: [PATCH 1/5] stack overflow safe kdump (2.6.16-rc1-i386) - safe_smp_processor_id
Date: Tue, 24 Jan 2006 23:10:52 -0800 [thread overview]
Message-ID: <20060124231052.7c9fcbec.akpm@osdl.org> (raw)
In-Reply-To: <1138171868.2370.62.camel@localhost.localdomain>
Fernando Luis Vazquez Cao <fernando@intellilink.co.jp> wrote:
>
> On the event of a stack overflow critical data that usually resides at
> the bottom of the stack is likely to be stomped and, consequently, its
> use should be avoided.
>
> In particular, in the i386 and IA64 architectures the macro
> smp_processor_id ultimately makes use of the "cpu" member of struct
> thread_info which resides at the bottom of the stack. x86_64, on the
> other hand, is not affected by this problem because it benefits from
> the use of the PDA infrastructure.
>
> To circumvent this problem I suggest implementing
> "safe_smp_processor_id()" (it already exists in x86_64) for i386 and
> IA64 and use it as a replacement for smp_processor_id in the reboot path
> to the dump capture kernel. This is a possible implementation for i386.
>
> ...
>
> +int safe_smp_processor_id(void) {
Please fix coding style.
> #endif
>
> +extern int safe_smp_processor_id(void);
> extern int __cpu_disable(void);
> extern void __cpu_die(unsigned int cpu);
> #endif /* !__ASSEMBLY__ */
>
> #else /* CONFIG_SMP */
>
> +#define safe_smp_processor_id() 0
> #define cpu_physical_id(cpu) boot_cpu_physical_apicid
It assumes that all x86 SMP machines have APICs. That's untrue of Voyager.
I think we can probably live with this assumption - others would know
better than I.
next prev parent reply other threads:[~2006-01-25 7:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-25 6:51 [PATCH 1/5] stack overflow safe kdump (2.6.16-rc1-i386) - safe_smp_processor_id Fernando Luis Vazquez Cao
2006-01-25 7:10 ` Andrew Morton [this message]
2006-01-25 7:53 ` Andi Kleen
2006-01-25 7:59 ` Andrew Morton
2006-01-25 8:07 ` Arjan van de Ven
2006-01-25 8:50 ` Fernando Luis Vazquez Cao
2006-01-25 10:27 ` Eric W. Biederman
2006-01-25 9:41 ` Andi Kleen
2006-01-25 10:23 ` Eric W. Biederman
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=20060124231052.7c9fcbec.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=ak@suse.de \
--cc=ebiederm@xmission.com \
--cc=fastboot@lists.osdl.org \
--cc=fernando@intellilink.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=vgoyal@in.ibm.com \
/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.