[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 00/34] The rest of the x86_64-gnu port
From: |
Sergey Bugaev |
Subject: |
Re: [RFC PATCH 00/34] The rest of the x86_64-gnu port |
Date: |
Tue, 21 Mar 2023 17:46:49 +0300 |
On Tue, Mar 21, 2023 at 5:19 PM Luca <luca@orpolo.org> wrote:
> > Every thread needs to have its own values of fs_base / gs_base, and
> > you need to store/restore them on context switch by accessing the
> > appropriate MSR. There's also the swapgs instruction that I'm told is
> > useful if you also use gs for kernel's own needs (such as per-CPU
> > data).
>
> I see there are also the rdfsbase/wrfsbase/rdgsbase/wrfgsbase
> instructions which would simplify a lot this part, but they are
> relatively new (~10 years)... I guess we need to handle also the case
> using MSRs/swapgs, which seems quite complicated if made efficient, as
> it requires to keep track of the GS state on each trap entry. I'll try
> to have a simple implementation that works, and eventually optimize it
> later.
Also FWIW: x86_64 glibc isn't actually using gs, and I doubt it's ever
going to. So while a full proper implementation should support gs as
well as fs, just supporting fs should be enough to get glibc going.
Sergey
- Re: [RFC PATCH 00/34] The rest of the x86_64-gnu port, (continued)
- Re: [RFC PATCH 00/34] The rest of the x86_64-gnu port, Luca, 2023/03/21
- Re: [RFC PATCH 00/34] The rest of the x86_64-gnu port, Sergey Bugaev, 2023/03/21
- Re: [RFC PATCH 00/34] The rest of the x86_64-gnu port, Luca, 2023/03/21
- Re: [RFC PATCH 00/34] The rest of the x86_64-gnu port, Sergey Bugaev, 2023/03/21
- Re: [RFC PATCH 00/34] The rest of the x86_64-gnu port, Luca, 2023/03/21
- Re: [RFC PATCH 00/34] The rest of the x86_64-gnu port, Sergey Bugaev, 2023/03/21
- Re: [RFC PATCH 00/34] The rest of the x86_64-gnu port,
Sergey Bugaev <=
- Message not available
- Re: [RFC PATCH 00/34] The rest of the x86_64-gnu port, Sergey Bugaev, 2023/03/21
- Re: [RFC PATCH 00/34] The rest of the x86_64-gnu port, Luca, 2023/03/21
Re: [RFC PATCH 00/34] The rest of the x86_64-gnu port, Flávio Cruz, 2023/03/20