From: andrea@cpushare.com
To: Chuck Ebbert <76306.1226@compuserve.com>
Cc: "bruce@andrew.cmu.edu" <bruce@andrew.cmu.edu>,
linux-kernel <linux-kernel@vger.kernel.org>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Arjan van de Ven <arjan@infradead.org>,
Adrian Bunk <bunk@stusta.de>, Lee Revell <rlrevell@joe-job.com>,
Linus Torvalds <torvalds@osdl.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] TIF_NOTSC and SECCOMP prctl
Date: Tue, 18 Jul 2006 15:29:41 +0200 [thread overview]
Message-ID: <20060718132941.GG5726@opteron.random> (raw)
In-Reply-To: <200607180623_MC3-1-C54F-3802@compuserve.com>
On Tue, Jul 18, 2006 at 06:20:20AM -0400, Chuck Ebbert wrote:
> AFAIC the /proc method of controlling seccomp is so ugly it should
> just go, but what about backwards compatibility?
Given that so far CPUShare seems the only user there should be no
problem, I already uploaded a new CPUShare package that handles both
the old and new interfaces transparently, no matter what kernel runs
under it.
> I have a couple of questions:
>
>
> +void disable_TSC(void)
> +{
> + if (!test_and_set_thread_flag(TIF_NOTSC))
> + /*
> + * Must flip the CPU state synchronously with
> + * TIF_NOTSC in the current running context.
> + */
> + hard_disable_TSC();
> +}
>
> This gets called from sys_prctl(). Do you need to worry about preemption
> between the test_and_set and TSC disable?
I tend to completely forget about preempt.
> Maybe these should be inline? They're really small and that way you
> don't need #ifdef around the code for them.
I wanted to reduce the bytecode overhead to the minimum when seccomp
is set to y, for that I tried to avoided inlines.
> For x86_64 you need this:
>
> ftp://ftp.firstfloor.org/pub/ak/x86_64/quilt-current/patches/tif-flags-for-debug-regs-and-io-bitmap-in-ctxsw
>
> But I don't think Andi plans on pushing it for 2.6.18.
Thanks for the pointer.
For now the patch I posted already works on x86-64 and on all other
archs (x86_64 misses the notsc feature for now, but that's not a
problem, the patch is self contained and we can take care of the notsc
for x86-64 later on).
This is the incremental patch to address the preempt=y kernel builds.
diff -r 373f0be00c40 arch/i386/kernel/process.c
--- a/arch/i386/kernel/process.c Sun Jul 16 15:51:54 2006 +0200
+++ b/arch/i386/kernel/process.c Tue Jul 18 14:59:23 2006 +0200
@@ -542,12 +542,14 @@ void hard_disable_TSC(void)
}
void disable_TSC(void)
{
+ preempt_disable();
if (!test_and_set_thread_flag(TIF_NOTSC))
/*
* Must flip the CPU state synchronously with
* TIF_NOTSC in the current running context.
*/
hard_disable_TSC();
+ preempt_enable();
}
void hard_enable_TSC(void)
{
next prev parent reply other threads:[~2006-07-18 13:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-18 10:20 [PATCH] TIF_NOTSC and SECCOMP prctl Chuck Ebbert
2006-07-18 13:29 ` andrea [this message]
2006-07-25 21:44 ` andrea
2006-07-26 8:07 ` Ingo Molnar
2006-07-26 11:45 ` andrea
-- strict thread matches above, loose matches on Subject: below --
2006-07-11 14:17 [patch] let CONFIG_SECCOMP default to n andrea
2006-07-11 14:32 ` Arjan van de Ven
2006-07-11 15:31 ` andrea
2006-07-11 16:24 ` Alan Cox
2006-07-12 15:43 ` Andi Kleen
2006-07-12 21:07 ` Ingo Molnar
2006-07-13 1:51 ` Andrew Morton
2006-07-13 7:44 ` James Bruce
2006-07-13 8:34 ` andrea
2006-07-13 9:18 ` Andrew Morton
2006-07-14 6:09 ` [PATCH] TIF_NOTSC and SECCOMP prctl andrea
2006-07-14 6:27 ` Andrew Morton
2006-07-14 6:33 ` andrea
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=20060718132941.GG5726@opteron.random \
--to=andrea@cpushare.com \
--cc=76306.1226@compuserve.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arjan@infradead.org \
--cc=bruce@andrew.cmu.edu \
--cc=bunk@stusta.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rlrevell@joe-job.com \
--cc=torvalds@osdl.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