stivale: Panic if higher half addresses header flag is set for 32-bit kernels

This commit is contained in:
mintsuki 2021-05-05 00:53:18 +02:00
parent ad2e03b434
commit fdfa0207e6
2 changed files with 8 additions and 0 deletions

View File

@ -109,6 +109,10 @@ void stivale_load(char *config, char *cmdline) {
panic("stivale: Section .stivalehdr is smaller than size of the struct.");
}
if ((stivale_hdr.flags & (1 << 3)) && bits == 32) {
panic("stivale: Higher half addresses header flag not supported in 32-bit mode.");
}
bool want_5lv = level5pg && (stivale_hdr.flags & (1 << 1));
if (stivale_hdr.entry_point != 0)

View File

@ -131,6 +131,10 @@ void stivale2_load(char *config, char *cmdline, bool pxe, void *efi_system_table
panic("stivale2: Section .stivale2hdr is smaller than size of the struct.");
}
if ((stivale2_hdr.flags & (1 << 1)) && bits == 32) {
panic("stivale2: Higher half addresses header flag not supported in 32-bit mode.");
}
bool want_5lv = (get_tag(&stivale2_hdr, STIVALE2_HEADER_TAG_5LV_PAGING_ID) ? true : false) && level5pg;
if (stivale2_hdr.entry_point != 0)