Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jul 2007 03:40:46 +0200
From:      "Attilio Rao" <attilio@freebsd.org>
To:        arch@freebsd.org
Subject:   [PATCH] LDT handling bugfixing
Message-ID:  <3bbf2fe10707031840p211bffcci915468975a348ead@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3bbf2fe10707031840p211bffcci915468975a348ead>