<p>Damien Zammit has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/21219">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">cpu/x86/smm: Fix explicit 'addr32' usage in clang builds<br><br>The addr32 prefix is required by binutils, because even when<br>given an explicit address which is greater than 64KiB, it will<br>throw a warning about truncation, and stupidly emit the opcode<br>with a 16-bit addressing mode and the wrong address.<br><br>However, in the case of LLVM, this doesn't happen, and is happy<br>to just use 32-bit addressing whenever it may require it. This<br>means that LLVM never really needs an explicit addr32 prefix to<br>use 32-bit addressing in 16-bit mode.<br><br>Change-Id: Ia160d3f7da6653ea24c8229dc26f265e5f15aabb<br>Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net><br>Signed-off-by: Damien Zammit <damien@zamaudio.com><br>---<br>M src/cpu/x86/smm/smmrelocate.S<br>1 file changed, 12 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/21219/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/src/cpu/x86/smm/smmrelocate.S b/src/cpu/x86/smm/smmrelocate.S<br>index 4d388a9..22fbaea 100644<br>--- a/src/cpu/x86/smm/smmrelocate.S<br>+++ b/src/cpu/x86/smm/smmrelocate.S<br>@@ -112,7 +112,11 @@<br>       */<br> <br>        mov $0x38000 + 0x7efc, %ebx<br>+#if IS_ENABLED(CONFIG_COMPILER_LLVM_CLANG)<br>+     mov (%ebx), %al<br>+#else<br>       addr32 mov (%ebx), %al<br>+#endif<br>       cmp $0x64, %al<br>        je 1f<br> <br>@@ -124,7 +128,11 @@<br> smm_relocate:<br>        /* Get this CPU's LAPIC ID */<br>     movl $LAPIC_ID, %esi<br>+#if IS_ENABLED(CONFIG_COMPILER_LLVM_CLANG)<br>+    movl (%esi), %ecx<br>+#else<br>     addr32 movl (%esi), %ecx<br>+#endif<br>     shr  $24, %ecx<br> <br>     /* calculate offset by multiplying the<br>@@ -136,7 +144,11 @@<br>  movl $0xa0000, %eax<br>   subl %edx, %eax /* subtract offset, see above */<br> <br>+#if IS_ENABLED(CONFIG_COMPILER_LLVM_CLANG)<br>+     movl %eax, (%ebx)<br>+#else<br>     addr32 movl %eax, (%ebx)<br>+#endif<br> <br>  /* The next section of code is potentially southbridge specific */<br> <br></pre><p>To view, visit <a href="https://review.coreboot.org/21219">change 21219</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/21219"/><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: Ia160d3f7da6653ea24c8229dc26f265e5f15aabb </div>
<div style="display:none"> Gerrit-Change-Number: 21219 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Damien Zammit <damien@zamaudio.com> </div>