From: Octavian Purdila <tavi@cs.pub.ro>
To: Christopher Li <sparse@chrisli.org>
Cc: Codrin Alexandru Grajdeanu <grcodal@gmail.com>,
linux-sparse@vger.kernel.org
Subject: Re: Interrupt context
Date: Tue, 25 Mar 2008 03:34:30 +0200 [thread overview]
Message-ID: <200803250334.30713.tavi@cs.pub.ro> (raw)
In-Reply-To: <70318cbf0803241400m46d30098g85a402e6e0f86130@mail.gmail.com>
On Monday 24 March 2008, Christopher Li wrote:
>
> I don't think two pass is enough. You need to build the call graph
> for pretty much every function. Because the irq handler function might
> call other function which calls other function which calls schedule().
>
> I don't think you can go very far without doing any control flow
> and data flow analyze. e.g. kmalloc() can go to sleep or not depend
> on the allocation flag (GFP_ATOMIC).
>
> Which points back to the proposal of:
> a) allow sparse to access function from different files.
> b) building the call graph for every function in the kernel.
>
Hi Chris,
Yes, you are right, we need to have the complete call graph of the whole
kernel and kernel modules we want to check. We developed a prototype
some time ago, but we never manage to move from the prototype to something
that could be used out in the real world.
The idea which we explored for the prototype was to serialize the sparse state
and save it into the object files in a private section. The linker would than
take care of aggregating the sparse state into the kernel image or kernel
modules. The second stage loads the saved state, create the call graph,
propagate the interrupt/softirq context around and finally check if schedule
was called from interrupt context -- the check itself was really broad as we
did not do any data flow analysis.
The nice thing about this approach is that at least in theory would allow all
sorts of global analysis, not only this particular (sleeping in interrupt)
check. And we actually started with the idea of using sparse itself to
generate the serializer, but we ended up patching the generate code
manually - we abandoned the idea of adding sparse annotations to sparse code
to get things right as we realized that we are moving away from our goal.
But, what we obtain after the first stage was a vmlinux over 2GB in size,
which could not be processed by ELF utilities (we assumed that we hit some
limitations in the ELF32 format). So in the end its not so practical.
For this second try, we were thinking about replacing the serializer with a
thiner layer which would just save the call graph information together with
the associated interrupt context function / sleeping function attributes in
the object files.
Any comments / suggestions are greatly appreciated.
Thanks,
tavi
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
next prev parent reply other threads:[~2008-03-25 1:47 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-23 21:44 Interrupt context Codrin Alexandru Grajdeanu
2008-03-24 21:00 ` Christopher Li
2008-03-25 1:34 ` Octavian Purdila [this message]
2008-03-25 2:57 ` Christopher Li
2008-03-26 12:43 ` Octavian Purdila
2008-03-26 21:53 ` Christopher Li
[not found] <CA+bLfK5FPqFvU2xy7xKdV4LkAvmY6GAPFrB-4UBzn-cOunQ6Xg@mail.gmail.com>
2012-10-05 8:51 ` interrupt context Iain Fraser
2012-10-05 9:32 ` Borislav Petkov
2012-10-05 10:20 ` Iain Fraser
2012-10-05 10:34 ` Borislav Petkov
2012-10-05 13:27 ` Theodore Ts'o
2012-10-05 14:03 ` Iain Fraser
2012-10-05 18:05 ` anish kumar
2012-10-05 18:15 ` Iain Fraser
-- strict thread matches above, loose matches on Subject: below --
2003-04-14 18:51 Jeremy Hall
2003-04-14 18:56 ` Robert Love
2003-04-14 19:32 ` Jeremy Hall
2003-04-14 19:35 ` Robert Love
2003-04-14 21:09 ` Jeremy Hall
2003-04-14 21:18 ` Robert Love
2003-04-14 21:48 ` Jeremy Hall
2003-04-14 22:57 ` Robert Love
2003-04-15 3:44 ` Jeremy Hall
2003-04-15 4:14 ` Jeremy Hall
2003-04-15 21:40 ` Robert Love
2003-04-15 23:02 ` Jeremy Hall
2003-04-16 3:41 ` Jeremy Hall
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=200803250334.30713.tavi@cs.pub.ro \
--to=tavi@cs.pub.ro \
--cc=grcodal@gmail.com \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.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.