Re: [PATCH v2 1/1] x86/boot/compressed: Fix reloading of GDTR post-relocation

From: Ingo Molnar
Date: Sat Feb 29 2020 - 04:24:34 EST



* Arvind Sankar <nivedita@xxxxxxxxxxxx> wrote:

> On Thu, Feb 27, 2020 at 06:47:55PM +0100, Ard Biesheuvel wrote:
> >
> > Interesting. I am going to rip most of the EFI handover protocol stuff
> > out of OVMF, since it is mostly unnecessary, and having the PE/COFF
> > loader put the image in the correct place right away is a nice
> > complimentary improvement to that. (Note that the OVMF implementation
> > of the EFI handover protocol does not currently honor the preferred
> > address from the setup header anyway)
>
> Yeah, for my testing I'm running the image from the EFI shell, which
> enters via PE entry point and honors the pref address.

So with KASLR, which is the distro default on most x86 distros, we'll
relocate the kernel to another address anyway, right?

But telling the bootloader the preferred address would avoid any
relocation overhead even in this case, right?

Thanks,

Ingo