Skip to content

Multicore LIBC prototype working but issues with SystemLog::write #2298

@torgeiru

Description

@torgeiru

I have a working prototype of multicore LIBC and thread local storage.

It works by patching musl pthread_create so that it only initializes the thread area (mmap'd), copy TLS image and returning thread pointer. The thread pointer can be directly inserted into core FS_BASE msr.

There is an issue SystemLog::write. SystemLog::write runs smoothly on CPU#0, but not CPU#N where N>0. The code accesses some memory that is not mapped into the page tables of the aux CPUs. By removing SystemLog I can successfully print text concurrently (patched musl __lockfile with spinlock and away with the futex calls).

IncludeOS TLS fork: https://github.com/torgeiru/IncludeOS/tree/TLS_implementation
Musl patch: https://github.com/torgeiru/musl-includeos (1.2.5 commit pinned + patches)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions