• Borislav Petkov's avatar
    x86, microcode, AMD: Simplify ucode verification · be62adb4
    Borislav Petkov authored
    Basically, what we did until now is take out a chunk of the firmware
    image, vmalloc space for it and inspect it before application. And
    repeat.
    
    This patch changes all that so that we look at each ucode patch from
    the firmware image, check it for sanity and copy it to local buffer for
    application only once and if it passes all checks. Thus, vmalloc-ing for
    each piece is gone, we can do proper size checking only of the patch
    which is destined for the CPU of the current machine instead of each
    single patch, which is clearly wrong.
    
    Oh yeah, simplify and cleanup the code while at it, along with adding
    comments as to what actually happens.
    Signed-off-by: default avatarBorislav Petkov <borislav.petkov@amd.com>
    be62adb4
microcode_amd.c 8.27 KB