Skip to content

Commit

Permalink
kboot: Fix reserved-memory page alignment checks on 4K devices
Browse files Browse the repository at this point in the history
ADT on 4K devices may not be 16K aligned, so only check alignment
against the device page size.

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
  • Loading branch information
asdfugil committed Feb 3, 2025
1 parent a300ecc commit 85c1fd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/kboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ static int dt_set_memory(void)
continue;
}

if ((resv_start | resv_len) & (SZ_16K - 1)) {
if ((resv_start | resv_len) & (get_page_size() - 1)) {
bail("FDT: reserved-memory node %s not page-aligned, ignoring (%lx..%lx)\n", name,
resv_start, resv_end);
continue;
Expand Down

0 comments on commit 85c1fd4

Please # to comment.