svn commit: r328659 - head/stand/fdt

Kyle Evans kevans at FreeBSD.org
Thu Feb 1 14:31:13 UTC 2018


Author: kevans
Date: Thu Feb  1 14:31:12 2018
New Revision: 328659
URL: https://svnweb.freebsd.org/changeset/base/328659

Log:
  D14130: stand/fdt: Rip out FDT VA tracking
  
  Whether we should be overwriting the loaded FDT module with the 'fixed up'
  version or not was questionable when this was added, and now that overlays
  are possible this is downright wrong.
  
  Overlays can increase the size of the blob, so writing it back to the
  original VA will generally write past the end of the block and start
  clobbering other things in memory.
  
  Rip it out- it was questionable to begin with, it's doing bad things now,
  and it serves no purpose since the modified blob will be copied into place
  rather than relying on this to reflect the changes.
  
  Reviewed by:	gonzo
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D14130

Modified:
  head/stand/fdt/fdt_loader_cmd.c

Modified: head/stand/fdt/fdt_loader_cmd.c
==============================================================================
--- head/stand/fdt/fdt_loader_cmd.c	Thu Feb  1 14:26:26 2018	(r328658)
+++ head/stand/fdt/fdt_loader_cmd.c	Thu Feb  1 14:31:12 2018	(r328659)
@@ -67,10 +67,6 @@ static struct fdt_header *fdt_to_load = NULL;
 static struct fdt_header *fdtp = NULL;
 /* Size of FDT blob */
 static size_t fdtp_size = 0;
-/* Location of FDT in kernel or module. */
-/* This won't be set if FDT is loaded from disk or memory. */
-/* If it is set, we'll update it when fdt_copy() gets called. */
-static vm_offset_t fdtp_va = 0;
 
 static int fdt_load_dtb(vm_offset_t va);
 static void fdt_print_overlay_load_error(int err, const char *filename);
@@ -221,7 +217,6 @@ fdt_load_dtb(vm_offset_t va)
 		return (1);
 	}
 
-	fdtp_va = va;
 	COPYOUT(va, fdtp, fdtp_size);
 	debugf("DTB blob found at 0x%jx, size: 0x%jx\n", (uintmax_t)va, (uintmax_t)fdtp_size);
 
@@ -248,7 +243,6 @@ fdt_load_dtb_addr(struct fdt_header *header)
 		return (1);
 	}
 
-	fdtp_va = 0; // Don't write this back into module or kernel.
 	bcopy(header, fdtp, fdtp_size);
 	return (0);
 }
@@ -962,11 +956,6 @@ fdt_copy(vm_offset_t va)
 	if (fdt_fixup() == 0)
 		return (0);
 
-	if (fdtp_va != 0) {
-		/* Overwrite the FDT with the fixed version. */
-		/* XXX Is this really appropriate? */
-		COPYIN(fdtp, fdtp_va, fdtp_size);
-	}
 	COPYIN(fdtp, va, fdtp_size);
 	return (fdtp_size);
 }


More information about the svn-src-all mailing list