bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 1/4 gnumach] cpuboot: Fix percpu apboot_gdt for early gs


From: Samuel Thibault
Subject: Re: [PATCH v3 1/4 gnumach] cpuboot: Fix percpu apboot_gdt for early gs
Date: Sun, 22 Dec 2024 01:35:23 +0100

Hello,

Damien Zammit via Bug reports for the GNU Hurd, le sam. 21 déc. 2024 23:55:17 
+0000, a ecrit:
> +     movl    %eax, %ebx
> +
> +     /* Make eax hold offset to my cpus gdt */
> +     movl    $((GDT_DESCR_M32 + GDT_TABLE_M32) * 4), %eax
> +     mul     %ebp
> +
> +     /* Patch only our own copy of gdt */
> +     movl    $apboot_percpu_low, %ecx
> +     addl    %eax, %ecx
> +     movw    %bx, (%ecx)
> +     shr     $16, %ebx
> +     addl    $2, %ecx
> +     movb    %bl, (%ecx)
> +     shr     $8, %bx
> +     addl    $3, %ecx
> +     movb    %bl, (%ecx)
> +
> +     /* Patch only our own copy of gdt descriptor */
> +     movl    $apboot_gdt_descr, %ecx
> +     addl    %eax, %ecx
> +     movl    %ecx, %edx
> +     addl    $2, %edx
> +     movl    (%edx), %ebx
> +     addl    %eax, %ebx
> +     movl    %ebx, (%edx)
> +
> +     /* Reload our copy of gdt */
> +     lgdtl   (%ecx)
> +     ljmpl   $KERNEL_CS, $2f

This is quite verbose. Could you check that the attached patch on top of
it still works?

Samuel

Attachment: patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]