On Friday, November 8, 2019, Theo de Raadt <dera...@openbsd.org> wrote:

> Philip Guenther <guent...@gmail.com> wrote:
>
> > Since we're unlikely to do _more_ with BIOS calls in the boot loader, my
> > inclination would be to eliminate the structure value and the code that
> > sets it (incorrectly).  Opinions?
>
> I dunno, my crystal ball provides a more cynical outlook.
>
> How about we just repair by swapping the blocks as you propose, then
> noone gets surprised down the road if they try to use the bios-interface
> API's full functionality.
>
> The bootblocks don't shrink, but they don't grow either.
>
> Is this the right diff?  I'm deleting the name which is in the commitlogs
> since that isn't our style.

...

> --- sys/arch/amd64/stand/libsa/gidt.S   27 Oct 2012 15:43:42 -0000
> 1.11
>
+++ sys/arch/amd64/stand/libsa/gidt.S   9 Nov 2019 03:57:11 -0000
> @@ -417,19 +417,18 @@ intno     = . - 1
>         .byte   0xb8
>  2:     .long   0x90909090
>
> -       /* pass BIOS return values back to caller */
> -       movl    %eax, 0xb*4(%esp)
> -       movl    %ecx, 0xa*4(%esp)
> -       movl    %edx, 0x9*4(%esp)
> -       movb    %bh , 0xe*4(%esp)
> -
>         /* clear NT flag in eflags */
> -       /* Martin Fredriksson <mar...@gbg.netman.se> */
>         pushf
>         pop     %eax
>         and     $0xffffbfff, %eax
>         push    %eax
>         popf


No, it should be the other way, moving the “clear NT flag” block down after
the “save registers into save area” block

Philip

Reply via email to