Changes

Jump to navigation Jump to search
2,972 bytes added ,  03:43, 27 August 2020
Line 71: Line 71:  
** The initial arguments now store an entrypoint invocation function pointer in addition to the entrypoint.
 
** The initial arguments now store an entrypoint invocation function pointer in addition to the entrypoint.
 
** Core 1/2/3 now panic if cpuactlr/cpuectlr hold a value different than the one in init argument. Previously, they they did if (real value != expected value) { real value = expected value }.
 
** Core 1/2/3 now panic if cpuactlr/cpuectlr hold a value different than the one in init argument. Previously, they they did if (real value != expected value) { real value = expected value }.
 +
* The reserved memory size for slab heap aslr gaps was reduced by 64 KB from 2 MB to 0x1F0000.
 
* Physical ASLR for certain backing regions (Kernel .text/.rodata/.rwdata/.bss + the Slab Heap region) was implemented.
 
* Physical ASLR for certain backing regions (Kernel .text/.rodata/.rwdata/.bss + the Slab Heap region) was implemented.
 
** Physical randomization of the kernel image is done by KernelLdr.
 
** Physical randomization of the kernel image is done by KernelLdr.
Line 96: Line 97:  
** When this argument is not null, the message buffer is accessed by doing linear phys-to-virt translation on this physaddress, otherwise the message buffer is accessed by doing linear phys-to-virt translation on the TLS physical address.
 
** When this argument is not null, the message buffer is accessed by doing linear phys-to-virt translation on this physaddress, otherwise the message buffer is accessed by doing linear phys-to-virt translation on the TLS physical address.
 
** Previously, the process virtual address for the user buffer was accessed directly.
 
** Previously, the process virtual address for the user buffer was accessed directly.
<check back for more diffs later>
+
* Pages allocated from the dynamic page slab heap are no longer memset to zero after being allocated.
 +
** Instead, they are memset to zero when the heap is first initialized, and when being freed.
 +
** This fixes the issue that pages were sometimes memset to zero unnecessarily, because they were already zero'd by some previous operation.
 +
** Newly allocated pages being all-zero is now a kernel invariant.
 +
* A new KMemoryPermission bit (0x40) was added. When this bit is set, the page is completely unmapped (for both user and kernel). This is done when e.g. memory is mirrored via MapMemory, when memory is locked for IPC usage, etc.
 +
* KPageTable::ChangePermissions was changed substantially to accommodate this.
 +
** Previously, it separated pages, iterated over mappings changing permissions as required (and invalidating + flushing cache if bool arg is true), then merged pages.
 +
** Now, the function has a lambda which iterates over all mappings, changing permissions as required and performing additional operations depending on a bitflag parameter.
 +
** First, the function separates pages.
 +
** Then if the input bool is false, this lambda is called with entry template = input entry template, bitflag parameter = 0. This changes all mappings to the new permissions. Pages are then merged, and the function returns.
 +
** Otherwise if the input bool is true, the lambda is called with entry template = input entry template & ~1 and bitflag parameter = 2. This changes all mappings to be invalid (as low bit of pte is zero). Bitflag & 2 causes entries to be merged during traversal.
 +
** Next, the scheduling lock is locked and immediately unlocked. This forces a reschedule.
 +
** Next, the lambda is called with entry template = input entry template, bitflag parameter = 1. This changes all mappings to new permissions, and flushes data cache on all new mappings.
 +
** Finally, mappings are merged, and the function returns.
 +
* SvcQueryIoMapping's ABI was changed.
 +
** Previously signature was Result QueryIoMapping(uintptr_t *out_address, PhysicalAddress physical_address, size_t size).
 +
** New signature is Result QueryIoMapping(uintptr_t *out_address, size_t *out_size, PhysicalAddress physical_address, size_t size);
 +
** For normal IO, out_size is just written with the input size parameter.
 +
** For special debug regions (mapped using 8.0.0+ memory region descriptor, queried by passing 1/2/3 as phys_addr parameter), out_size is written with the real size of the queried region.
 +
* SvcQueryPhysicalAddress was stubbed, and now always returns ResultInvalidCurrentMemoryState.
 +
* KCurrentContext now stores a dereferencable pointer to the current thread's TLS.
 +
** This is used to check the user disable count (for thread pinning) in the SvcHandler instead of loading tls from tpidrro_el0.
    
====FIRM Sysmodules====
 
====FIRM Sysmodules====
Line 118: Line 140:  
* [[Error_Upload_services|eupld]] now has access to srepo:u.
 
* [[Error_Upload_services|eupld]] now has access to srepo:u.
 
* [[Glue_services|glue]] no longer has access to bpc, and access to time:al was added.
 
* [[Glue_services|glue]] no longer has access to bpc, and access to time:al was added.
 +
** Prior to this sysupdate, no retail system-titles used time:al.
 
* [[GRC_services|grc]] now has access to time:su.
 
* [[GRC_services|grc]] now has access to time:su.
 
* [[creport]] no longer has access to ns:dev, and access to pgl was added.
 
* [[creport]] no longer has access to ns:dev, and access to pgl was added.
 
* [[Shared_Database_services|sdb]] no longer has access to prepo:s, and access to srepo:u was added.
 
* [[Shared_Database_services|sdb]] no longer has access to prepo:s, and access to srepo:u was added.
 
* [[OLSC_services|olsc]] now hosts a new [[Services_API|service]], and access to arp:r was added. [[SVC]]s svcMapTransferMemory and svcUnmapTransferMemory are now accessible.
 
* [[OLSC_services|olsc]] now hosts a new [[Services_API|service]], and access to arp:r was added. [[SVC]]s svcMapTransferMemory and svcUnmapTransferMemory are now accessible.
* All web-applets now have access to [[SVC]]s svcMapPhysicalMemoryUnsafe/svcUnmapPhysicalMemoryUnsafe.
+
* All web-applets now have access to [[SVC]]s svcMapPhysicalMemoryUnsafe/svcUnmapPhysicalMemoryUnsafe, but these aren't used in the main-codebin for any of these applets.
 
* [[MyPage_Applet|LibraryAppletMyPage]] now has access to npns:s.
 
* [[MyPage_Applet|LibraryAppletMyPage]] now has access to npns:s.
  

Navigation menu