Commit Graph
353 Commits
Author SHA1 Message Date
Ryan Houdek ca2a10e0e5 Removes dead HandleSyscall function
The virtual function is called directly, so we were missing the strace
functionality
2020-12-19 19:50:33 -08:00
Stefanos Kornilios Mitsis Poiitidis ef75b8e4ec Merge pull request #582 from Sonicadvance1/move_syscalls
Moves FEXCore's SignalDelegator and SyscallHandler to the frontend
2020-12-16 12:52:39 +02:00
Stefanos Kornilios Mitsis Poiitidis 5889ad9d60 Merge pull request #584 from Sonicadvance1/asan_fixes
Fixes I found when running ASAN
2020-12-14 20:02:56 +02:00
Ryan Houdek 9f5a507f67 Disables lower 32bit mapping check when ASAN is compiled in
LLVM ASAN sticks some things in the upper range of the 32bit memory
range.
So we have to just allow it when using LLVM asan
2020-12-14 03:59:04 -08:00
Ryan Houdek 92c8303798 Fixes for FEXConfig
Fixes the formatting. Everything was using the incorrect formatting.

Changes the saved msg popup to a generic popup handler.

If a file couldn't be opened, open a popup claiming the error.
Makes it nicer to realize when trying to open main and nothing happens
when the file doesn't exit
2020-12-13 22:39:10 -08:00
Ryan Houdek 37983006f0 Moves FEXCore's SignalDelegator and SyscallHandler to the frontend
Sadly these things can't be split without breaking functionality so it
turns in to a bit of a mess.

SyscallHandler is very much something that is a Linux only construct and
shouldn't be in FEXCore itself. Lets the frontend register a
Syscallhandler with FEXCore. FEXCore itself is then aware of the current
syscall ABI and handles the ABI in an optimal fashion.
So it is not a 100% clean break otherwise we would lose performance.

The SignalDelegator then needs to move to the frontend since the
SyscallHandler requires it for signal based syscalls.
The CPU backend signal handling still needs to happen in FEXCore because
it is a very tight coupling with the CPU backend.
Once we need to support more Signal handling we can give the backends
cleaner support to select which specific OS handler to handle.
2020-12-13 22:38:04 -08:00
Ryan Houdek 36b24ad141 Removes all uses of non-unified memory and SHM regions
Let's just delete the whole thing!
2020-12-10 02:09:52 -08:00
Ryan Houdek 3d9bdd3c83 Removes the broken TestSingleStepHardware runner 2020-12-10 02:01:14 -08:00
Stefanos Kornilios Mitsis Poiitidis 6d671166e4 Merge pull request #578 from Sonicadvance1/more_robust_interpreter_check
More robust FEXInterpreter checks
2020-12-10 11:37:21 +02:00
Ryan Houdek 20f11f25ca Fixes FEXInterpreter argument loading
If the guest application tried pushing arguments then optparse was still
capturing them as unknown and failing.

Just push the arguments directly in to our argument lists
2020-12-09 20:35:02 -08:00
Ryan Houdek 01831ec264 Check for binfmt_misc install and run directly only if installed
If we want to execve files directly we need to ensure that the
binfmt_misc interpreter path is installed.
If it isn't installed then we need to fall down the regular path of
pushing FEX to the front of the argument list.
2020-12-09 20:34:03 -08:00
Ryan Houdek ee88edaa6d Changes FEXInterpreter install to a hardlink
The only way to determine if we are running in the "interpreter" mode is
by determining filename.
if any application does an execve then we use /proc/self/exe to
determine which FEX we should execute. Sadly this resolved the softlink
to FEXLoader, breaking the chain.
Change it to a hardlink in order to ensure this doesn't happen.

This also moves the install target outside of aarch64 install target so
it can be tested on x86 hosts.
2020-12-09 20:27:30 -08:00
Ryan Houdek 6dc532e90e Removes Main config loader from test runners
This was accidental and can cause test failures.
Make sure to not load arguments from Main config for these
2020-12-09 20:04:58 -08:00
Ryan Houdek 92dc46c8bd Adds x86 binfmt_misc support
Allows launching 32bit applications directly now
2020-12-08 07:28:51 -08:00
Ryan Houdek db49ab4149 Changes the frontend FEXLoader argument loading path
If the interpreter was executed then don't even try handling arguments.
They will all get passed to the guest application
2020-12-08 07:28:50 -08:00
Ryan Houdek 1b4dc23c13 Adds an argument loader without FEX arguments
Will be necessary when the interpreter path is enabled, we can't accept
arguments there
2020-12-08 07:28:50 -08:00
Ryan Houdek d7c4999355 Adds a symlink install target
Symlinks FEXLoader to FEXInterpreter and switches binfmt_misc to use it
It's the only safe way to determine if we are the interpreter or just
someone executing through FEXLoader directly.
2020-12-08 07:28:50 -08:00
Ryan Houdek 7e2ddc6fb6 Adds a new UI application for setting config options 2020-12-08 07:24:52 -08:00
Ryan Houdek f14cd54791 Switches over to having a correctly layered configuration system
Instead of having the configuration being loaded and stored in to a
frontend system. First moves the backing store of the configuration in
to FEXCore.

Each layer that is constructed then loads its particular configuration.
After the layers are loaded, then a meta layer is constructed that
merges the layers flat.

This means we will no longer hit the problem where a configuration is
stored in the "main" configuration file, then environment and arguments
passed manage to overwrite it.

The order of the layers going from inner most layer to outer most, with
outermost overwriting previous layer configurations is as follows:

Main < Global application < Local application < Arguments < Environment

One step that needs to be changed in the future is that FEXCore can then
just load its configuration from the layers directly since the data is
in FEXCore now. This will be reserved for a future change so we are less
disruptive.
2020-12-07 11:15:48 -08:00
Ryan Houdek 48e675e9de Removes the lockstep runner
This has long been broken and will block configuration changes
2020-12-05 21:17:52 -08:00
Ryan Houdek a28df9f5c1 Moves SonicUtils in to FEXCore
Removes the extraneous and dead VM CPU backend
2020-11-29 00:30:28 -08:00
Ryan Houdek 6605c6e6eb Removes dead TLS setting code
This is no longer necessary now that phire fixed mapping of static elfs
2020-11-25 13:18:57 -08:00
Ryan Houdek e4820c6fc7 Merge pull request #530 from phire/static_elf_fixes
Fix mapping of static elfs.
2020-11-25 13:09:03 -08:00
Scott Mansell f29e0441e3 Fix mapping of static elfs.
We were previously relocating them up 16KB,
which can cause them to break.
2020-11-26 09:56:22 +13:00
Ryan Houdek 2ce8148f3f Shebang rootfs prefix improvements
If we are passed a shebang application then append the rootfs prefix for
absolute paths.
Fixes the issue where bash scripts weren't working on ARM.

Also fixes a crash that can occur if FEX wasn't passed in arguments
or if the argument passed in didn't exist.
It'll now instead exit cleanly and state that the application doesn't
exist respectively.
2020-11-24 19:25:27 -08:00
Ryan Houdek 4503f41957 Merge pull request #473 from FEX-Emu/skmp/memops-addressgen
Complex address generation for Load/StoreMem
2020-11-19 23:57:20 -08:00
Ryan Houdek eb094bcf98 Adds support for shebang redirection
If a file has as shebang interpreter then switch over to that.
Fixes launching a bunch of titles in Steam where their launcher is a
bash script
2020-11-17 12:18:30 -08:00
Stefanos Kornilios Mitsis Poiitidis c5316b1fc5 IR Loader: Add support for MemOffsetType, Fix %Invalid 2020-11-17 16:23:50 +02:00
Stefanos Kornilios Mitsis Poiitidis 11e12a9b36 Add --unsafe-no-pf 2020-11-17 11:11:13 +02:00
Stefanos Kornilios Mitsis Poiitidis 0d7984fe0f Rename unsafe options under --unsafe 2020-11-17 11:08:29 +02:00
Stefanos Kornilios Mitsis Poiitidis 8fc6f73571 IR: InvalidateFlags + --abi-local-flags
- InvalidateFlags pseudo-op is a hint for the Dead Flags Elimination pass that flags are not needed past that point
- Adds a new option, --abi-local-flags, that invalidates the flags on CALLs or RETs. This might break code that doesn't follow the ABI rules.
2020-11-17 11:08:29 +02:00
Stefanos Kornilios Mitsis Poiitidis 2dad4718d6 IR: Add DumpIR option, --dump-ir command line
This dumps the IR before and after optimizations

--dump-ir can be

"no" -> Do not dump
"stderr" -> Dump to stderr
"stdout" -> Dump to stdout
"some/path" -> Dump to "some/path/$GuestRip-pre.ir" and "some/path/$GuestRip-post.ir"
2020-11-16 16:14:07 +02:00
Ryan Houdek 6741b9d23f Fixes Unit Test loader offset
This was causing 32bit unit tests to load in to high 64bits.
Loads at offset constant 0x1'0000 so we always know where the code is
loaded
2020-10-17 20:17:45 -07:00
Ryan Houdek 7a62fad444 Fixes 32bit ELF Loading
This requires some changes to how the ELF memory bases are calculated
and which auxp variables are passed in
2020-10-13 15:46:27 -07:00
Ryan Houdek 868e2944c4 Merge pull request #454 from Sonicadvance1/32bit_ELFLoader
Adds support for 32bit ELFs to the code loader
2020-10-07 11:13:23 -07:00
Ryan Houdek fecdc312f3 Adds support for 32bit ELFs to the code loader
Matches most of the 64bit behaviour but with expected 32bit pointers
2020-10-06 20:39:57 -07:00
Ryan Houdek 567be0eea0 Fixes Test Harness runner loading tables with wrong mode
We weren't passing the operating mode to context's static initializer
correctly
2020-10-06 19:57:12 -07:00
Ryan Houdek 4da4e9c7c8 Fixes misalignment of code laoding section
This was legacy that code was loaded at offset 1.
Load it at our base offset so nasm alignment works correctly
2020-10-04 16:04:30 -07:00
Ryan Houdek cb525e4a59 Implements x86 host runner
Will be used for unit tests
2020-09-22 23:19:48 -07:00
Stefanos Kornilios Mitsis Poiitidis 9e91310a62 Merge pull request #400 from Sonicadvance1/test_exec
Ensures the unit test code is marked executable
2020-09-23 01:43:28 +03:00
Ryan Houdek 5c32bac737 Ensures the unit test code is marked executable
This will become important in the future when we are actually executing
this code directly on host.
FEX itself doesn't yet care about memory permissions
2020-09-22 13:14:04 -07:00
Ryan Houdek eb35df0b68 Allows unit tests registers to have partial register views
This allows us to only check for the lower 64bits of the MM registers
when doing MMX ops for example.
Top 16bits in that case is undefined and needs to be ignored
2020-09-22 13:10:12 -07:00
Ryan Houdek 672be71903 Forces FEXLoader to use unified memory
The non-unified memory path is completely untested and broken now with
the ELFLoader.
Just not allow it now
2020-09-17 15:39:52 -07:00
Ryan Houdek 22e658e36d Foces the test harness runner to use unified memory
All the previous fixed offset problems are now fixed so we can flick
this on.

We still allocate memory regions at fixed addresses, but due to
enforcing pie this is fine.
2020-09-17 15:38:40 -07:00
Ryan Houdek d424cf0eee Merge pull request #365 from phire/IR_iterators
Refactor the IR Interface to prevent "foot-shooting"
2020-09-16 11:24:44 -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
Scott Mansell 446b261f24 Iterator for blocks 2020-09-11 21:48:03 +12: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 1785b310f9 Adds a binfmt_misc install target
This will install a binfmt_misc target for x86_64 targets that allows
FEXLoader to be the interpreter.

Everything else is already set up to allow this to work, just time to
hook it up.
2020-09-03 23:20:57 -07:00
Ryan Houdek 7c9f06f2d8 Allows installing FEXLoader
This wasn't installed at all previously
2020-09-03 18:39:41 -07:00