<p>Patrick Georgi <strong>merged</strong> this change.</p><p><a href="https://review.coreboot.org/27090">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  build bot (Jenkins): Verified
  Patrick Georgi: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">cbfstool/fit.c: Fix for older CPUs without total_size in mcu_header<br><br>Some older CPUs have a fixed size of 2048 bytes for microcode total size.<br><br>Change-Id: Ia50c087af41b0df14b607ce3c3b4eabc602e8738<br>Signed-off-by: Arthur Heymans <arthur@aheymans.xyz><br>Reviewed-on: https://review.coreboot.org/27090<br>Reviewed-by: Patrick Georgi <pgeorgi@google.com><br>Tested-by: build bot (Jenkins) <no-reply@coreboot.org><br>---<br>M util/cbfstool/fit.c<br>1 file changed, 7 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/util/cbfstool/fit.c b/util/cbfstool/fit.c</span><br><span>index e3e6c32..d33cb56 100644</span><br><span>--- a/util/cbfstool/fit.c</span><br><span>+++ b/util/cbfstool/fit.c</span><br><span>@@ -226,13 +226,18 @@</span><br><span> </span><br><span>                 mcu_header = rom_buffer_pointer(&image->buffer, current_offset);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+           /* Newer microcode updates include a size field, whereas older</span><br><span style="color: hsl(120, 100%, 40%);">+                 * containers set it at 0 and are exactly 2048 bytes long */</span><br><span style="color: hsl(120, 100%, 40%);">+          uint32_t total_size = mcu_header->total_size</span><br><span style="color: hsl(120, 100%, 40%);">+                       ? mcu_header->total_size : 2048;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>                /* Quickly sanity check a prospective microcode update. */</span><br><span style="color: hsl(0, 100%, 40%);">-              if (mcu_header->total_size < sizeof(*mcu_header))</span><br><span style="color: hsl(120, 100%, 40%);">+               if (total_size < sizeof(*mcu_header))</span><br><span>                     break;</span><br><span> </span><br><span>           /* FIXME: Should the checksum be validated? */</span><br><span>               mcus[num_mcus].offset = current_offset;</span><br><span style="color: hsl(0, 100%, 40%);">-         mcus[num_mcus].size = mcu_header->total_size;</span><br><span style="color: hsl(120, 100%, 40%);">+              mcus[num_mcus].size = total_size;</span><br><span> </span><br><span>                /* Proceed to next payload. */</span><br><span>               current_offset += mcus[num_mcus].size;</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/27090">change 27090</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/27090"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ia50c087af41b0df14b607ce3c3b4eabc602e8738 </div>
<div style="display:none"> Gerrit-Change-Number: 27090 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Arthur Heymans <arthur@aheymans.xyz> </div>
<div style="display:none"> Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com> </div>
<div style="display:none"> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> </div>