mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
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
This commit is contained in:
parent
faa3fd222a
commit
7dd7c3d5ee
1 changed files with 0 additions and 11 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue