Commit Graph
396 Commits
Author SHA1 Message Date
Ryan Houdek 1b1e922830 Removes warnings from HostFactory 2021-01-31 08:01:53 -08:00
Stefanos Kornilios Mitsis Poiitidis 513112919b RA: Move allocation data to RAData 2021-01-29 10:42:40 +02:00
Stefanos Kornilios Mitsis Poiitidis d6ee3caad4 Syscalls: Define MREMAP_DONTUNMAP if missing 2021-01-28 17:09:08 +02:00
Ryan Houdek a98eaa6a27 Finishes 32bit memory allocator
This was partially implemented before but it had some bugs still.
This fixes those bugs and also implements mremap, shmat, and shmdt.

This now works well enough for 32bit graphical applications
2021-01-27 10:49:28 -08:00
Ryan Houdek 2d8b70bbd5 Merge pull request #710 from Sonicadvance1/brk_improvements
More improvements to BRK handling
2021-01-27 10:49:07 -08:00
Ryan Houdek a5d9e62cc6 More improvements to BRK handling
Base size is now only one page in size. We will then increment that BRK
size by 8MB alignments. 256MB for 32bit applications was causing some
applications on the edge to run out of virtual memory
I was hitting some 32bit applications that were being fairly mean with
BRK. They were allocating all of BRK space then running out of virtual
memory space with its mmap handler fallback after freeing BRK space.

This means we now munmap BRK pages on release for the guest, similar to
behaviour that Linux does.

Additionally I had an application that was getting very upset that BRK
wasn't actually at the end of program space. So allocate at the end of
program space like expected.

brk test now passes from gvisor
2021-01-27 10:12:25 -08:00
Ryan Houdek 15df787710 Implements ioctl32 for x86-64
If you have the COMPAT feature enabled then this just works there.
AArch64 not implemented currently since changes aren't upstream
2021-01-27 08:02:49 -08:00
Stefanos Kornilios Mitsis Poiitidis 8ff0b870b1 Merge pull request #712 from Sonicadvance1/fix_timers
Fixes timer syscall API
2021-01-26 15:33:00 +02:00
Ryan Houdek 3679156dd7 Fixes timer syscall API
The glibc and kernel timer interfaces are sufficiently different enough
that unwrapping this through glibc is impossible.
Pass it directly through to the kernel.
2021-01-26 05:02:44 -08:00
Ryan Houdek cab317e2f0 Removes all references to Boost
We don't require this
Fixes #699
2021-01-26 02:34:26 -08:00
Ryan Houdek 2721418fb7 Merge pull request #698 from phire/better_defaults
Better Default Configuration
2021-01-22 16:56:29 -08:00
Scott Mansell 3cae0a0932 Better Default Configuration
Make FEX have good performance out of the box

resolves #685
2021-01-23 13:47:53 +13:00
Stefanos Kornilios Mitsis Poiitidis 8b025d4c26 IRLoader: Actually set EntryRIP if the IR was parsed 2021-01-21 22:19:16 +02:00
Stefanos Kornilios Mitsis Poiitidis e7f2a650b5 Fix compilation 2021-01-21 22:18:48 +02:00
Stefanos Kornilios Mitsis Poiitidis 3bd8731b26 IR: Add CONFIG_VALIDATE_IR_PARSER, enable it on TestHarnessRunner 2021-01-21 21:38:41 +02:00
Stefanos Kornilios Mitsis Poiitidis 1177c375ff IR: Further parser cleanups, add fence types 2021-01-21 21:17:27 +02:00
Stefanos Kornilios Mitsis Poiitidis 072067b5fd IR: Split parser from IRLoader, add IR::Parse() 2021-01-21 19:17:51 +02:00
Stefanos Kornilios Mitsis Poiitidis 036771d825 IR: Fix Printing and Parsing for float conds 2021-01-21 10:16:08 +02:00
Ryan Houdek 108992de80 Merge pull request #653 from Sonicadvance1/add_O0
Adds an option to disable optimization passes
2021-01-18 00:10:48 -08:00
Ryan Houdek 544a1f307f Adds an option to disable optimization passes
Instead of forcing someone to test by modifying code, allow a -O0 option
to be passed in.
Also added to FEXConfig GUI for easily touching.

Fixes #652
2021-01-17 23:51:22 -08:00
Ryan Houdek 0e11dea46f Adds kernel version check to FEXLoader
We require kernel 4.17 minimum on the host to run correctly
2021-01-15 13:55:04 -08:00
Ryan Houdek 80dfa76d48 Have SyscallHandler calculate host kernel version 2021-01-15 13:44:08 -08:00
Stefanos Kornilios Mitsis Poiitidis f951bc969e Merge pull request #628 from Sonicadvance1/more_syscalls
Implements more syscalls
2021-01-13 20:45:02 +02:00
Stefanos Kornilios Mitsis Poiitidis 271d5898fb Merge pull request #642 from Sonicadvance1/fix_llvm_asan
Fixes 64bit ELF loading when LLVM ASAN is used
2021-01-13 12:55:58 +02:00
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 433162004a Implements more syscalls 2021-01-12 14:50:17 -08:00
Ryan Houdek 43af4e26d1 Fixes 64bit ELF loading when LLVM ASAN is used
Instead of hardcoding 64bit dynamic ELF files to 0x1'0000'0000 we
instead calculate the size of the ELF in memory. Then allocate the
ELF base up front.

LLVM ASAN steals a large amount of virtual memory space that intersected
with the original hardcoded range which caused memory allocations to
fail.
2021-01-11 09:07:16 -08: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