From: BlaisorBlade <blaisorblade_spam@yahoo.it>
To: Gerd Knorr <kraxel@bytesex.org>
Cc: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] [patch] host-skas3 for 2.6.9-rc2
Date: Mon, 20 Sep 2004 20:34:20 +0200 [thread overview]
Message-ID: <200409202034.20779.blaisorblade_spam@yahoo.it> (raw)
In-Reply-To: <20040920153737.GA9823@bytesex>
On Monday 20 September 2004 17:37, Gerd Knorr wrote:
> > Without the SKAS patch, init_new_context does not call
> > arch_pick_mmap_layout(), so it should not after ( and init_new_context
> > calls, actually, init_new_empty_context()). I think that the proper place
> > to add the call is open_proc_mm(). Do you agree on this?
>
> Sounds ok, changed that, tested, works, new version below.
Yes, agreed.
> There is
> also another fix in enter_lazy_tlb()
In switch_mm, actually.
> : use the per_cpu() macro (also
> new in 2.6.9-rc I think).
Ah, yes, that is the only change which I had made when porting the SKAS patch
to 2.6.9, while fixing the reject below. Basically, what we do is to make
sure that the BUG_ON check that we remove cannot be triggered; that check is
done if prev == next, so we must make sure to give to "prev" the value that
"next" is supposed to have.
The reason is that with PTRACE_SWITCH_MM a thread can be scheduled away while
having one MM and rescheduled while having a new MM; and if when it's
scheduled away, a kernel thread goes executing, the kernel thread (using a
lazy TLB) will keep using the old MM, the one switched away with
PTRACE_SWITCH_MM, and the one you get with per_cpu(...). The "prev" and
"next" args, instead, come from current->mm, so prev is wrong (the kernel
code didn't notice that current->mm has changed). However, this can only be
triggered on SMP, when the ptracing thread (the UML kernel thread) executes
on a different CPU than the userspace thread.
Bye
--
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
prev parent reply other threads:[~2004-09-20 18:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200409122004.41777.blaisorblade_spam@yahoo.it>
[not found] ` <20040913144250.GA17259@bytesex>
[not found] ` <200409132130.00661.blaisorblade_spam@yahoo.it>
[not found] ` <20040915144213.GA32509@bytesex>
[not found] ` <20040916110323.GB12785@bytesex>
2004-09-16 13:39 ` [uml-devel] [patch] host-skas3 for 2.6.9-rc2 Gerd Knorr
2004-09-18 16:56 ` BlaisorBlade
[not found] ` <20040920153737.GA9823@bytesex>
2004-09-20 18:34 ` BlaisorBlade [this message]
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=200409202034.20779.blaisorblade_spam@yahoo.it \
--to=blaisorblade_spam@yahoo.it \
--cc=kraxel@bytesex.org \
--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