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