On 26.09.2024 11:24, Frediano Ziglio wrote: > On Thu, Sep 26, 2024 at 7:50 AM Jan Beulich <jbeul...@suse.com> 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. > > Hi, > are you against this change and asking to roll it back?
Well, first of all I'm hoping for a reply by Andrew. Maybe I'm overlooking something. As it stands right now I indeed think we'd be better off keeping nul selectors in %fs and %gs. Jan