stand/efi: Use EFI_PAGE_SIZE here, it's more appropriate
No functional change: We're allocating a page from EFI, which is always 4k on amd64. So, this should always be 4k. PAGE_SIZE usually is this, but might not be in some cases. For the end of the stack pointer in the ist1, it should point the architecture's physical page past where we've allocated. EFI_PAGE_SIZE more faithfully reflects that here since PAGE_SIZE might not be exactly that in the future (if we had a larger logical page than physical page). Since the AllocPage interface is in EFI_PAGE_SIZE pages always, this seems safer. No functional change since they are both 2096 today. Sponsored by: Netflix Reviewed by: tsoome Differential Revision: https://reviews.freebsd.org/D50584
This commit is contained in:
@@ -356,7 +356,7 @@ efi_redirect_exceptions(void)
|
||||
PREPARE_EXCEPTION(19);
|
||||
PREPARE_EXCEPTION(20);
|
||||
|
||||
exc_rsp = exc_stack_pa + PAGE_SIZE -
|
||||
exc_rsp = exc_stack_pa + EFI_PAGE_SIZE -
|
||||
(6 /* hw exception frame */ + 3 /* scratch regs */) * 8;
|
||||
|
||||
/* Find free IST and use it */
|
||||
@@ -376,7 +376,7 @@ efi_redirect_exceptions(void)
|
||||
if (intercepted[i])
|
||||
loader_idt_e->gd_ist = ist;
|
||||
}
|
||||
(&(tss->tss_ist1))[ist - 1] = exc_stack_pa + PAGE_SIZE;
|
||||
(&(tss->tss_ist1))[ist - 1] = exc_stack_pa + EFI_PAGE_SIZE;
|
||||
|
||||
/* Switch to new IDT */
|
||||
rfl = intr_disable();
|
||||
|
||||
Reference in New Issue
Block a user