Commit Graph
34 Commits
Author SHA1 Message Date
Ryan Houdek cf72f998f8 Add common location to see host features
Only necessary to pick up AES at the moment
2020-09-29 23:45:13 -07:00
Ryan Houdek de2a165a7d Adds ability for the frontend to register a signal handler
This will come to be useful for our host code execution and wine in the
future
2020-09-22 13:19:41 -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 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 0819a40c57 Adds option to disable TSO
This is a knowingly wrong option for anything running in a threaded
environment
2020-09-05 16:58:03 -07:00
Ryan Houdek 50349db4c6 Moves our entire execution model over to signal execution
This requires implementing custom ASM dispatchers for the interpreter
side of things so it works correctly.
Allows all of our CPU backends to safely support signaling.
This is a bit of a nightmare change and requires rethinking logic about
debugging in some instances.
2020-09-02 16:00:17 -07:00
Ryan Houdek 2ecd103aed Fixes thread stepping
This doesn't yet work around the problem of threads stalled in a syscall
2020-08-27 13:34:42 -07:00
Ryan Houdek 61a6b4ebb0 Allows the context to export the thread array
This will allow gdbstub to get thread information
2020-08-27 13:34:42 -07:00
Ryan Houdek 8ea871729c Moves RunningMode to the config struct 2020-08-27 13:34:42 -07:00
Ryan Houdek 5efab55ea9 Removes LLVM from FEX
LLVM has too many problems with it to use it as a tiered level of JIT.
We won't be able to use it
2020-08-19 18:02:28 -07:00
Ryan Houdek 246e36c061 Adds an x86 generated code helper class
Just generates some context level x86 code space for our guest to jump
in to.
This is only currently used for sigret but will become more important as
we come to support vdso.
2020-08-02 18:14:47 -07:00
Stefanos Kornilios Mitsis Poiitidis 8c8e6294b6 Thunks: ALTINST, OP_THUNK, basic infrastructure 2020-07-20 13:52:28 +03:00
Ryan Houdek a1db6a0dec Adds new signal delegator class
Allows us to register host and guest signal delegators.
Currently only host signals are handled, guest signal delegation will
take a bit of work still.
2020-07-11 06:12:06 +01:00
Ryan Houdek 7302ad1996 Adds new FEX config for telling the guest how many CPU cores it can have
This is just a virtual number that the guest can query through the
various means. Will affect mesa with how many helper threads it
generates at the very least
2020-06-04 00:03:41 -07:00
Ryan Houdek fd857e4966 Makes threaded compilation not rely on a global mutex
As we run more threaded applications it is becoming apparent that this
needs to be fixed now.
This duplicates the FrontendDecoder and Passmanager per thread so they
no longer block each other while compiling.
Increases a bit of memory usage but completely worth it.
2020-05-27 10:18:02 -07:00
Ryan Houdek 0130b41a10 Forces the primary application thread to be host primary thread
This is a bit of a peculiar one, we want to ensure a single threaded
application is running on the emulator's primary thread.
This mitigates the problem that an application can do a getpid versus
gettid comparison and notice a problem.
Some games rely on getpid being the actual process ID and will spin
forever if it isn't the case.

This is also necessary for wine bringup since thread creation needs a
bit more finesse there.

Fixes #186
2020-05-25 19:56:05 -07:00
Ryan Houdek d2cf07a4fd Passes the running mode through from FEX to FEXCore 2020-05-14 00:56:31 -07:00
Ryan Houdek c171fbb71e Add 64bit config option
Not currently wired up to anything
2020-05-14 00:55:52 -07:00
Stefanos Kornilios Mitsis Poiitidis d58961ef1e Propagate guest exit code 2020-05-02 02:34:50 +03:00
Ryan Houdek fee4aeaf88 Merge pull request #167 from Sonicadvance1/fix_exec
Fixes loading EXEC applications in to memory.
2020-04-29 12:31:33 -07:00
Ryan Houdek 1ee9070e8f Merge pull request #150 from Sonicadvance1/fix_x86_code_overflow
Fixes crash that occurs when the x86-64 JIT code cache gets full
2020-04-29 12:26:11 -07:00
Ryan Houdek a0537ed630 Merge pull request #149 from Sonicadvance1/fix_syscall_memleak
Fixes memory leak on shutdown for syscall handlers
2020-04-29 12:25:55 -07:00
Ryan Houdek 2f56c475e2 Fixes memory leak on shutdown for syscall handlers
Switches it over to a unique_ptr to ensure it doesn't happen again.
2020-04-26 18:15:52 -07:00
Ryan Houdek 3528b30684 Fixes loading EXEC applications in to memory.
If we are loading EXEC then we actually need to start loading in to the
lower 32bits of memory.
This lets the frontend code loader handle the memory base instead of
hiding it behind some core magic instead.

This lets us get EXEC programs working.
So now we support EXEC, DYN, and static applications
2020-04-26 18:11:48 -07:00
David Miller c77a3c0c02 changed default value of FEXCore::Context::Config::UnifiedMemory to proper location 2020-04-25 14:34:34 -04:00
Ryan Houdek 4bdbe65043 Fixes crash that occurs when the x86-64 JIT code cache gets full
Need to clear the other caches in the cases the x86 cache needs to be
wiped.
Not optimal but will improve once we get multiple tiers of code cache
2020-04-24 19:05:55 -07:00
Ryan Houdek 6642734aa8 Removes the dumb timer wait for idle
Turns out my Threadripper stomps these tests so the arbitrary wait time
actually slows down my unit test time.
Don't want to make it shorter since `strace -f` becomes ugly at that
point.
Instead set up a semaphore style waiting structure that waits until
there are no longer any participants in the atomic
2020-04-18 12:37:58 -07:00
Ryan Houdek 56759faff0 Merge pull request #122 from Sonicadvance1/fix_futexes
Fixes some bugs with threads and futexes
2020-04-18 12:35:56 -07:00
Ryan Houdek 36a9388481 Lets the IR validation pass validate RA
Adds some additional validation that an IR op is generating RA for ops
that set a destination.
Ensuring correct register class and that there is a physical register
assigned
2020-04-17 18:09:46 -07:00
Ryan Houdek 902cae7ebc Fixes some bugs with threads and futexes
Fixing some bugs in threading required fixing how the futexes operate.
Instead of the terrible condition variables and atomic values just use
the kernel futex facility directly.
This required fixing some of the threading management since otherwise
there was a issue around the weird mixture of our threads using our
"Futex" class and the kernel expecting real futexes on the values.
Just switch everything over and it ends up being cleaner

Fixes random mutex failures that were happening in various applications
2020-04-15 11:58:26 -07:00
Ryan Houdek 3424326987 Removes accurate-std command line argument
This is an option that has been removed
2020-04-09 18:01:29 -07:00
Ryan Houdek 8c2beba584 Cleans up x86-64 syscall implementation
Splits out to a jump table approach and loosely classifies and groups
the syscalls.

Also defines syscalls by number of arguments so it can be optimized
2020-04-05 14:00:13 -07:00
Ryan Houdek 3fd1475d30 Plumbs ELFLoader arguments through the CodeLoader
This is necessary for execve in the future to keep everything in sync
2020-03-21 15:19:31 -07:00
Stefanos Kornilios Mitsis Poiitidis e9ea4cbb76 FEXCore: Move to Externals/FEXCore 2020-03-06 09:07:37 +02:00