[Lguest] [PATCH RFC/RFB] x86_64, i386: interrupt dispatch changes

Ingo Molnar mingo at elte.hu
Thu Nov 6 20:15:48 EST 2008


* Jeremy Fitzhardinge <jeremy at goop.org> wrote:

> Why are the accesses locked?  Is it because it does an update of the 
> accessed bit in the descriptor?  (We should be pre-setting them all 
> anyway.)

yes, the accessed bit in the segment descriptor has to be updated in 
an atomic transaction: the CPU has to do a MESI coherent 
read+compare+write transaction, without damaging other updates to the 
6 bytes segment descriptor.

Old OSs implemented paging to disk by swapping out segments based on 
the accessed bit, and clearing the present and accessed bit when the 
segment is swapped out.

But given that all our GDT entries have the accessed bit set on Linux, 
there's no physical reason why the CPU should be using a locked cycle 
here - only to stay compatible with ancient stuff.

So ... that notion just survived in the backwards-compatibility stream 
of CPU enhancements, over the past 10 years.

On 64-bit Linux there's no reason to maintain that principle, so i'd 
expect future CPUs to relax this even more, were it ever to show up on 
the performance radar. Note that SYSCALL/SYSRET already optimize that 
away.

	Ingo



More information about the Lguest mailing list