From: David Mosberger <davidm@napali.hpl.hp.com>
To: Zwane Mwaikambo <zwane@arm.linux.org.uk>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
William Lee Irwin III <wli@holomorphy.com>,
Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>,
Jens Axboe <axboe@suse.de>
Subject: Re: [PATCH][2.6] WARN_ON_STACK_VAR aka fighting variable lifetime bugs
Date: Mon, 11 Aug 2003 11:43:08 -0700 [thread overview]
Message-ID: <16183.58300.408086.272654@napali.hpl.hp.com> (raw)
In-Reply-To: <Pine.LNX.4.53.0308091430410.32166@montezuma.mastecende.com>
>>>>> On Sat, 9 Aug 2003 15:29:41 -0400 (EDT), Zwane Mwaikambo <zwane@arm.linux.org.uk> said:
Zwane> --- linux-2.6.0-test2-irq/include/asm-ia64/bug.h 30 Jul 2003 00:06:30 -0000 1.1.1.1
Zwane> +++ linux-2.6.0-test2-irq/include/asm-ia64/bug.h 9 Aug 2003 19:14:09 -0000
Zwane> +#define WARN_ON_STACK_VAR(ptr) do { \
Zwane> + unsigned long __ti = (unsigned long)current_thread_info(); \
Zwane> + WARN_ON((__ti & (unsigned long)(ptr)) == __ti); \
Zwane> +} while (0)
Note that on ia64 we don't use bit-masking to calculate the
task-pointer. Instead, thread-info follows the task structure. This
is done such that the task-structure, thread-info, and kernel stack
can be mapped by a single (pinned) TLB entry.
The correct check for a variable being on the stack of the current
task would be something like this:
((unsigned long)(ptr) - (unsigned long) current) < IA64_STK_OFFSET
(IA64_STK_OFFSET is declared by <asm/ptrace.h>).
Thanks,
--david
next prev parent reply other threads:[~2003-08-11 18:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-09 19:29 Zwane Mwaikambo
2003-08-09 19:33 ` Zwane Mwaikambo
2003-08-11 18:43 ` David Mosberger [this message]
2003-08-11 18:41 ` Zwane Mwaikambo
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=16183.58300.408086.272654@napali.hpl.hp.com \
--to=davidm@napali.hpl.hp.com \
--cc=B.Zolnierkiewicz@elka.pw.edu.pl \
--cc=axboe@suse.de \
--cc=davidm@hpl.hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wli@holomorphy.com \
--cc=zwane@arm.linux.org.uk \
/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
all inboxes | Powered by JetHome®