platform/x86/intel/ifs: Use generic microcode headers and functions
authorJithu Joseph <jithu.joseph@intel.com>
Thu, 17 Nov 2022 22:50:39 +0000 (14:50 -0800)
committerBorislav Petkov <bp@suse.de>
Sat, 19 Nov 2022 10:12:06 +0000 (11:12 +0100)
commitaa63e0fda85edf9a8431fc31a2b2d4f3f40592f9
tree653a143bac8d23abf683a81e3883e5543ddf48e4
parent8382fee3bb86526bde1bfb1a06834f056140e0dd
platform/x86/intel/ifs: Use generic microcode headers and functions

Existing implementation (broken) of IFS used a header format (for IFS
test images) which was very similar to microcode format, but didn’t
accommodate extended signatures. This meant same IFS test image had to
be duplicated for different steppings and the validation code in the
driver was only looking at the primary header parameters. Going forward,
IFS test image headers have been tweaked to become fully compatible with
the microcode format.

Newer IFS test image headers will use header version 2 in order to
distinguish it from microcode images and older IFS test images.

In light of the above, reuse struct microcode_header_intel directly in
the IFS driver and reuse microcode functions for validation and sanity
checking.

  [ bp: Massage commit message. ]

Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Sohil Mehta <sohil.mehta@intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20221117225039.30166-1-jithu.joseph@intel.com
arch/x86/include/asm/microcode_intel.h
drivers/platform/x86/intel/ifs/load.c