Skip to content
  • H. J. Lu's avatar
    [PATCH] i386/x86_64 segment register access update · fd51f666
    H. J. Lu authored
    
    
    The new i386/x86_64 assemblers no longer accept instructions for moving
    between a segment register and a 32bit memory location, i.e.,
    
            movl (%eax),%ds
            movl %ds,(%eax)
    
    To generate instructions for moving between a segment register and a
    16bit memory location without the 16bit operand size prefix, 0x66,
    
            mov (%eax),%ds
            mov %ds,(%eax)
    
    should be used. It will work with both new and old assemblers. The
    assembler starting from 2.16.90.0.1 will also support
    
            movw (%eax),%ds
            movw %ds,(%eax)
    
    without the 0x66 prefix. I am enclosing patches for 2.4 and 2.6 kernels
    here. The resulting kernel binaries should be unchanged as before, with
    old and new assemblers, if gcc never generates memory access for
    
                   unsigned gsindex;
                   asm volatile("movl %%gs,%0" : "=g" (gsindex));
    
    If gcc does generate memory access for the code above, the upper bits
    in gsindex are undefined and the new assembler doesn't allow it.
    
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    fd51f666