2897 Commits
Author SHA1 Message Date
Ryan Houdek 8170307aef Docs: Update for release FEX-2107 FEX-2107 2021-07-01 04:20:44 -07:00
Ryan Houdek 12cc979ec6 Merge pull request #1139 from Sonicadvance1/more_unaligned_atomics_fixes
ARM64: Fixes bugs in unaligned atomic signal handlers
2021-06-30 23:21:55 -07:00
Ryan Houdek d6ecd6364c Disables the new tests on ARMv8.0
Still aren't supported correctly there.
2021-06-30 21:48:36 -07:00
Ryan Houdek 7d6dafe25d Adds cmpxchg unit tests for new bugs encountered
Ensures we are testing when Desired != Memory && Memory == Expected to ensure it fails on all alignments
2021-06-30 21:43:51 -07:00
Ryan Houdek db6f4786d2 ARM64: Fixes bugs in unaligned atomic signal handlers
There were two bugs in here.

The first bug here is with with the CMPXCHG emulation.
1) If the *Expected* value did *NOT* match what was in memory
2) *AND* The *Desired* value matched the memory value
3) The CAS would incorrectly return success for this CMPXCHG
4) Thus setting ZF incorrectly

The second bug comes from atomic memory operations (Add, CLR, EOR, SET, SWAP).
This operation is a Load + <Op> + CAS
1) If the memory backing between the Load and CAS changes
2) The CAS would then fail
3) On Atomic memory operations this should then retry to ensure it completes successfully
4) We were not retrying on failure in this case
5) Thus something like `LOCK INC` would have never atomically incremented correctly
6) We can't use our ASM unit tests to test this, since it needs thread contention.
2021-06-30 21:43:44 -07:00
Ryan Houdek 49fa69d4e2 Merge pull request #1138 from lioncash/casfn
Arm64: Use regular function pointers with CAS handling functions
2021-06-30 19:46:38 -07:00
Lioncash 448cbc8e3d Arm64: Use regular function pointers with CAS handling functions
Given these are called in a loop repeatedly, where we know we'll always
have a set function to call, std::function adds a little bit of
overhead.
2021-06-30 22:03:08 -04:00
Ryan Houdek 81ce7b3f16 Merge pull request #1137 from lioncash/cexpr
OpcodeDispatcher: Make use of if constexpr
2021-06-30 18:21:20 -07:00
Lioncash c9615032a9 OpcodeDispatcher: Make use of if constexpr
Given these arguments are template arguments we can use if constexpr
with these branches to guarantee their elision.
2021-06-30 21:11:28 -04:00
Ryan Houdek 52e2c4abc5 Merge pull request #1136 from lioncash/handler
Context: Add alias for exit handler
2021-06-30 17:12:24 -07:00
Lioncash c4216755ab Context: Add alias for exit handler
Places the definition in one place so it doesn't need to be written
several times.
2021-06-30 19:50:57 -04:00
Ryan Houdek 09071e4279 Merge pull request #1135 from lioncash/ctx
Context: Place return value from GenerateIR into a struct
2021-06-30 16:39:24 -07:00
Lioncash 46a6e79233 Context: Place return value from GenerateIR into a struct
This makes it a little more straightforward to see what these return
values mean without needing to look at the implementation.

These tuples were also getting a little bit large.
2021-06-30 19:30:03 -04:00
Ryan Houdek 09363f1b1b Merge pull request #1134 from lioncash/lut
OpcodeDispatcher: Mark lookup tables as static in Get{Src,Dst}Size
2021-06-30 15:51:34 -07:00
Lioncash 9d5f9d6783 OpcodeDispatcher: Mark lookup tables as static in Get{Src,Dst}Size
Same behavior, but allows clang to elide pushing all of these values on
and off the stack, particularly given these are called quite frequently
throughout the opcode dispatcher.
2021-06-30 18:22:14 -04:00
Stefanos Kornilios Mitsis Poiitidis 7d0535e0d9 Merge pull request #1133 from Sonicadvance1/fix_zero_size_pt_load
Fixes PT_LOAD with zero file size
2021-06-29 09:39:22 +03:00
Stefanos Kornilios Mitsis Poiitidis 176b3292ed Merge pull request #1132 from Sonicadvance1/move_elfutils_frontend
Moves ELF handlers from FEXCore to frontend
2021-06-29 09:38:30 +03:00
Stefanos Kornilios Mitsis Poiitidis 3d25f594a9 Merge pull request #1131 from Sonicadvance1/disallow_disabling_cpuid
syscalls: Disallow disabling CPUID from arch_prctl
2021-06-29 09:37:02 +03:00
Stefanos Kornilios Mitsis Poiitidis 861d89e8a8 Merge pull request #1130 from Sonicadvance1/fix_fcntl
x32: Fixes fcntl OP_GETLK64_32
2021-06-29 09:36:19 +03:00
Stefanos Kornilios Mitsis Poiitidis 59c36ebc36 Merge pull request #1129 from Sonicadvance1/fix_msg_alignment
x32: Fixes sendmmsg cmsg alignment
2021-06-29 09:35:00 +03:00
Stefanos Kornilios Mitsis Poiitidis 2d8304547e Merge pull request #1128 from Sonicadvance1/remove_logs
Remove logs that are just noise at this point
2021-06-29 09:34:12 +03:00
Stefanos Kornilios Mitsis Poiitidis 4880097f89 Merge pull request #1122 from Sonicadvance1/CreateAppConfig
FEXConfig: Have it create AppConfig folder on save
2021-06-29 09:29:59 +03:00
Stefanos Kornilios Mitsis Poiitidis 3a11b88d30 Merge pull request #1120 from Sonicadvance1/fix_a_few_32bit_syscalls
x32: Fixes shmdt, sendmsg, recvmsg syscalls
2021-06-29 09:28:58 +03:00
Stefanos Kornilios Mitsis Poiitidis 76a054e50a Merge pull request #1113 from Sonicadvance1/fix_argument_epoll_ctl
Wrap 32-bit epoll_ctl argument in compat_ptr
2021-06-29 09:26:23 +03:00
Ryan Houdek 279d9219a6 Fixes PT_LOAD with zero file size
gzip ships a PT_LOAD program section without a file size and only a memory size.
In the case of a zero file size PT_LOAD then return success immediately in this section loader.
This fixes Steam using gzip to package up crash logs
2021-06-27 02:10:21 -07:00
Ryan Houdek ed4c5d9704 Remove logs that are just noise at this point
Don't print how many instructions are installed in the tables.
  This isn't useful anymore

Not installing signal 32 and 33 are something we don't support right now. Stop complaining in that case.

Stop printing when a thread is starting up and shutting down. If you want to see this then gdb shows it well.

Don't print clone flags unless we are hitting a case where we are printing another log message.
2021-06-27 02:09:27 -07:00
Ryan Houdek 069e279a18 Moves ELF handlers from FEXCore to frontend
Only the frontends need to deal with ELF files specifically.
The backend doesn't need to be aware of them at all.
Since the ELF handling is the frontend's responsibility, move all the code to the frontend.
2021-06-27 02:07:56 -07:00
Ryan Houdek 9ba1948375 syscalls: Disallow disabling CPUID from arch_prctl
In a newer version of the kernel there was a feature to disallow cpuid.
We can emulate this by saying it is always enabled and disallow the ability to disable it.
2021-06-27 02:03:21 -07:00
Ryan Houdek 835ca9cdf9 x32: Fixes fcntl OP_GETLK64_32
This was overwriting the cmd argument and then being checked in the switch statement
after the call.
Since it was overwritten, it wasn't falling down the correct path, returning a flock_32 instead of a flock64_32
2021-06-27 02:01:37 -07:00
Ryan Houdek 59a429ec19 x32: Fixes sendmmsg cmsg alignment
This wasn't aligning like the other recvmsg and sendmsg variants
2021-06-27 02:00:39 -07:00
Ryan Houdek 36b5863c7c Merge pull request #1125 from lioncash/ptr
FEXLoader: Make use of unique_ptr for syscall handlers
2021-06-25 18:36:32 -07:00
Ryan Houdek bdfbebe24d Merge pull request #1126 from lioncash/socket
x32/Socket: Amend std::vector initialization bug in sendmmsg
2021-06-25 17:24:13 -07:00
Ryan Houdek 336ecb8cc7 Merge pull request #1112 from Sonicadvance1/deferred_signal_installation
Implements support for deferred signal handler installation
2021-06-25 16:44:42 -07:00
Lioncash ea9f08e481 x32/Socket: Amend std::vector initialization in sendmmsg
Since the vector was being initialized with braces, this caused the
arrays to only ever have one element within it instead of the size of
the array.

While we're at it, we can also construct a vector in place with the
necessary size.
2021-06-25 10:00:37 -04:00
Lioncash da8c5dc460 FEXLoader: Make use of unique_ptr for syscall handlers
Makes the ownership requirements explicit in the interface.

Also makes it harder to unintentionally/accidentally leak memory.
2021-06-25 09:19:48 -04:00
Ryan Houdek fd8dcda67e Merge pull request #1124 from lioncash/timeofday
x32/Time: Implement settimeofday
2021-06-25 05:59:00 -07:00
Lioncash b2fb48d711 x32/Time: Implement settimeofday 2021-06-25 08:48:05 -04:00
Ryan Houdek 8e6328e946 Merge pull request #1123 from lioncash/time
x32/Time: Fix a few edge cases in time related syscalls
2021-06-25 05:45:23 -07:00
Lioncash 9262264525 x32/Time: Fix potential null pointer dereference in nanosleep
Prevents potential null dereferences that could occur from user code.
2021-06-25 08:30:45 -04:00
Lioncash 4553564c9f x32/Time: Fix potential null pointer dereference in clock_nanosleep
Prevents a potential null dereference in our code that could result from
user code.
2021-06-25 08:30:36 -04:00
Lioncash 2a86421172 x32/Time: Fix potential null pointer dereference in clock_settime
The kernel handles the case where a null address is passed in for tp.

Instead we can handle this case so we don't have a dereference inside
our code.
2021-06-25 08:19:04 -04:00
Ryan Houdek bb85f90f78 FEXConfig: Have it create AppConfig folder on save
Otherwise it will claim that the AppConfig was saved and won't actually be
2021-06-25 04:03:16 -07:00
Ryan Houdek 4a1da85214 Merge pull request #1121 from lioncash/utimesat
x32/Time: Implement futimesat
2021-06-25 03:36:32 -07:00
Lioncash ff9268d6c7 x32/Time: Implement futimesat 2021-06-25 06:20:51 -04:00
Ryan Houdek c4f8e6c934 x32: Fixes non-ipc sendmsg/recvmsg syscalls
We were sending these non-ipc variants of these syscalls through
the generic path. This is broken but luckily glibc from Ubuntu isn't shipping
a version using these yet.
2021-06-25 03:02:31 -07:00
Ryan Houdek 52c50735d5 x32: Fixes shmdt not going through allocator
This was missed. Which means we were leaking SHM allocations if the 32-bit allocator was used
2021-06-25 03:01:38 -07:00
Ryan Houdek aca8903b56 GVisor: Update gvisor tests that have now changed behaviour 2021-06-24 21:08:59 -07:00
Ryan Houdek 2e9b22e042 POSIX: Updates known failures
Now that signal behaviours have changed a little bit, update the tests that have changed
2021-06-24 20:42:39 -07:00
Ryan Houdek d4559ea0c6 Update host signal mask on guest update
Now that are aren't consuming all signals we need to more aggressively handle the host signal mask.
Now more signals are getting masked and blocked how they should be.
2021-06-24 20:42:39 -07:00
Ryan Houdek d4dd4d0972 Copy over siginfo_t to the guest more correctly
si_addr will still be incorrect. What matters more here is that SIGCHLD gets correct information.
The guest needs SIGCHLD ifnromation to be filled out correctly, otherwise TTY handoff hangs
with the child process stopped.
2021-06-24 20:42:39 -07:00