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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Update model - family - stepping calculation

tools/tools/ucode-split/ucode-split.c
54 ↗(On Diff #42546)

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

66 ↗(On Diff #42546)

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

tools/tools/ucode-split/ucode-split.c
54 ↗(On Diff #42546)

Oops, I meant to have it return buf.

tools/tools/ucode-split/ucode-split.c
32 ↗(On Diff #42546)

Style: stdio.h isn't sorted correctly.

115 ↗(On Diff #42546)

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

122 ↗(On Diff #42546)

Style: extra space after sizeof.

130 ↗(On Diff #42546)

Perhaps explicitly mask off the upper 24 bits?

141 ↗(On Diff #42546)

resid might be a more idiomatic name.

155 ↗(On Diff #42546)

Missing return.

tools/tools/ucode-split/ucode-split.c
66 ↗(On Diff #42546)

sprintf(3) is prototyped in stdio.h.

91 ↗(On Diff #42546)

Style: blank line.

149 ↗(On Diff #42546)

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.

155 ↗(On Diff #42546)

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

emaste added inline comments.
tools/tools/ucode-split/ucode-split.c
66 ↗(On Diff #42546)

but is needed for strlen

115 ↗(On Diff #42546)

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
115 ↗(On Diff #42546)

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.