Commit Graph
40 Commits
Author SHA1 Message Date
Stefanos Kornilios Mitsis Poiitidis 3978097f15 Merge pull request #705 from FEX-Emu/skmp/mmap-cache-flushing
Flush IR/Code cache on mmap, mmunmap & mprot
2021-03-03 12:59:29 +02:00
Stefanos Kornilios Mitsis Poiitidis e92578817d SMC: Flush IR/Code cache on mmap, mmunmap & mprot 2021-02-26 13:22:05 +02:00
Ryan Houdek 9746e0175e Change unsupported faccessat2 to use safe syscall unsupported 2021-02-25 13:45:24 -08:00
Ryan Houdek d78a3784fb Guards SYS_faccessat2 define for new enough glibc defines 2021-02-25 13:44:40 -08:00
Ryan Houdek 7dd5252d68 Implements support for faccessat2 in syscallhandler
Only exists if the host kernel is >= 5.8.0.
2021-02-24 09:52:30 -08:00
Ryan Houdek ac92a103df Adds support for faccessat2 to FileManager 2021-02-24 09:51:29 -08:00
Ryan Houdek 74a00fee0f Updates syscall definitions enums 2021-02-24 09:51:03 -08:00
Stefanos Kornilios Mitsis Poiitidis 075cd423ed AOTIR: Review feedback 2021-02-23 12:08:57 +02:00
Stefanos Kornilios Mitsis Poiitidis abb2e09c20 AOTIR: Add support for 32-bit process 2021-02-23 12:08:57 +02:00
Stefanos Kornilios Mitsis Poiitidis b3d12fbb7b AOTIR: Cleanup interface 2021-02-23 12:08:57 +02:00
Stefanos Kornilios Mitsis Poiitidis d825ed2b03 AOTIR: Reduce map lookup 2021-02-23 12:08:57 +02:00
Stefanos Kornilios Mitsis Poiitidis 3e1e093b24 AOTIR: Store in ~/.fex-emu/aotir, per so 2021-02-23 12:08:57 +02:00
Stefanos Kornilios Mitsis Poiitidis 47d4481a75 AOTIR: Support relocations via new ir op 2021-02-23 12:08:57 +02:00
Ryan Houdek d3e98fedb4 Pulls uname nodename from host system
Hardcoding FEXCore as the nodename is an annoyance.
Pull the host's nodename instead.

Fixes #600
2021-02-22 22:39:05 -08:00
Stefanos Kornilios Mitsis Poiitidis 568fb3643d Syscalls/x86-32: Fix selects to actually remarshal the sets after running the host syscall 2021-02-16 02:35:38 +02:00
Scott Mansell 3d6461f0ca BRK: don't munmap if mmap failed 2021-02-09 17:29:44 +13:00
Scott Mansell 46ec7c406f emulated-cpuid: add some comments 2021-02-09 13:03:49 +13:00
Scott Mansell a28acf5505 Fix the number of physical cpus reported. 2021-02-09 12:52:27 +13:00
Ryan Houdek 0aaed41f72 Merge pull request #751 from FEX-Emu/skmp/fix-fchmodat-faccessat
Syscalls: chmodat, faccessat glibc interface differs from kernel
2021-02-02 05:52:38 -08:00
Stefanos Kornilios Mitsis Poiitidis f9aa457e3f Syscalls: chmodat, faccessat glibc interface differs from kernel 2021-02-02 14:35:27 +02:00
Scott Mansell 9fa108ff33 Move -lnuma to correct place 2021-02-02 16:47:55 +13:00
Scott Mansell 45962098ef Refactor LinuxSyscalls to it's own static library 2021-02-02 16:47:55 +13: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
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 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 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 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
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
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
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