Commit Graph
370 Commits
Author SHA1 Message Date
Stefanos Kornilios Mitsis Poiitidis 0c1510e763 Merge pull request #641 from Sonicadvance1/uninstall_handlers
Uninstalls both the signal delegator and logmanager handlers on shutdown
2021-01-13 12:15:10 +02:00
Ryan Houdek aa3b77e4c8 Uninstalls LogManager handlers on shutdown
In case something manages to have stayed alive and tried throwing a
message, this will no longer crash.

Noticed this with the previous commit
2021-01-11 09:03:56 -08:00
Ryan Houdek f83698cb50 Uninstalls SignalDelegator signals on destruction
Tear this down earlier so if we catch a signal on shutdown then we don't
crash in the handler.

Fixes some pain around debugging shutdown crashes
2021-01-11 09:01:06 -08:00
Stefanos Kornilios Mitsis Poiitidis 6542f08f27 Merge pull request #623 from Sonicadvance1/capture_fsstatat
Captures fsstatat in filesystem overlay
2021-01-11 16:20:15 +02:00
Stefanos Kornilios Mitsis Poiitidis 1e80d3527b Merge pull request #624 from Sonicadvance1/capture_osrelease
Have EmulatedFiles support osrelease file
2021-01-11 16:20:04 +02:00
Stefanos Kornilios Mitsis Poiitidis a1ac4c711c Merge pull request #631 from duck-37/dump-ir-runner
Pass DumpIR to TestHarnessRunner
2021-01-11 11:02:03 +02:00
Stefanos Kornilios Mitsis Poiitidis d7868fd2bd Merge pull request #627 from Sonicadvance1/disable_visual_debugger
Disables visual debugger by default
2021-01-11 11:00:16 +02:00
Stefanos Kornilios Mitsis Poiitidis db71916ee4 Merge pull request #625 from Sonicadvance1/shebang_improvements
Shebang improvements
2021-01-11 10:58:51 +02:00
duck d1b1e5ae07 pass DumpIR to TestHarnessRunner 2021-01-10 17:44:33 -05:00
Ryan Houdek c2b1d68ed1 Disables visual debugger by default
This is currently broken and going to be broken more soon
2021-01-10 02:19:39 -08:00
Ryan Houdek 8f1978a33a Shebang improvements
Fixes a problem where a space between the shebang and application
argument would result in us trying to execute a null program.

Additionally it now captures all the arguments passed in the shebang
header rather than just the application and first argument.
2021-01-10 02:15:51 -08:00
Ryan Houdek 22377d9c2c Have EmulatedFiles support osrelease file
This was being checked by an application for kernel version. Which was
seeing too new of a kernel and using things that were unsupported.

Also removes the EmulatedMap which is an unnecessary lookup.
2021-01-10 02:14:44 -08:00
Ryan Houdek 66e98365eb Captures fsstatat in filesystem overlay
Fixes Vulkan loader searching for vulkan json ICD files
2021-01-10 02:13:48 -08:00
Ryan Houdek a29371dbf5 Fixes execve with rootfs
We need to check to see if the application wanting to be executed is in
the rootfs first. Otherwise we end up in a case where we either lose
tracking of applications in FEX, or applications fail to launch since
they don't exist in the global filesystem
2021-01-10 02:12:42 -08:00
duck 6388151fc0 Oops. 2021-01-06 18:12:09 -05:00
duck ffc4996ca6 DidFail -> DidFault 2021-01-06 18:11:23 -05:00
duck f9cd0f0179 Have tests that throw a non-HLT SIGSEGV fail
Patch moves HandleSIGSEGV in HostFactory.cpp to a non-frontend host signal handler, then registers its own frontend signal handler to catch unhandled segfaults.
2021-01-06 05:07:47 -05:00
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