svn commit: r341422 - head/sys/powerpc/booke

Justin Hibbits jhibbits at FreeBSD.org
Mon Dec 3 04:47:29 UTC 2018


Author: jhibbits
Date: Mon Dec  3 04:47:28 2018
New Revision: 341422
URL: https://svnweb.freebsd.org/changeset/base/341422

Log:
  powerpc/booke: Check for the metadata address by physical address
  
  The metadata pointer will almost never be at or above 'btext', as btext is a
  relocated symbol, so will be based at VM_MIN_KERNEL_ADDRESS, not at
  KERNBASE.  Check the address against kernload, where the kernel is
  physically loaded.

Modified:
  head/sys/powerpc/booke/booke_machdep.c

Modified: head/sys/powerpc/booke/booke_machdep.c
==============================================================================
--- head/sys/powerpc/booke/booke_machdep.c	Mon Dec  3 04:07:18 2018	(r341421)
+++ head/sys/powerpc/booke/booke_machdep.c	Mon Dec  3 04:47:28 2018	(r341422)
@@ -158,6 +158,7 @@ extern unsigned char __sbss_start[];
 extern unsigned char __sbss_end[];
 extern unsigned char _end[];
 extern vm_offset_t __endkernel;
+extern vm_paddr_t kernload;
 
 /*
  * Bootinfo is passed to us by legacy loaders. Save the address of the
@@ -350,7 +351,7 @@ booke_init(u_long arg1, u_long arg2)
 		end += fdt_totalsize((void *)dtbp);
 		__endkernel = end;
 		mdp = NULL;
-	} else if (arg1 > (uintptr_t)btext)	/* FreeBSD loader */
+	} else if (arg1 > (uintptr_t)kernload)	/* FreeBSD loader */
 		mdp = (void *)arg1;
 	else					/* U-Boot */
 		mdp = NULL;


More information about the svn-src-head mailing list