Commit Graph
306 Commits
Author SHA1 Message Date
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
Ryan Houdek 0111175036 Renames ELFLoader to FEXLoader
This makes more sense for us when we are installed to /usr/bin/
2020-09-03 18:38:46 -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
Scott Mansell cb6dcf62eb Add MemoryData to IR and ASM Tests 2020-08-21 01:29:37 +12: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
Stefanos Kornilios Mitsis Poiitidis 11cf66aa7a Merge pull request #287 from Sonicadvance1/remove_bad_log
Removes a debug log
2020-08-04 17:40:10 +03:00
Ryan Houdek a9d0ecda52 Removes a debug log
I set -w on the config file while testing, so this log message is just
being annoying
2020-08-02 17:59:16 -07:00
Ryan Houdek 0ce8415e7a Adds a new option for directing where debug logs go
Not interfering with things using terminal GUIs is important.
Add an option that allows us to redirect output to a file
2020-08-02 17:50:21 -07:00
Stefanos Kornilios Mitsis Poiitidis 8c8e6294b6 Thunks: ALTINST, OP_THUNK, basic infrastructure 2020-07-20 13:52:28 +03:00
Ryan Houdek 48c73ca780 Adds support for -E to the ELFLoader
Now you can pass environment variables to the guest using -E

ex. `./Bin/ELFLoader -E DISPLAY=:0 -E GALLIUM_HUD=fps,cpu /usr/bin/glxgears`
2020-07-11 09:38:57 +01:00
Ryan Houdek f3bdd9c612 Adds additional environment variable loading to the ELF HarnessHelper 2020-07-11 09:37:55 +01:00
Ryan Houdek bbf39d3f4e Adds support for the argument loader to have a new -E argument
This allows us to pass environment variables to the guest system without
polluting the host environment variable space
2020-07-11 09:37:18 +01:00
Ryan Houdek c64ad6f868 Adds support for Config values with lists of variables
Only works for lists with std::string at the moment since that is all we
need for environment variables
2020-07-11 09:36:24 +01:00
Ryan Houdek 826464d894 Ensures that Config.json stores to ${CONFIG}/Config.json
Just ensures that it gets stored in the correct XDG or ~/ config
directories.
If these don't exist then it'll get dumped in to PWD or cwdir, whichever
is available as fallback
2020-06-12 15:08:16 -07:00
Ryan Houdek cf546268ea Ensures that Unified Memory is enabled by default 2020-06-12 15:08:16 -07:00
Ryan Houdek b262b59916 Fixes up prefix handling for 32bit
Moves REX to a 64bit only table entry. This allows the missing INC/DEC
instructions to exist in 32bit space
2020-06-10 16:49:06 -07: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 03b885816e Fixes a crash that can occur when the config exists but has nothing
Common when I'm testing and wiping the config away
2020-05-30 18:56:39 -07:00
Ryan Houdek 5e4a75e8a6 Fixes crashes in unit tests
In the case of multiple dozens of tests running, they will end up
loading and saving the config files dozens of times.
This was causing the configuration system to load in half saved files
that were causing common crashes in the posix unit tests.

Theoretically this could have happened at any time but it looks like
with the posix unit tests added, it is just more likely to happen.

Makes it so loading the configuration file is much more robust and
verbose on failure.
Makes it so saving the config file first saves to a temporary and then
moves in to the correct location. This causes the config saving to be
atomic in a sense so the unit tests won't corrupt other processes of FEX
trying to load the config file.
2020-05-27 16:52:45 -07:00
Ryan Houdek 38ff936c81 Adds support for interpreter fallback
The IRHeader itself contains a flag for if a block should fallback to
the interpreter.
This is necessary for the case that an IR is loaded and the Frontend
object no longer has the data necessary to know if it should do an
interpreter fallback.
This is super useful for bisecting JIT versus Intepreter failures, and
also cases where falling back to intepreter for compatibility is a lot
more simple than wiring things through the JIT (ala x87)

This isn't currently utilized, but will be once x87 work lands
2020-05-26 19:08:18 -07:00
Ryan Houdek 7c8f7c732f Fixes some missing includes 2020-05-25 20:04:17 -07:00
Ryan Houdek ba3cb444ee Ensures test harness runner runs in 64bit mode 2020-05-14 01:03:42 -07:00
Ryan Houdek d2cf07a4fd Passes the running mode through from FEX to FEXCore 2020-05-14 00:56:31 -07:00
Ryan Houdek b70176c99a Fixes bug in TypeDefinition elements
Elements of 0 isn't a real thing. Would cause problems in the CPU
backends.
Ensure we have at least 1 element (Which technically means a vector 1
element wide, but that just defines as a scalar)
2020-05-09 12:14:59 -07:00
Ryan Houdek cda734cea2 Adds support for comment lines in the IR parser
Comments start with ';' on the line.
You can also technically have comments after IR ops but that isn't
explicitly supported, just an artifact of how things are parsed.
2020-05-09 12:14:59 -07:00
Ryan Houdek 718b3e6b4c Refactors PassManager to ingest IREmitter class instead of OpDispatcher
The Passmanager passes need very little or zero x86 knowledge to do
their work. They don't need the x86 OpDispatcher handling code at all.
Convert this entirely over to using the IREmitter class so it can
actually optimize IR code from the IRLoader frontend
2020-05-09 12:14:59 -07:00
Ryan Houdek dff0a8fb69 Switch the IRLoader over to using the IREmitter class
Reduces some code duplication
2020-05-08 19:11:31 -07:00
Ryan Houdek 9fd3cd8884 Implements IR loader frontend application
This application loads an IR from an IR file.
It then proceeds to lex the file and translate it to binary IR.
Once the file is loaded it then the IR is passed off to the backend and
it attempts to run the IR.

This will be used when debugging RA and writing unit tests directly in
IR.
This is a necessary evil for ensuring correctness
2020-05-07 17:47:37 -07:00
Ryan Houdek 66dc5ebc54 Merge pull request #179 from FEX-Emu/skmp/fix-exit-code
Propagate guest exit code
2020-05-01 16:58:07 -07:00
Stefanos Kornilios Mitsis Poiitidis d58961ef1e Propagate guest exit code 2020-05-02 02:34:50 +03:00
Stefanos Kornilios Mitsis Poiitidis 3c9be4625c Add silent log 2020-05-02 01:45:22 +03:00
Ryan Houdek 0d83454366 Merge pull request #170 from dmiller423/procfs_auxv
Added dup3 syscall, EmulatedFiles : /proc/{self,$PID}/auxv, modified …
2020-04-29 16:06:30 -07:00
David Miller 09f119a3ce removed front end header / class from EmulatedFiles.cpp 2020-04-29 16:39:40 -04:00
David Miller 306cca33d7 Added dup3 syscall, EmulatedFiles : /proc/{self,$PID}/auxv, modified OpenAt() to normalize path to canonical if possible or lexically_normal. Note: canonical will change symlinks, ensure the map keys take this into account. 2020-04-29 16:00:59 -04: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
Ryan Houdek 0c88f12801 Merge pull request #159 from dmiller423/cmake_pkg_find
CMake checks for Boost && Nasm in ./Source/Tests/CMakeLists.txt
2020-04-25 11:58:56 -07:00
David Miller 9b8871fee6 added checks for ./Source/Tests/ {Boost,NASM} 2020-04-25 14:55:28 -04:00
David Miller c77a3c0c02 changed default value of FEXCore::Context::Config::UnifiedMemory to proper location 2020-04-25 14:34:34 -04:00
David Miller e9003acf36 Ensure TestHarnessRunner doesn't enable UnifiedMemory. 2020-04-25 12:56:37 -04:00
David Miller 0c51baf7a8 Added default Config::UnifiedMemory value to true 2020-04-25 12:49:41 -04:00
David Miller 1589b9a351 Added EnvLoader to frontend binaries, called prior to ArgLoader 2020-04-24 19:53:28 -04:00
David Miller 75ee8f0604 EnvironmentLoader, clean merge 2020-04-24 19:25:57 -04:00
David Miller 5999e7477f Added guard around llvm/IR/IntrinsicsX86.h inclusion, seems to only be needed for version 10?\nMore Investigation needed here.\nChanged Debugger/IMGui.{h,cpp} to IMGui_I so it will build in filesystems that aren't case sensitive.\nAdded CMakeSettings.json that has profiles to build from VisualStudio, using env variables to control system specific options. \n Currently only the WSL is tested (and working). \nRemote should work as well, if correct string for preconfigured remote is in env variable fexremote.\nCross compile (to linux) untested, using sysroot in env variable fexsysroot 2020-04-23 16:12:28 -04:00
Ryan Houdek 780278a7f6 Fixes memory allocation
4GB virtual memory is too small and causes things to fault.
Previously we were at `1 << 36` but it caused oom issues on devices with
smaller amounts of memory.
This time ensure the the SHM memory is allocated with MEM_NORESERVE so
devices can actually allocate the virtual memory region.
2020-04-12 18:39:00 -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 5298379fb9 Ensure the ELFLoader doesn't end up in the lower 32bit address space
We need to reserve that space for EXEC apps and 32bit apps. Hard throw a
warning if any of our mapping space ends up in the lower 32bits.

PIE and potentially a custom dynamic linker can enforce this.
2020-04-08 13:35:29 -07:00
Ryan Houdek 15d5ba6fc1 Adds RootFS search path in ELFLoader
Fixes #69, makes it less annoying to run things on non x86 hosts
2020-04-04 23:17:40 -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