[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v4 2/4] x86/boot: Refactor BIOS/PVH start
On Thu, Sep 26, 2024 at 7:50 AM Jan Beulich <jbeulich@xxxxxxxx> wrote: > > On 25.09.2024 21:33, Andrew Cooper wrote: > > On 25/09/2024 7:00 am, Frediano Ziglio wrote: > >> @@ -449,62 +458,40 @@ __pvh_start: > >> mov %ecx, %es > >> mov %ecx, %ss > >> > >> - /* Skip bootloader setup and bios setup, go straight to > >> trampoline */ > >> - movb $1, sym_esi(pvh_boot) > >> - movb $1, sym_esi(skip_realmode) > >> + /* Load null selector to unused segment registers. */ > >> + xor %ecx, %ecx > >> + mov %ecx, %fs > >> + mov %ecx, %gs > > > > Honestly, the more I look at this, the more bizarre it is. > > > > We should just set up %fs/gs like we do %ds/es, which in this case is > > simply to drop the comment and the xor. > > What's bizarre here? As long as we don't use %fs/%gs, it doesn't matter > much what we set them to. So yes, they may be set to what %ds etc are set > to, but they may as well be marked unusable. Documentation-wise that's > cleaner imo, as down the road - when a need to use one arises - it then > won't require auditing of all code to figure where the register(s) is(are) > actually used (just to find: nowhere). Even if a comment to this effect > was left here, I for one wouldn't trust it in a couple of years time, but > rather fear it went stale. > > Jan Hi, are you against this change and asking to roll it back? Frediano
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |