9 Commits
Author SHA1 Message Date
borysp c24bddd5aa [LibOS] Rework signal handling and syscall emulation
Change log (most important only):
- unify CPU context structures - now we have only one version -
  `PAL_CONTEXT` - which is shared between LibOS and PALs and it should
  depend only on the host architecture (not OS),
- syscalls emulation changed:
  - dedicated LibOS stack is now used for syscalls emulation,
  - removed one indirection level in syscalls table - now it stores
    `shim_do_*` functions directly,
- signal handling - completely rewritten:
  - all signal queues use proper locking schemes now,
  - signals are handled *only* when returning to the user app from LibOS
    or PAL,
  - nested signals are now possible,
  - the app is allowed to jump out of signal handler with the same
    sematics as on normal Linux,
  - signal altstack is now fully supported,
  - syscall restarting is now supported,
  - doing a backtrace from the signal handler works properly,
- disallow injecting host-level signals, with one exception, see
  `sys.enable_sigterm_injection` manifest option for more details.
2021-02-05 14:11:21 +01:00
borysp 3014a0dd1c Miscelaneous inline asm fixes
Mostly adds missing "memory" clobber which caused some nasty bugs - gcc
optimized those inline asms and assumed values returned by them never
change.
2020-11-05 13:48:41 +01:00
Michał Kowalczyk ad477ec7bf Reformat repository to our C formatting rules (final iteration) 2020-09-15 02:00:54 +02:00
Stefan Berger 91709ac2fe [LibOS,Pal] Set weak parameter in atomics operations to false
The `weak` parameter has no influence on x86, but on ppc64 it causes
spurious faults due to a missing check on flags (missing `bne`
instruction).
2020-07-01 22:08:52 +00:00
Stefan Berger e379f21419 Implement cpu_pause() in arch-specific cpu.h
... instead of using inline asm. Required for portability to other
architectures.
2020-05-27 22:19:33 +02:00
Michał Kowalczyk 727c2ab049 Fix typos 2020-04-02 01:46:48 +02:00
borysp 6fd54058d5 [LibOS] Disable signals in critical section in shim_futex.c 2020-04-01 01:01:54 +02:00
Dmitrii Kuvaiskii c43214523c [Pal/lib] spinlock.h: Add features for our own mutex implementation
Our implementation of mutexes for Exitless Syscalls requires three-state
spinlocks and spinlocks with timeouts (see Futexes are Tricky).
2020-03-24 00:34:45 -07:00
Isaku Yamahata 0a7e3dd127 [LibOS,Pal] Move header files from Pal/lib/ under Pal/include/ 2020-02-05 23:21:06 -08:00