mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-23 15:13:02 +00:00
dart: Only allocate a max of 2 L2 tables
This is what iBoot normally does, and >2 will panic macOS Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
2bd6060f43
commit
9748b5525e
1 changed files with 3 additions and 2 deletions
|
@ -188,8 +188,8 @@ int dart_setup_pt_region(dart_dev_t *dart, const char *path, int device)
|
||||||
printf("dart: dart %s ignoring large pt-region-0, %lu L2 tables\n", path, tbl_count);
|
printf("dart: dart %s ignoring large pt-region-0, %lu L2 tables\n", path, tbl_count);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* first index is the l1 table */
|
/* first index is the l1 table, cap at 2 or else macOS hates it */
|
||||||
tbl_count -= 1;
|
tbl_count = min(2, tbl_count - 1);
|
||||||
u64 l2_start = region[0] + SZ_16K;
|
u64 l2_start = region[0] + SZ_16K;
|
||||||
for (u64 index = 0; index < tbl_count; index++) {
|
for (u64 index = 0; index < tbl_count; index++) {
|
||||||
int ttbr = index >> 11;
|
int ttbr = index >> 11;
|
||||||
|
@ -204,6 +204,7 @@ int dart_setup_pt_region(dart_dev_t *dart, const char *path, int device)
|
||||||
off, l2tbl);
|
off, l2tbl);
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
|
printf("dart: allocating L2 tbl at %d, %d to 0x%lx\n", ttbr, idx, l2tbl);
|
||||||
memset((void *)l2tbl, 0, SZ_16K);
|
memset((void *)l2tbl, 0, SZ_16K);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue