<div dir="ltr">Thanks! Just for clarification, should I create a new ticket for this specific bug and then add "Closes #XXXX" to the commit message?</div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 23, 2024 at 12:08 PM Joel Sherrill <<a href="mailto:joel@rtems.org">joel@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">This is a great explanation. Would you mind filing a ticket with this explanatino and referencing the ticket in the commit message of the patch?<br><br>When someone wonders about the change in the future, the ticket explanation will be useful</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 22, 2024 at 9:24 PM Matheus Pecoraro <<a href="mailto:matpecor@gmail.com" target="_blank">matpecor@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I kept getting a general protection fault whenever attempting to<br>
execute the amd64 BSP while preparing for my GSOC proposal.<br>
<br>
The GPF was being caused by an instruction attempting to move an SSE<br>
register to an address on the stack not aligned to 16 bytes. After<br>
some debugging I noticed that the code for setting up the stack frame<br>
for a context would result in it being misaligned by 8 bytes as to<br>
what is expected by the x86-64 SysV ABI, thus leading the compiler to<br>
unknowingly cause the exception (when control is transferred to the<br>
function entry point RSP+8 is supposed to be a multiple of 16, without<br>
this patch RSP itself was a multiple of 16).<br>
<br>
After the fix I was able to run the hello test on the amd64 BSP both<br>
while booting through the FreeBSD bootloader with no EFI boot services<br>
as well as through GRUB with multiboot2 and EFI boot services.<br>
<br>
Matheus Pecoraro (1):<br>
x86_64: Fix stack aligment for x86-64 SysV ABI<br>
<br>
bsps/x86_64/amd64/clock/eficlock.c | 28 ++-----------------<br>
bsps/x86_64/amd64/start/start.S | 1 -<br>
.../cpu/x86_64/x86_64-context-initialize.c | 4 +--<br>
3 files changed, 5 insertions(+), 28 deletions(-)<br>
<br>
-- <br>
2.43.0<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>
</blockquote></div>