<p>Pratikkumar V Prajapati has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21007">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">soc/intel/skylake: Fix SGX init sequence.<br><br>Configure core PRMRR first on all the cores and then follow<br>the SGX init sequence. Second microcode load would run the<br>MCHECK. To pass MCHECK, PRMRR on all cores needs to be<br>configured first. Hence, PRMRR configuration would be called<br>from soc_core_init while MP init for each core and then from<br>soc_init_cpus, BSP would call sgx_configure for each core<br>(including for itself). This code flow satisfies the MCHECK<br>passing pre-conditions; and apparently this patch fixes the<br>behavior of calling configure_sgx() “again” for BSP. (So<br>removed the TODO comment also).<br><br>Change-Id: I88f330eb9757cdc3dbfc7609729c6ceb7d58a0e1<br>Signed-off-by: Pratik Prajapati <pratikkumar.v.prajapati@intel.com><br>---<br>M src/soc/intel/skylake/cpu.c<br>1 file changed, 3 insertions(+), 9 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/07/21007/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/soc/intel/skylake/cpu.c b/src/soc/intel/skylake/cpu.c<br>index 1a08191..e20e5a0 100644<br>--- a/src/soc/intel/skylake/cpu.c<br>+++ b/src/soc/intel/skylake/cpu.c<br>@@ -437,8 +437,8 @@<br>   /* Enable Turbo */<br>    enable_turbo();<br> <br>-   /* Configure SGX */<br>-  sgx_configure(microcode);<br>+    /* Configure Core PRMRR for SGX. */<br>+  prmrr_core_configure();<br> }<br> <br> static int adjust_apic_id(int index, int apic_id)<br>@@ -499,13 +499,7 @@<br>      /* Thermal throttle activation offset */<br>      configure_thermal_target();<br> <br>-       /*<br>-    * TODO: somehow calling configure_sgx() in cpu_core_init() is not<br>-    * successful on the BSP (other threads are fine). Have to run it again<br>-       * here to get SGX enabled on BSP. This behavior needs to root-caused<br>-         * and we shall not have this redundant call.<br>-         */<br>-  sgx_configure(microcode);<br>+    mp_run_on_all_cpus(sgx_configure, 2000);<br> }<br> <br> int soc_skip_ucode_update(u32 current_patch_id, u32 new_patch_id)<br></pre><p>To view, visit <a href="https://review.coreboot.org/21007">change 21007</a>. To unsubscribe, 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/21007"/><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: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I88f330eb9757cdc3dbfc7609729c6ceb7d58a0e1 </div>
<div style="display:none"> Gerrit-Change-Number: 21007 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Pratikkumar V Prajapati <pratikkumar.v.prajapati@intel.com> </div>