aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2019-05-10 14:46:27 +1000
committerStewart Smith <stewart@linux.ibm.com>2019-05-20 14:20:29 +1000
commitdf6b7a2dadd72a519c6bdae95a89ead48b3e095b (patch)
treec70fe71c04fd2c1eb39a81c05f2c8efef11e358c /core
parentbc0a30f0bc58ef1406e595d101b70c067b80ea53 (diff)
downloadskiboot-df6b7a2dadd72a519c6bdae95a89ead48b3e095b.zip
skiboot-df6b7a2dadd72a519c6bdae95a89ead48b3e095b.tar.gz
skiboot-df6b7a2dadd72a519c6bdae95a89ead48b3e095b.tar.bz2
device-tree: speed up fdt building on slow simulators
Trade size for speed and avoid de-duplicating strings in the fdt. This costs about 2kB in fdt size, and saves about 8 million instructions (almost half of all instructions) booting skiboot in mambo. This was tracked down by Michael Neuling <mikey@neuling.org>. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'core')
-rw-r--r--core/fdt.c6
-rw-r--r--core/test/stubs.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/core/fdt.c b/core/fdt.c
index da5cc58..3972592 100644
--- a/core/fdt.c
+++ b/core/fdt.c
@@ -18,6 +18,7 @@
#include <stdarg.h>
#include <libfdt.h>
#include <device.h>
+#include <chip.h>
#include <cpu.h>
#include <opal.h>
#include <interrupts.h>
@@ -167,7 +168,10 @@ static int __create_dtb(void *fdt, size_t len,
const struct dt_node *root,
bool exclusive)
{
- save_err(fdt_create(fdt, len));
+ if (chip_quirk(QUIRK_SLOW_SIM))
+ save_err(fdt_create_with_flags(fdt, len, FDT_CREATE_FLAG_NO_NAME_DEDUP));
+ else
+ save_err(fdt_create_with_flags(fdt, len, 0));
if (fdt_error)
goto err;
diff --git a/core/test/stubs.c b/core/test/stubs.c
index e0f9829..0a8d852 100644
--- a/core/test/stubs.c
+++ b/core/test/stubs.c
@@ -94,7 +94,7 @@ void __attrconst cpu_process_local_jobs(void)
STUB(fdt_begin_node);
STUB(fdt_property);
STUB(fdt_end_node);
-STUB(fdt_create);
+STUB(fdt_create_with_flags);
STUB(fdt_add_reservemap_entry);
STUB(fdt_finish_reservemap);
STUB(fdt_strerror);