<p>Furquan Shaikh has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/29555">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">arch/x86: Fix car_active for CONFIG_NO_CAR_GLOBAL_MIGRATION<br><br>Change 76ab2b7 ("arch/x86: allow global .bss objects without<br>CAR_GLOBAL") allowed use of global .bss objects and hence moved around<br>the macros resulting in car_active returning 0 even for those boards<br>where CAR is actually active but do not require global migration. This<br>resulted in boards getting stuck when doing a reset in verstage because<br>the code flow incorrectly assumed that there was no CAR active and<br>hence triggered a cache invalidate.<br><br>This change fixes the above issue by returning 1 for car_active if<br>ENV_CACHE_AS_RAM is set even if global migration is not required.<br><br>BUG=b:109717603<br>TEST=Verified that board reset does not trigger cache invalidate in<br>verstage and does not result in board hang.<br><br>Change-Id: I182f3e4277c57d6c50f7fcac2be72514896b3c61<br>Signed-off-by: Furquan Shaikh <furquan@google.com><br>---<br>M src/arch/x86/include/arch/early_variables.h<br>1 file changed, 17 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/29555/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/arch/x86/include/arch/early_variables.h b/src/arch/x86/include/arch/early_variables.h</span><br><span>index e95a45c..68cb9ff 100644</span><br><span>--- a/src/arch/x86/include/arch/early_variables.h</span><br><span>+++ b/src/arch/x86/include/arch/early_variables.h</span><br><span>@@ -79,12 +79,28 @@</span><br><span> }</span><br><span> </span><br><span> #else</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * We might end up here if:</span><br><span style="color: hsl(120, 100%, 40%);">+ * 1. ENV_CACHE_AS_RAM is not set for the stage or</span><br><span style="color: hsl(120, 100%, 40%);">+ * 2. ENV_CACHE_AS_RAM is set for the stage but CONFIG_NO_CAR_GLOBAL_MIGRATION</span><br><span style="color: hsl(120, 100%, 40%);">+ * is also set. In this case, there is no need to migrate CAR global</span><br><span style="color: hsl(120, 100%, 40%);">+ * variables. But, since we might still be running out of CAR, car_active needs</span><br><span style="color: hsl(120, 100%, 40%);">+ * to return 1 if ENV_CACHE_AS_RAM is set.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> #define CAR_GLOBAL</span><br><span> static inline void *car_get_var_ptr(void *var) { return var; }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#if ENV_CACHE_AS_RAM</span><br><span style="color: hsl(120, 100%, 40%);">+static inline int car_active(void) { return 1; }</span><br><span style="color: hsl(120, 100%, 40%);">+#else</span><br><span> static inline int car_active(void) { return 0; }</span><br><span style="color: hsl(120, 100%, 40%);">+#endif /* ENV_CACHE_AS_RAM */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> #define car_get_var(var) (var)</span><br><span> #define car_sync_var(var) (var)</span><br><span> #define car_set_var(var, val) (var) = (val)</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(120, 100%, 40%);">+#endif /* ENV_CACHE_AS_RAM && !IS_ENABLED(CONFIG_NO_CAR_GLOBAL_MIGRATION) */</span><br><span> </span><br><span> #endif</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/29555">change 29555</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/29555"/><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: I182f3e4277c57d6c50f7fcac2be72514896b3c61 </div>
<div style="display:none"> Gerrit-Change-Number: 29555 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Furquan Shaikh <furquan@google.com> </div>