]> git.baikalelectronics.ru Git - kernel.git/commit
x86, microcode, AMD: Simplify ucode verification
authorBorislav Petkov <borislav.petkov@amd.com>
Fri, 2 Dec 2011 17:02:17 +0000 (18:02 +0100)
committerBorislav Petkov <bp@amd64.org>
Wed, 14 Dec 2011 11:46:51 +0000 (12:46 +0100)
commitf1d2fa783f45e9b8dcda9de82eca309b29541133
tree470fa32a41f95430d1c918f411415ae3343334ad
parent55d144d87ff2e2ca0942cdb0a0c4c459bc836812
x86, microcode, AMD: Simplify ucode verification

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: Borislav Petkov <borislav.petkov@amd.com>
arch/x86/kernel/microcode_amd.c