Closed wkozaczuk closed 1 year ago
Closing this one in lieu of the new one #1267 and another future one with an updated code to support switching between app and kernel TCB (the 2nd commit of this PR).
Closing this one in lieu of the new one #1267 and another future one with an updated code to support switching between app and kernel TCB (the 2nd commit of this PR).
Please take a look at my comments above, if they are still relevant in your new version.
Yes, I have addressed your comments in the new version.
This PR implements the
arch_prctl
syscall and makes other changes to support switching the FS register between the application and kernel TCB when running statically linked executables.In essence, it makes it possible to launch simple statically linked executables like "Hello World" on OSv:
Please note, that the code changes touch some critical places of the kernel functionality - context switching, syscall handling, exception handling, and VDSO implementation.
As far as context switching goes, this patch adds only a handful of memory read/write operations that do not seem to affect it in any measurable way based on what the
misc-ctxsw.cc
indicates.On the other hand, one could see the syscall handling cost go up by 6 - 10 ns (6-10% of the total cost based on what
misc-syscall-perf.cc
measures) when executing statically linked executables due to the fact we need to switch thefsbase
and turn interrupts off and on twice. The good news is that the syscall handling does not seem to be affected in any significant way when running dynamically linked executables.Finally, I did not measure the impact of changes to the exception handling (interrupts, page faults, etc) but I think it should be lower than syscall handling given we do not need to turn interrupts on and off. Also, we should not see any impact when running dynamically linked executables.
Depends on https://github.com/cloudius-systems/osv/pull/1254 Closes #1137