lkml.org 
[lkml]   [2022]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/5] x86/microcode/intel: Allow a late-load only if a min rev is specified
On Sat, Aug 13, 2022 at 10:38:23PM +0000, Ashok Raj wrote:

> The proposal here is an even simpler option. The criteria for a microcode to
> be a viable late-load candidate is that no CPUID or OS visible MSR features
> are removed with respect to an earlier version of the microcode.
>
> Pseudocode for late-load is as follows:
>
> if header.min_required_id == 0
> This is old format microcode, block late-load
> else if current_ucode_version < header.min_required_id
> Current version is too old, block late-load of this microcode.
> else
> OK to proceed with late-load.
>
> Any microcode that removes a feature will set the min_version to itself.
> This will enforce this microcode is not suitable for late-loading.
>
> The enforcement is not in hardware and limited to kernel loader enforcing
> the requirement. It is not required for early loading of microcode to
> enforce this requirement, since the new features are only
> evaluated after early loading in the boot process.
>
>
> Test cases covered:
>
> 1. With new kernel, attempting to load an older format microcode with the
> min_rev=0 should be blocked by kernel.
>
> [ 210.541802] microcode: Header MUST specify min version for late-load
>
> 2. New microcode with a non-zero min_rev in the header, but the specified
> min_rev is greater than what is currently loaded in the CPU should be
> blocked by kernel.
>
> 245.139828] microcode: Current revision 0x8f685300 is too old to update,
> must be at 0xaa000050 version or higher
>
> 3. New microcode with a min_rev < currently loaded should allow loading the
> microcode
>
> 4. Build initrd with microcode that has min_rev=0, or min_rev > currently
> loaded should permit early loading microcode from initrd.

What if any validation do you have to ensure min_rev does as promised?
That is, ucode can very easily lie about the number and still remove an
MSR or CPUID enumerated feature.

\
 
 \ /
  Last update: 2022-08-15 09:47    [W:0.154 / U:2.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site