public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Gerst <bgerst@didntduck.org>
To: Constantine Gavrilov <constg@qlusters.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	bugs@x86-64.org, 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 13:21:32 -0400	[thread overview]
Message-ID: <4145D71C.9090209@didntduck.org> (raw)
In-Reply-To: <4145B750.6060900@qlusters.com>

Constantine Gavrilov wrote:

> Christoph Hellwig wrote:
> 
>> On Mon, Sep 13, 2004 at 05:04:17PM +0300, Constantine Gavrilov wrote:
>>  
>>
>>> Hello:
>>>
>>> We have a piece of kernel code that calls some system calls in kernel 
>>> context (
>>>   
>>
>>
>> Which you shouldn't do in the first place.
>>  
>>
> 
> Function kernel_thread() on i386 is implemented by putting the args to 
> appropriate regs and calling int 0x80, resulting in a system call 
> clone() on i386.

It's gone in 2.6, in favor of calling do_fork() directly.

> I have also found the "syscall" instruction in x86-64 kernel specific 
> code (it does not call _syscall() macros directly, though). So, 
> "shouldn't do" is a bit too strong.
> 
> What I am writing is an application, and not interface. As such, it is 
> not much different from its requierements from a user-space application. 
> If user-space application may call system calls, why a kernel space 
> application cannot?
> 
> And BTW, kernel-space applications have their own place even if the 
> concept seems foreign to you.

What are you trying to do that can't be done in user space?  The only 
possible reason for a kernel space app is for performance (like knfsd), 
at the cost of risking system stability and security.

--
				Brian Gerst


  parent reply	other threads:[~2004-09-13 17:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-13 14:04 Calling syscalls from x86-64 kernel results in a crash on Opteron machines 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
2004-09-13 20:08         ` Andrea Arcangeli
2004-09-13 16:42     ` Greg KH
2004-09-13 17:21     ` Brian Gerst [this message]
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=4145D71C.9090209@didntduck.org \
    --to=bgerst@didntduck.org \
    --cc=bugs@x86-64.org \
    --cc=constg@qlusters.com \
    --cc=hch@infradead.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