Commit 8e068a2
kho: update FDT dynamically for subtree addition/removal
Currently, sub-FDTs were tracked in a list (kho_out.sub_fdts) and the
final FDT is constructed entirely from scratch during kho_finalize().
We can maintain the FDT dynamically:
1. Initialize a valid, empty FDT in kho_init().
2. Use fdt_add_subnode and fdt_setprop in kho_add_subtree to
update the FDT immediately when a subsystem registers.
3. Use fdt_del_node in kho_remove_subtree to remove entries.
This removes the need for the intermediate sub_fdts list and the
reconstruction logic in kho_finalize(). kho_finalize() now only needs to
trigger memory map serialization.
Link: https://lkml.kernel.org/r/20251114190002.3311679-11-pasha.tatashin@soleen.com
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Cc: Alexander Graf <graf@amazon.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Baoquan He <bhe@redhat.com>
Cc: Coiby Xu <coxu@redhat.com>
Cc: Dave Vasilevsky <dave@vasilevsky.ca>
Cc: Eric Biggers <ebiggers@google.com>
Cc: Kees Cook <kees@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>1 parent 9a4301f commit 8e068a2
1 file changed
Lines changed: 69 additions & 75 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | 107 | | |
114 | 108 | | |
115 | 109 | | |
116 | 110 | | |
117 | 111 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | 112 | | |
122 | 113 | | |
123 | 114 | | |
| |||
127 | 118 | | |
128 | 119 | | |
129 | 120 | | |
130 | | - | |
131 | | - | |
132 | 121 | | |
133 | 122 | | |
134 | 123 | | |
| |||
725 | 714 | | |
726 | 715 | | |
727 | 716 | | |
728 | | - | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
729 | 721 | | |
730 | | - | |
731 | | - | |
732 | | - | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
733 | 727 | | |
734 | | - | |
735 | | - | |
736 | | - | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
737 | 738 | | |
738 | | - | |
739 | | - | |
740 | 739 | | |
741 | 740 | | |
742 | | - | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
743 | 745 | | |
744 | 746 | | |
745 | 747 | | |
746 | 748 | | |
747 | 749 | | |
748 | | - | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
749 | 769 | | |
750 | | - | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
| 770 | + | |
| 771 | + | |
755 | 772 | | |
756 | 773 | | |
757 | 774 | | |
758 | 775 | | |
| 776 | + | |
| 777 | + | |
759 | 778 | | |
760 | 779 | | |
761 | 780 | | |
| |||
1232 | 1251 | | |
1233 | 1252 | | |
1234 | 1253 | | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
1238 | | - | |
1239 | | - | |
1240 | | - | |
1241 | | - | |
1242 | | - | |
1243 | | - | |
1244 | | - | |
1245 | | - | |
1246 | | - | |
1247 | | - | |
1248 | | - | |
1249 | | - | |
1250 | | - | |
1251 | | - | |
1252 | | - | |
1253 | | - | |
1254 | | - | |
1255 | | - | |
1256 | | - | |
1257 | | - | |
1258 | | - | |
1259 | | - | |
1260 | | - | |
1261 | | - | |
1262 | | - | |
1263 | | - | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
1273 | | - | |
1274 | | - | |
1275 | | - | |
1276 | | - | |
1277 | 1254 | | |
1278 | 1255 | | |
1279 | 1256 | | |
| |||
1282 | 1259 | | |
1283 | 1260 | | |
1284 | 1261 | | |
1285 | | - | |
1286 | | - | |
1287 | | - | |
1288 | | - | |
1289 | | - | |
1290 | | - | |
| 1262 | + | |
1291 | 1263 | | |
1292 | 1264 | | |
1293 | 1265 | | |
| |||
1372 | 1344 | | |
1373 | 1345 | | |
1374 | 1346 | | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
1375 | 1365 | | |
1376 | 1366 | | |
1377 | 1367 | | |
| |||
1394 | 1384 | | |
1395 | 1385 | | |
1396 | 1386 | | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
1397 | 1391 | | |
1398 | 1392 | | |
1399 | 1393 | | |
| |||
0 commit comments