Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Apr 2026 19:56:38 +0000
From:      Lexi Winter <ivy@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 66f55b90b6bc - stable/15 - boot1.chrp: Improve comment for the SLOF hack
Message-ID:  <69f110f6.365c0.22666958@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by ivy:

URL: https://cgit.FreeBSD.org/src/commit/?id=66f55b90b6bcbbf3c26b2da7f56d17052e39018f

commit 66f55b90b6bcbbf3c26b2da7f56d17052e39018f
Author:     Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2026-04-17 16:56:33 +0000
Commit:     Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2026-04-28 19:56:21 +0000

    boot1.chrp: Improve comment for the SLOF hack
    
    Since this original comment was written, the actual issue in SLOF
    was diagnosed and documented in commit 424089a0fc, which fixed it
    for loader(8).  Update the comment in boot1 to be more informative
    to future readers.
    
    MFC after:      3 days
    Reviewed by:    jhibbits, adrian
    Sponsored by:   https://www.patreon.com/bsdivy
    Differential Revision:  https://reviews.freebsd.org/D56470
    
    (cherry picked from commit eb0279550d52962241b4178101cd7f7d732eb682)
---
 stand/powerpc/boot1.chrp/boot1.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/stand/powerpc/boot1.chrp/boot1.c b/stand/powerpc/boot1.chrp/boot1.c
index 1a546f3473e2..1bb06bf82983 100644
--- a/stand/powerpc/boot1.chrp/boot1.c
+++ b/stand/powerpc/boot1.chrp/boot1.c
@@ -102,14 +102,11 @@ ofwh_t bootdevh;
 ofwh_t stdinh, stdouth;
 
 /*
- * Note about the entry point:
+ * Our entrypoint.
  *
- * For some odd reason, the first page of the load appears to have trouble
- * when entering in LE. The first five instructions decode weirdly.
- * I suspect it is some cache weirdness between the ELF headers and .text.
- *
- * Ensure we have a gap between the start of .text and the entry as a
- * workaround.
+ * A bug in the SLOF shipped with some versions of QEMU causes the first
+ * 32 bytes of .text to be wrongly byte-swapped when loading LE programs.
+ * As a workaround, we add some padding at the start of the text section.
  */
 __asm("                         \n\
         .data                   \n\
@@ -118,7 +115,7 @@ stack:                          \n\
         .space  16384           \n\
                                 \n\
         .text                   \n\
-        /* SLOF cache hack */   \n\
+        /* SLOF workaround */   \n\
         .space 4096             \n\
         .globl  _start          \n\
 _start:                         \n\


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69f110f6.365c0.22666958>