Commit Graph
321 Commits
Author SHA1 Message Date
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
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