linux-um archives
 help / color / mirror / Atom feed
From: Blaisorblade <blaisorblade@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net
Cc: Alex LIU <alex.liu@st.com>
Subject: Re: [uml-devel] Segmentation fault with kernel thread in UML-2.6.7 TT mode
Date: Fri, 15 Jul 2005 20:25:00 +0200	[thread overview]
Message-ID: <200507152025.01288.blaisorblade@yahoo.it> (raw)
In-Reply-To: <001401c58923$f6dee2b0$9eb3c68a@SHZ.ST.COM>

On Friday 15 July 2005 11:59, Alex LIU wrote:
> Hi,all:

> I just modified the kernel thread function in UML 2.6.7 tt mode. I want the
> kernel thread go to the user space after finished the kernel function
> rather than exit. It's just like a system call return or a return from
> fork...
Hmm, but where's the caller to return? In most cases it won't exist.

I don't understand what's your purpose, and the behaviour you'd want to 
reproduce. Sorry, but *which* userspace should it go to? What you're 
modifying is the execution path of kernel_thread. Now, let's take a call to 
kernel_thread from the initial thread, before init is executed, or a similar 
situation (ksoftirqd and such things must surely be kernel_thread'ed from 
somewhere). Where should it continue? Neither in kernel code because it's now 
hidden (or it should be, anyhow this isn't supposed to work), nor in 
userspace code because no one has been specified.

Now, surely, there are cases where a userspace context will exist. For 
instance, modprobe <some module spawning a kernel thread in initialization>, 
or mount ext3/reiserfs fs. In both cases, the kernel code will spawn a kernel 
thread; but the userspace caller will already have continued with the system 
call return code when the kernel thread exits (or, probably, the caller will 
have died).

> But now the problem is that there will be segmentation fault just before
> the kernel thread go to the user space. After tracing I found when the
> segmentation fault occur, in handle_page_fault function, (!(vma->vm_flags &
> VM_GROWSDOWN)) is true and the err is -14. What's the meaning of such
> value?

Look up in errno headers (/usr/include/asm/errno.h and dependencies). It's 
EFAULT, which makes sense. No userspace program, so no mapping to use and no 
registers to execute.
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  reply	other threads:[~2005-07-17  4:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-15  9:59 [uml-devel] Segmentation fault with kernel thread in UML-2.6.7 TT mode Alex LIU
2005-07-15 18:25 ` Blaisorblade [this message]
2005-07-17  7:52   ` Alex LIU
2005-07-17 14:09     ` Jeff Dike
2005-08-12 18:38     ` Blaisorblade

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=200507152025.01288.blaisorblade@yahoo.it \
    --to=blaisorblade@yahoo.it \
    --cc=alex.liu@st.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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