x86/ucode/amd: Move verify_patch_size() into get_ucode_from_buffer_amd()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 30 Mar 2020 17:10:50 +0000 (18:10 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 1 Apr 2020 13:00:12 +0000 (14:00 +0100)
commit98eb0c994ca828da7f38f0ee04c57a0ae24068a5
treeee20cfda26c8dc729899227583e650bdc97102f7
parentf6fa65ad9bb2bb78683f69eeceb88dd513bd49ea
x86/ucode/amd: Move verify_patch_size() into get_ucode_from_buffer_amd()

We only stash the microcode blob size so it can be audited in
microcode_fits().  However, the patch size check depends only on the CPU
family.

Move the check earlier to when we are parsing the container, which avoids
caching bad microcode in the first place, and allows us to avoid storing the
size at all.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpu/microcode/amd.c