From: Stephen Hemminger <shemminger@osdl.org>
To: linux-kernel@vger.kernel.org
Subject: Re: Calling syscalls from x86-64 kernel results in a crash on Opteron machines
Date: Mon, 13 Sep 2004 09:41:48 -0700 [thread overview]
Message-ID: <20040913094148.45509d9c@dell_ss3.pdx.osdl.net> (raw)
In-Reply-To: <20040913161735.GC4180@dualathlon.random>
On Mon, 13 Sep 2004 18:17:36 +0200
Andrea Arcangeli <andrea@novell.com> wrote:
> Hi Constantine,
>
> On Mon, Sep 13, 2004 at 06:05:52PM +0300, Constantine Gavrilov wrote:
> > And BTW, kernel-space applications have their own place even if the
> > concept seems foreign to you.
>
> I avoided to do like i386 that inefficiently calls int 0x80 when you can
> call sys_read/sys_write etc.. by hand.
>
> the syscall is only meaningful if you're not in kernel space. Once
> you're in kernel space if you ever try to invoke a syscall again (either
> via int 0x80, syscall, sysenter, call gate, whatever) then you're just
> going slower than you should for no good reason.
>
> The only point of calling int 0x80 and friends is to change mode from
> user space to kernel space, and you're in kernel space already so you
> should just call sys_read/sys_write etc.. by hand which will not waste
> precious cycles and it'll be a lot simpler too.
>
> Note also that int 0x80 will bring you into the 32bit emulation layer,
> the only 64bit entry point is reacheable only via syscall.
>
> Hope this helps.
Actually, the fact that system calls work in kernel space I would consider
a BUG. The int 0x80 handler should oops or at least kill the offending
thread for security and robustness reasons.
--
Stephen Hemminger mailto:shemminger@osdl.org
Open Source Development Lab http://developer.osdl.org/shemminger
next prev parent reply other threads:[~2004-09-13 16:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-13 14:04 Constantine Gavrilov
2004-09-13 14:38 ` Christoph Hellwig
2004-09-13 15:05 ` Constantine Gavrilov
2004-09-13 16:17 ` Andrea Arcangeli
2004-09-13 16:41 ` Stephen Hemminger [this message]
2004-09-13 20:08 ` Andrea Arcangeli
2004-09-13 16:42 ` Greg KH
2004-09-13 17:21 ` Brian Gerst
2004-09-14 2:04 ` William Lee Irwin III
2004-09-13 14:44 ` Arnd Bergmann
2004-09-13 15:18 ` Constantine Gavrilov
2004-09-13 19:39 ` H. Peter Anvin
2004-09-13 15:00 ` Brian Gerst
2004-09-13 15:26 ` Constantine Gavrilov
[not found] <2DZQy-7TB-7@gated-at.bofh.it>
2004-09-13 14:31 ` Andi Kleen
2004-09-13 15:28 ` Constantine Gavrilov
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=20040913094148.45509d9c@dell_ss3.pdx.osdl.net \
--to=shemminger@osdl.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®