Commit Graph
18 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 8e2bb1faed 32-bit: Keep the memory view range reserved, and mask guest addresses to it
Find4GBBase found 256 MB of free address space for the views and then
unmapped it, so the gaps between the views went back to the system. On a
32-bit Android device, a running game had malloc heaps between VRAM and RAM
and GPU driver buffers just past RAM, and masked guest addresses (bits 30-31
cleared) reach a whole GB above base, mostly heap. A stray guest access
landed in those silently instead of faulting, and another thread could even
map something where a view was about to go, which the view's MAP_FIXED then
replaced. That fits the 32-bit-only crashes deep in system libraries and in
our own heap structures.

Keep the range reserved as PROT_NONE and map the views over it, putting the
reservation back when a view is released. Mask out bits 28-29 too on 32-bit
(no valid address has them), so accesses stay inside the reservation.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-20 23:21:11 +02:00
Henrik Rydgård 2cd44a5b16 MemArenaAndroid: Check fd before calling close(), zero after. 2025-04-30 09:54:50 +02:00
Henrik Rydgård e01ca5b057 Logging API change (refactor) (#19324)
* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
2024-07-14 14:42:59 +02:00
M4xw 5b6bc0cea7 [MemArena] Honor MV_MIRROR_PREVIOUS on ReleaseView
Allows for clean teardown of the Memory Map for Switch
2023-06-22 00:01:38 +02:00
Henrik Rydgård 0bc7854062 Android: Don't assert on failed Find4GBBase 2023-01-12 01:18:52 +01:00
Henrik Rydgård 6c51dabe9a Somewhat improved error checking in MemArena. 2021-07-07 19:01:42 +02:00
Henrik Rydgård f01ba6dc84 Move NativeApp.h to Common/System, split into NativeApp.h and System.h
Buildfix
2020-10-04 11:42:16 +02:00
Unknown W. Brackets 2b49c3e464 MemMap: Check for MAP_FAILED in mmap call. 2020-09-13 00:37:20 -07:00
Henrik Rydgård b43698a13d Remove most instances of base/logging.h from Common, Core, GPU, more 2020-08-15 19:08:44 +02:00
Henrik Rydgård 617bbcfb87 Step 1 of removing PanicAlert 2020-07-19 20:33:25 +02:00
Filippo Scognamiglio 58f6426167 Remove unused import. 2020-02-03 22:17:27 +01:00
Filippo Scognamiglio c00ce91a2a Use System_GetPropertyInt(SYSPROP_SYSTEMVERSION to retrieve version. 2020-02-03 22:10:47 +01:00
Filippo Scognamiglio f514852791 Use ASharedMemory api instead of direct access to /dev/ashmem which is deprecated. 2020-02-03 20:57:34 +01:00
Henrik Rydgård 06facfc567 Android: Get our base pointer in a saner way than YOLO, if possible. Should help #12249. 2019-08-17 11:52:44 +02:00
Henrik Rydgård 21fe73c8e7 Switch strncpy to truncate_cpy in a bunch of places. 2017-05-26 19:04:08 +02:00
Henrik Rydgård 6ea3c6a7e3 Delete unused code 2017-01-26 08:51:48 +01:00
Henrik Rydgård 5e61a5afe1 Implement fastmem for Darwin. Not very successfully yet.. 2017-01-25 17:14:43 +01:00
Henrik Rydgard 73a2a1bc0f The MemArena code has way too many ifdefs. Split it up by platform. 2017-01-25 16:20:21 +01:00