[PATCH] LDT handling bugfixing
Attilio Rao
attilio at freebsd.org
Wed Jul 4 01:40:48 UTC 2007
Hello,
Here there is a patch I'd like more people could test out before to commit.
This basically addresses 2 problems tegge pointed out to me about
actual ia32 LDT handlings affecting i386_ldt_grow and set_user_ldt_rv:
- Basically, when an LDT entry is updated in the struct proc_ldt of
the specified process, what happens is that old entry is freed before
the entries in the gdt and the ldtr are updated. This can have huge
consequences in particular on SMP environments.
- Currently when ldt changes for a proc running on a particular CPU,
other threads sharing the same ldt, running on other CPUs, need to
update their entries too. Unfortunalty, current code assumes that
thread which can share LDT are all in the same process, which is not
entirely correct since it doesn't take in account process creating
with rfork() where parent and child shares the same VM.
This patch should address these two problems and doing a cleanup
switching the usage of refcnt interface to use the old-style refcount
which is faster for this case.
kib alredy reviewed the patch, and other reviews are not only welcome
but encouraged. I'm looking, in particular, for people testing at it,
in particular if they can run linuxthreads library:
http://users.gufi.org/~rookie/works/patches/smpng07032007.diff
Thanks,
Attilio
--
Peace can only be achieved by understanding - A. Einstein
More information about the freebsd-arch
mailing list