Commit Graph
596 Commits
Author SHA1 Message Date
Ryan Houdek ddecec12ec Spam out a wackload more syscalls
Almost all of these end up being simple passthrough.
This covers most syscalls, the remaining ones are signal related, exec
related, or rseq required.

All of these syscalls exist prior to Linux 5.0. We are using these with
the expectation still that the host Linux implementation is 5.0 or
higher.
Once we implement newer syscalls we will need to start checking for host
Linux version. We don't really have a care about devices shipping older
4.x kernels atm.
2020-09-16 10:48:56 -07:00
Ryan Houdek addcb824e2 Merge pull request #390 from FEX-Emu/skmp/add-pendatic-smc
SMC: Add --smc-full-checks, implement frontend, irint, irjit, unit test
2020-09-16 09:26:35 -07:00
Stefanos Kornilios Mitsis Poiitidis df3bdf361f SMC: Add --smc-full-checks, implement frontend, irint, irjit, unit test 2020-09-16 01:15:21 +03:00
Ryan Houdek 703c6833fc Merge pull request #389 from FEX-Emu/skmp/asr32-should-zext
OP_ASR: Fix zext semantics
2020-09-15 10:12:18 -07:00
Ryan Houdek aa3b42da10 Merge pull request #388 from FEX-Emu/skmp/fix-cmpxchg8b-zext
x86disp: cmpxchg8b should only zext on register write
2020-09-15 10:08:06 -07:00
Ryan Houdek 605a774bc4 Merge pull request #387 from FEX-Emu/skmp/fix-dividiv-zext
x86disp: Fix div32/idiv32 zext behavior
2020-09-15 10:07:31 -07:00
Ryan Houdek 4e2c4f71f9 Merge pull request #384 from FEX-Emu/skmp/fix-shrasr-cf
x86disp: Fix LSR/ASR CF calculation
2020-09-15 10:06:38 -07:00
Ryan Houdek ded48258d6 Merge pull request #378 from FEX-Emu/skmp/fix-BT-offsets
x86disp: BT/BTR/BTS/BTC make bit index signed
2020-09-15 10:05:47 -07:00
Ryan Houdek 5a31cc9aa1 Merge pull request #383 from FEX-Emu/skmp/fix-fld-sti
x86disp: Fix FLD st(i)
2020-09-15 10:04:40 -07:00
Ryan Houdek b5e354d341 Merge pull request #380 from FEX-Emu/skmp/fix-movhlps
x86disp: Add movhlps special case
2020-09-15 10:04:17 -07:00
Ryan Houdek e11d3ed83a Merge pull request #382 from FEX-Emu/skmp/fix-xadd-regreg
x86disp: fix xadd reg,reg
2020-09-15 10:02:04 -07:00
Ryan Houdek 29cb5d1821 Merge pull request #381 from FEX-Emu/skmp/fix-8bit-idiv
x86disp: Fix 8 bit IDIV
2020-09-15 10:01:29 -07:00
Ryan Houdek c6f69e158c Merge pull request #379 from FEX-Emu/skmp/fix-inc-dec
x86disp: Fix locked INC/DEC flags
2020-09-15 10:00:53 -07:00
Ryan Houdek a6addcee5e Merge pull request #377 from FEX-Emu/skmp/fix-movd
x86tables: fix mmx movd src/dst sizes for gprs
2020-09-15 10:00:14 -07:00
Ryan Houdek d8eeccc931 Merge pull request #376 from FEX-Emu/skmp/fix-test-simm32
x86tables: Fix test simm32 extension
2020-09-15 09:58:17 -07:00
Stefanos Kornilios Mitsis Poiitidis 8bdcb762f7 x86disp: Fix movhlps to write all 128 bits to context 2020-09-15 18:16:33 +03:00
Stefanos Kornilios Mitsis Poiitidis b512a98c7b OP_VEXTRACTELEMENT: Fix irint size calculation 2020-09-15 18:15:56 +03:00
Stefanos Kornilios Mitsis Poiitidis c875beb74b OP_ASHR: Fix zext semantics after sext 2020-09-15 17:02:09 +03:00
Stefanos Kornilios Mitsis Poiitidis 92ad556534 cmpxchg8b: Only set registers if compare failed 2020-09-15 13:46:52 +03:00
Stefanos Kornilios Mitsis Poiitidis c99cc9c6d3 DIV/IDIV: Fix Zext for 32 bit divides 2020-09-15 13:44:49 +03:00
Stefanos Kornilios Mitsis Poiitidis dd7f3ddef3 SHR/ASR,imm: Fix CF calculation 2020-09-15 13:36:37 +03:00
Stefanos Kornilios Mitsis Poiitidis 0cc9ecfab4 OpDispatcher: FLD ST(i) should read before stack push 2020-09-15 13:34:07 +03:00
Stefanos Kornilios Mitsis Poiitidis af99407228 xadd: fix xaddb reg,reg & xadd reg,same reg
Found via qemu's test-x86_64
2020-09-15 13:32:04 +03:00
Stefanos Kornilios Mitsis Poiitidis 611499d0ee IDIV: Fix 16 by 8 divide 2020-09-15 13:28:57 +03:00
Stefanos Kornilios Mitsis Poiitidis 4ea5457734 movhps: reg,reg should be movhlps special case 2020-09-15 13:26:17 +03:00
Stefanos Kornilios Mitsis Poiitidis 5704ce4db9 INC/DEC: Fix atomicity and flags for locked variants 2020-09-15 13:23:30 +03:00
Stefanos Kornilios Mitsis Poiitidis 75b70b8e13 BT/BTC/BTR/BTS: Should use signed offset for bit index 2020-09-15 13:19:01 +03:00
Stefanos Kornilios Mitsis Poiitidis bec3cfff14 X86Tables: Fix MOVD SRC/DST size 2020-09-15 12:58:50 +03:00
Stefanos Kornilios Mitsis Poiitidis 140c704f8a X86Tables: Fix testq imm to sext 2020-09-15 12:41:14 +03:00
Ryan Houdek 80a77b39be Implements RCR and RCL x86 ops
These are interesting rotate instructions that treats CF as an
additional rotation bit for the source.

So you end up with a 9bit, 17bit, 33bit, or 65bit rotate.
The rotate value is still masked by 0x1F or 0x3F depending on
instruction size.

This ends up with the quirk that this instruction doesn't directly map
to AArch64 rotations  for the smaller register sizes;
So we have to do some manual mirroring in a larger register to pull the
correct view out of the op
2020-09-13 17:29:51 -07:00
Ryan Houdek 8878278402 Implements new EXTR IR op
This maps directly to AArch64's EXTR op.
Maps closely to x86's SHRD instruction
2020-09-13 17:28:09 -07:00
Ryan Houdek a324f4c222 Implements missing BFI in JITs
We had the IR op but it wasn't implemented for the JITs
2020-09-13 17:26:26 -07:00
Ryan Houdek e9b74b0230 Initial Callback support
This interface is for native host code to be able to call back in to JIT
to execute guest code.
This is mainly for thunks but could be used for other purposes.
This can cross a couple ABI boundaries so one must be careful when
calling in to this
2020-09-11 15:48:51 -07:00
Ryan Houdek 6f5e55c141 Merge pull request #372 from FEX-Emu/skmp/fix-brk-limit
Syscalls/BRK: Don't use more memory than mapped
2020-09-11 14:59:21 -07:00
Stefanos Kornilios Mitsis Poiitidis abcdff6a50 EmulatedFiles: Don't crash on too long paths 2020-09-12 00:53:39 +03:00
Stefanos Kornilios Mitsis Poiitidis b3ae845071 Syscalls/BRK: Don't use more memory than mapped 2020-09-12 00:39:11 +03:00
Stefanos Kornilios Mitsis Poiitidis ad13c82918 Merge pull request #371 from Sonicadvance1/sigaction_gt64
Don't allow an application to try and set a signal past 64
2020-09-11 10:45:00 +03:00
Stefanos Kornilios Mitsis Poiitidis 87dbefd0a3 Merge pull request #367 from Sonicadvance1/sigsuspend
Implements sigsuspend
2020-09-11 10:43:50 +03:00
Ryan Houdek e08972b06a Don't allow an application to try and set a signal past 64
We only have 64, this is invalid!
2020-09-11 00:35:39 -07:00
Scott Mansell abd98be5f1 Make Interpreter Reentrant; alloca SSAs on Stack 2020-09-11 19:31:31 +12:00
Ryan Houdek 1309b4a0c5 Merge pull request #363 from Sonicadvance1/fix_thread_fork_shutdown
Ensures a process that has forked won't shutdown the other process
2020-09-11 00:05:22 -07:00
Stefanos Kornilios Mitsis Poiitidis f11b1a5c4b Merge pull request #360 from Sonicadvance1/memory_syscalls
Implements two more memory syscalls
2020-09-11 09:22:21 +03:00
Stefanos Kornilios Mitsis Poiitidis 27dbc66e2e Merge pull request #361 from Sonicadvance1/cvtpd2dq
Implements missing CVTPD2DQ
2020-09-11 09:20:48 +03:00
Ryan Houdek fb6e3535d8 Implements capget and capset syscalls
These are safe to pass through to the host, there isn't any system data
handled here.

Some game I was testing used these
2020-09-10 22:30:51 -07:00
Ryan Houdek a3ee4dff45 Implements sigsuspend
This helps out Mono's garbage collector specifically. There is a minor
race that can currently occur with signal 63 but that technically should
only occur on a pause or stop condition.

Might need to change this behaviour if it becomes a problem
2020-09-10 21:50:29 -07:00
Ryan Houdek 8aeb6718ac Merge pull request #362 from Sonicadvance1/fix_guest_signal_dfl
Fixes guest default signal handling and pending signals
2020-09-10 19:00:29 -07:00
Ryan Houdek 095e3ee0f6 Merge pull request #359 from Sonicadvance1/fix_getpriority
Fixes getpriority syscall
2020-09-10 18:53:33 -07:00
Ryan Houdek 98aef5ee19 Merge pull request #355 from Sonicadvance1/initial_32bit_unittest
Adds initial 32bit unit tests
2020-09-10 18:50:06 -07:00
Ryan Houdek 0df06960e1 Ensures a process that has forked won't shutdown the other process
Since we track the PID and TID of the threads for signaling purposes, we
had the problem that if a process forked and the child then shuts down.
It was still tracking the parent thread as executing, thus it would send
it a tgkill to shut it down.

This was unintended behaviour and is now stopped
2020-09-10 18:21:16 -07:00
Ryan Houdek 290e2b55c4 Fixes guest default signal handling and pending signals
glibc raise() actually disables all signals, raises the signal that the
user wants, then reenables the previous signal mask.

On the reenabling of the previous signal mask, that is when the pending
signal fires.
This needs to be accurately handled, so check for pending signals
getting unmasked in sigprocmask

This also then needs to be further fixed to handle default signal
handling, where if a signal was sent that is default ignored (NOT set to
ignore!) then it would just exit the application before.
Now something likg SIGCHLD with the default handler (aka ignore) won't
kill the process
2020-09-10 18:16:24 -07:00