I believe privilege level is determined by a couple bits in the descriptor. I/O privilege level is a bitmap, I think. The Intel/AMD manuals should have complete information. For "system" code (as opposed to "user" code), the OS development guys have got a lot of information:
http://wiki.osdev.org/Main_Page...maybe start with "Context switching" for this(?)...
Best,
Frank