Page MenuHomeFreeBSD

Add basic getcpu(2) support to linuxulator
ClosedPublic

Authored by trasz on Dec 30 2019, 7:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 12, 9:33 AM
Unknown Object (File)
Fri, Dec 6, 10:28 PM
Unknown Object (File)
Nov 21 2024, 9:23 AM
Unknown Object (File)
Oct 23 2024, 2:20 AM
Unknown Object (File)
Sep 23 2024, 3:42 PM
Unknown Object (File)
Sep 20 2024, 10:38 PM
Unknown Object (File)
Sep 17 2024, 12:33 PM
Unknown Object (File)
Sep 8 2024, 4:58 PM
Subscribers

Details

Summary

Add basic getcpu(2) support to linuxulator. This unbreaks
Java from CentOS 8 (java-11-openjdk-11.0.5.10-0.el8_0.x86_64).

The purpose of this syscall is to query the CPU number and the NUMA
domain the calling thread is currently running on. The third argument
is ignored. It doesn't do anything regarding scheduling - it's literally
just a way to query the current state, without any guarantees you won't
get rescheduled an opcode later.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

In review summary, please explain the syscall interface.

sys/compat/linux/linux_misc.c
2366 ↗(On Diff #66150)

copyout reads the source byte-by-byte. This means that if the thread is rescheduled during copyout, the result might contain cpu number for non-existing cpu.

trasz edited the summary of this revision. (Show Details)

Use local copy for cpu.

Exclude the generated files from commit.

This revision is now accepted and ready to land.Dec 31 2019, 12:38 PM

Regen after committing definitions fixes.

This revision now requires review to proceed.Dec 31 2019, 4:14 PM
This revision was not accepted when it landed; it landed in state Needs Review.Dec 31 2019, 10:01 PM
This revision was automatically updated to reflect the committed changes.