Commit Graph
632 Commits
Author SHA1 Message Date
Alula 4e917d700f kern: allocate the shadow stack 2026-09-18 04:02:54 +02:00
Alula af14725916 kern: handle SVE exceptions 2026-09-18 03:38:32 +02:00
hexkyz ab1e8a3e32 kern/loader/svc: adopt updated names 2026-09-17 21:42:22 +01:00
Alula dbfe192b2f kern: reject shadow stack accesses in syscalls 2026-09-15 17:04:50 +02:00
Alula 7e58f5fbae kern: finish shadow stack region, 64k page process segregation implementation, fix some long-standing issues 2026-09-15 17:04:50 +02:00
Alula 289ba7104e kern: add new unknown DebugThreadParam 2026-09-15 17:04:50 +02:00
Alula 0f15010ba5 kern/loader: make aware of new address space and shadow stack region 2026-09-15 17:04:50 +02:00
hexkyz f7d46d38fa meso: only increment send/recv/exch on success 2026-08-21 23:13:40 +01:00
hexkyz 3a3a2ca99b ams: basic support for compiling with gcc 16 2026-06-16 21:10:23 +01:00
hexkyz c046eeacdd meso: fix longstanding bad asm copy-paste 2026-06-16 19:22:54 +01:00
Alula b29dbeae3d kern: don't allow mapping device pages as executable on abi 26.x+ 2026-03-18 23:25:24 +01:00
Alula a985bdb1d4 kern: N made this an u32 for some reason 2026-03-18 23:25:24 +01:00
Alula 0ee6277be9 kern: write thread handle to tls +0x110 on creation 2026-03-18 23:25:24 +01:00
Michael Scire d9fc6e99eb kern: eshop actually requires an extra mb 2025-11-15 17:35:47 -07:00
Michael Scire b5b6189c85 kern: fix comparison typo 2025-11-15 16:51:15 -07:00
Michael Scire 540d00e097 kern: 21.0.0 requires an even smaller memory pool... 2025-11-15 16:47:44 -07:00
Michael Scire 0fb9481e59 kern: fix debug build for [[nodiscard]] changes 2025-11-15 12:31:07 -07:00
Michael Scire c05d91f44a kern: fix whoops introduced by nodiscard refactor 2025-11-15 12:31:07 -07:00
Michael Scire 2a44550dbe kern: pass u32 directly to CopyMemoryToUserSize32Bit 2025-11-15 12:31:07 -07:00
Michael Scire 3bc1951820 ams: mark ams::Result [[nodiscard]] (partially complete).
NOTE: This work is not yet fully complete; kernel is done, but
it was taking an exceedingly long time to get through libstratosphere.
Thus, I've temporarily added -Wno-error=unused-result for libstratosphere/stratosphere.

All warnings should be fixed to do the same thing Nintendo does as relevant, but this
is taking a phenomenally long time and is not actually the most important work to do,
so it can be put off for some time to prioritize other tasks for 21.0.0 support.
2025-11-15 12:31:07 -07:00
Michael Scire e36051359c kern: write cpu tick differential to tls +0x108 on thread switch 2025-11-15 12:31:07 -07:00
Michael Scire f4e1d0bf9f kern: move spendsgir static assert 2025-05-28 12:18:51 -07:00
Michael Scire 801438953d kern: save/restore spendsgir in KInterruptController::Save/RestoreCoreLocal 2025-05-28 10:54:52 -07:00
Michael Scire 3fbc59cce1 kern: wait 100us after synchronizing cores before saving interrupt state on sleep 2025-05-28 10:48:42 -07:00
Michael Scire f646d9c8f9 kern: use KLightLock for KCoreBarrierInterruptHandler 2025-05-28 10:44:31 -07:00
Michael Scire b7ec64ea16 fs.mitm: add and use memlet module to temporarily steal applet memory while building romfs images.
Starting in 20.0.0, the browser needs more applet memory to function, so we can't steal as much any more.
Thus, we now steal 14 MB on 20.0.0+ instead of 40MB.

However, since this reduces memory available for custom system modules, we are adjusting to compensate.
ams.mitm's heap size has been reduced from 32MB to 12MB (recovering 20MB).
In addition, fs.mitm now uses a new mechanism for stealing memory from the applet pool while romfs is being built.

On net, we are compromising:
    * Custom sysmodules lose memory available to them.
        On 19.0.0/AMS 1.8.0, there was 30 MB available for custom sysmodules.
        Stealing 14 MB instead of 40 MB, we lose 26 MB of that. Reducing ams.mitm's usage will gain us back 20.
        Nintendo also appears to...use 4 extra MB, in 20.0.0, from my test homebrew.
        So on 20.0.0/AMS 1.9.0, there should be 20 MB available for custom sysmodules.
        On the bright side, on <20.0.0/AMS 1.9.0, I guess there will be 50 MB available for custom sysmodules now?
    * totk mods will lose the ability to...put every file in the romfs on sd card. There will be some unknown maximum filecount for totk mods.
        On the bright side, implementing the transient memory stealing should improve compatibility for some mods which strictly add files?
2025-05-09 11:55:21 -07:00
Michael Scire b1ca5b4049 kern: plutoo is an intellectual, I am a fool, fix chicanery 2025-05-09 11:55:21 -07:00
Michael Scire 4580a352c0 kern: use callback to note pte updates in KPageTableImpl 2025-05-09 11:55:21 -07:00
Michael Scire 28296e2aac kern: refactor FindFreeArea region search logic per 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire b80f0944ab kern: update instruction cache invalidation logic in KPageTableBase to reflect 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire 96d4546498 kern: reorder resource manager implementation 2025-05-09 11:55:21 -07:00
Michael Scire 86e4bed056 kern: support null resource limit in KSecureSystemResource 2025-05-09 11:55:21 -07:00
Michael Scire b27999a116 kern: adjust system registers during exception handling on MTE-violation or kernel address fault 2025-05-09 11:55:21 -07:00
Michael Scire 98e5bd4411 kern: update UserspaceAccess functions for 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire 3e19e4d004 kern: update KAddressSpaceInfo to reflect 20.0.0 changes 2025-05-09 11:55:21 -07:00
Michael Scire 66fcf33a2c kern: invert meaning of KTargetSystem/KSystemControl bools 2025-05-09 11:55:21 -07:00
Michael Scire 6125f40bdb ams: various fixes to support booting debug configuration 2025-04-08 13:43:29 -07:00
Michael Scire 85fd13f724 kern: update KernelLdr for 19.0.0 (new checks, dummy function call).
Also, fix a few very embarassing mistakes in kernel ldr:
* We have been mapping the page table region RWX for a few years now, accidentally.
* My attempt at making initial page tables not use bit 58 was broken in multiple ways.
2025-04-07 16:49:10 -07:00
Michael Scire 3522ac18c1 kern: support reboot to fatal error on mariko 2024-10-15 21:48:59 -07:00
Michael Scire e63cae5c77 kern: Perform page table validity pass during KPageTableImpl::InitializeForKernel 2024-10-15 21:48:59 -07:00
Michael Scire c911420d6a kern: fix more page table refactor bugs 2024-10-15 21:48:59 -07:00
Michael Scire 570989384b kern: first round of page table refactor bug fixes 2024-10-15 21:48:59 -07:00
Michael Scire 4c81432e94 kern: update KPageTable::Map for new refactor 2024-10-15 21:48:59 -07:00
Michael Scire e1e84d4450 kern: update ChangePermissions to use new iteration logic 2024-10-15 21:48:59 -07:00
Michael Scire d2656e3948 kern: update KPageTable::Finalize for the refactor 2024-10-15 21:48:59 -07:00
Michael Scire 62abb31122 kern: use new merge pages api 2024-10-15 21:48:59 -07:00
Michael Scire cb970049db kern: implement KPageTableImpl merge 2024-10-15 21:48:59 -07:00
Michael Scire 9610f42dc0 kern: continue page table refactor, implement separate/unmap 2024-10-15 21:48:59 -07:00
Michael Scire 02e837d82e kern: start KPageTable(Impl) refactor, use array-with-levels for KPageTableImpl 2024-10-15 21:48:59 -07:00
Michael Scire 9cfd535568 kern: invoke supervisor mode thread functions from C++ context with valid stack frame 2024-10-15 21:48:59 -07:00