From: George Koehler Subject: macppc ofwboot: fix the instruction cache To: tech@openbsd.org Date: Sat, 6 Jul 2024 01:54:32 -0400 On 2022-04-26 and again on 2024-07-01, my PowerBook G4 failed to boot a kernel. Both kernels trapped early into ddb. Both kernels worked after a reorder, but I kept a copy of each kernel in the broken order. In May 2022, I fixed my 1st bad kernel by modifying ofwboot to fix the instruction cache. This week, my 2nd bad kernel needed the same fix (which I had never committed). I adapted this fix from NetBSD's ofwboot. ok to commit? --gkoehler Index: arch/macppc/stand//conf.c =================================================================== RCS file: /cvs/src/sys/arch/macppc/stand/conf.c,v diff -u -p -r1.14 conf.c --- arch/macppc/stand//conf.c 30 Jan 2021 14:37:01 -0000 1.14 +++ arch/macppc/stand//conf.c 6 Jul 2024 05:31:11 -0000 @@ -21,7 +21,7 @@ #include -const char version[] = "1.11"; +const char version[] = "1.12"; extern int debug; void ofc_probe(struct consdev *); Index: arch/macppc/stand//main.c =================================================================== RCS file: /cvs/src/sys/arch/macppc/stand/main.c,v diff -u -p -r1.13 main.c --- arch/macppc/stand//main.c 23 Feb 2023 19:48:22 -0000 1.13 +++ arch/macppc/stand//main.c 6 Jul 2024 05:31:11 -0000 @@ -212,6 +212,7 @@ run_loadfile(uint64_t *marks, int howto) OF_release((void*)lastpage, CLAIM_LIMIT - lastpage); } + syncicache((void *)entry, (size_t)ssym - entry); chain((void *)entry, bootline, ssym, esym); _rtt();