aboutsummaryrefslogtreecommitdiff
path: root/stand
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2018-02-01 14:31:12 +0000
committerKyle Evans <kevans@FreeBSD.org>2018-02-01 14:31:12 +0000
commit7dd7c3d5eec47a79ad87c783b7791f6eb9c7f0f3 (patch)
tree9d468cf87e836491a3a7e025e5219d6038d1d7a8 /stand
parentfaa3fd222aeef0cf51bb55ec3192e8a41b177c85 (diff)
downloadsrc-7dd7c3d5eec47a79ad87c783b7791f6eb9c7f0f3.tar.gz
src-7dd7c3d5eec47a79ad87c783b7791f6eb9c7f0f3.zip
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
Notes
Notes: svn path=/head/; revision=328659
Diffstat (limited to 'stand')
-rw-r--r--stand/fdt/fdt_loader_cmd.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/stand/fdt/fdt_loader_cmd.c b/stand/fdt/fdt_loader_cmd.c
index 764d523614e1..bfc424cc6ace 100644
--- a/stand/fdt/fdt_loader_cmd.c
+++ b/stand/fdt/fdt_loader_cmd.c
@@ -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);
}