• H. Peter Anvin's avatar
    x86-32: Handle exception table entries during early boot · 4c5023a3
    H. Peter Anvin authored
    If we get an exception during early boot, walk the exception table to
    see if we should intercept it.  The main use case for this is to allow
    rdmsr_safe()/wrmsr_safe() during CPU initialization.
    
    Since the exception table is currently sorted at runtime, and fairly
    late in startup, this code walks the exception table linearly.  We
    obviously don't need to worry about modules, however: none have been
    loaded at this point.
    
    This patch changes the early IDT setup to look a lot more like x86-64:
    we now install handlers for all 32 exception vectors.  The output of
    the early exception handler has changed somewhat as it directly
    reflects the stack frame of the exception handler, and the stack frame
    has been somewhat restructured.
    
    Finally, centralize the code that can and should be run only once.
    
    [ v2: Use early_fixup_exception() instead of linear search ]
    Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
    Link: http://lkml.kernel.org/r/1334794610-5546-6-git-send-email-hpa@zytor.com
    4c5023a3
head_32.S 18 KB