Commit Graph
69 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
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 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 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 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 e9003acf36 Ensure TestHarnessRunner doesn't enable UnifiedMemory. 2020-04-25 12:56:37 -04:00
David Miller 1589b9a351 Added EnvLoader to frontend binaries, called prior to ArgLoader 2020-04-24 19:53: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