Page MenuHomeFreeBSD

Add tool to split Intel microcode into one file per Platform Id
ClosedPublic

Authored by emaste on May 14 2018, 7:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 6 2024, 4:53 PM
Unknown Object (File)
Mar 6 2024, 4:53 PM
Unknown Object (File)
Mar 6 2024, 4:53 PM
Unknown Object (File)
Mar 6 2024, 4:53 PM
Unknown Object (File)
Mar 6 2024, 4:53 PM
Unknown Object (File)
Mar 6 2024, 4:53 PM
Unknown Object (File)
Mar 5 2024, 3:27 PM
Unknown Object (File)
Dec 27 2023, 6:32 PM

Details

Summary

Initial proof of concept tool to split per-Family-Model-Stepping microcode update files into one file per PlatformId

We currently do not look at the extended signature

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Update model - family - stepping calculation

tools/tools/ucode-split/ucode-split.c
55

Doesn't actually return char *. Reset to void ?

67

Needs #include <string.h> for sprintf().

tools/tools/ucode-split/ucode-split.c
55

Oops, I meant to have it return buf.

tools/tools/ucode-split/ucode-split.c
33

Style: stdio.h isn't sorted correctly.

116

Is the intent here to create a single file per platform ID bit?

123

Style: extra space after sizeof.

131

Perhaps explicitly mask off the upper 24 bits?

142

resid might be a more idiomatic name.

156

Missing return.

tools/tools/ucode-split/ucode-split.c
67

sprintf(3) is prototyped in stdio.h.

92

Style: blank line.

150

It is also reasonable to check that we write as much as we asked for. E.g. on fs full you get the truncated write.

156

No, main() is implicitly terminated by return (0);.

emaste added inline comments.
tools/tools/ucode-split/ucode-split.c
67

but is needed for strlen

116

Well, a single file per blob in one ucode file, which in practice is per PlatformId bit.

emaste marked an inline comment as done.

Review feedback, clean up warnings, and handle older-style microcode files with zero for data_size or total_size.

pass the signature to format_signature, no need for the full header

tools/tools/ucode-split/ucode-split.c
116

In some cases there's a unique blob per PlatformId bit:

06-05-00.01
06-05-00.02
06-05-00.08

In some cases there's only one blob that supports multiple PlatformIds:

06-55-03.97

In some cases there are multiple blobs that each support multiple PlatformIds:

06-17-0a.11
06-17-0a.44
06-17-0a.a0

I think that I prefer to have this split as a mode of operations for cpucontrol(8).

Or add a loop into cpucontrol -u to try each blob from the file, instead of splitting into filesystem.

I think that I prefer to have this split as a mode of operations for cpucontrol(8).

That might be the eventual destination for this functionality. I put this up mainly for experimentation and so that @sbruno can try out things with the latest ucode drop.

This revision was not accepted when it landed; it landed in state Needs Review.May 15 2018, 9:51 PM
This revision was automatically updated to reflect the committed changes.