Commit cfffbfeb authored by Borislav Petkov's avatar Borislav Petkov

x86/microcode/AMD: Clean up per-family patch size checks

Starting with family 0x15, the patch size verification is not needed
anymore. Thus get rid of the need to update this checking function with
each new family.

Keep the check for older families.
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: x86@kernel.org
Link: https://lkml.kernel.org/r/20181107170218.7596-5-bp@alien8.de
parent 3974b681
...@@ -183,27 +183,22 @@ static unsigned int verify_patch_size(u8 family, u32 patch_size, unsigned int si ...@@ -183,27 +183,22 @@ static unsigned int verify_patch_size(u8 family, u32 patch_size, unsigned int si
{ {
u32 max_size; u32 max_size;
if (family >= 0x15)
return min_t(u32, patch_size, size);
#define F1XH_MPB_MAX_SIZE 2048 #define F1XH_MPB_MAX_SIZE 2048
#define F14H_MPB_MAX_SIZE 1824 #define F14H_MPB_MAX_SIZE 1824
#define F15H_MPB_MAX_SIZE 4096
#define F16H_MPB_MAX_SIZE 3458
#define F17H_MPB_MAX_SIZE 3200
switch (family) { switch (family) {
case 0x10 ... 0x12:
max_size = F1XH_MPB_MAX_SIZE;
break;
case 0x14: case 0x14:
max_size = F14H_MPB_MAX_SIZE; max_size = F14H_MPB_MAX_SIZE;
break; break;
case 0x15:
max_size = F15H_MPB_MAX_SIZE;
break;
case 0x16:
max_size = F16H_MPB_MAX_SIZE;
break;
case 0x17:
max_size = F17H_MPB_MAX_SIZE;
break;
default: default:
max_size = F1XH_MPB_MAX_SIZE; WARN(1, "%s: WTF family: 0x%x\n", __func__, family);
return 0;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment