aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
AgeCommit message (Collapse)Author
2019-10-15Kernel: Corrections to Wait Objects clearing in which a thread could still ↵Fernando Sahmkow
be signalled after a timeout or a cancel.
2019-10-15Kernel: Correct redundant yields to only advance time forward.Fernando Sahmkow
2019-10-15Kernel: Corrections to ModifyByWaitingCountAndSignalToAddressIfEqualFernando Sahmkow
2019-10-15Kernel: Correct Results in Condition Variables and MutexesFernando Sahmkow
2019-10-15Kernel: Clang FormatFernando Sahmkow
2019-10-15Kernel: Remove global system accessor from WaitObjectFernando Sahmkow
2019-10-15Scheduler: Implement Yield Count and Core migration on Thread Preemption.Fernando Sahmkow
2019-10-15Scheduler: Corrections to YieldAndBalanceLoad and Yield bombing protection.Fernando Sahmkow
2019-10-15Kernel: Initial implementation of thread preemption.Fernando Sahmkow
2019-10-15Scheduler: Add protections for Yield bombingFernando Sahmkow
In case of redundant yields, the scheduler will now idle the core for it's timeslice, in order to avoid continuously yielding the same thing over and over.
2019-10-15Kernel: Style and CorrectionsFernando Sahmkow
2019-10-15Correct PrepareRescheduleFernando Sahmkow
2019-10-15Comment and reorganize the schedulerFernando Sahmkow
2019-10-15Add PrepareReschedule where required.Fernando Sahmkow
2019-10-15Correct compiling errors and addapt to the new interface.Fernando Sahmkow
2019-10-15Correct Supervisor Calls to work with the new scheduler,Fernando Sahmkow
2019-10-15Add interfacing to the Global SchedulerFernando Sahmkow
2019-10-15Addapt thread class to the new SchedulerFernando Sahmkow
2019-10-15Implement a new Core SchedulerFernando Sahmkow
2019-10-06core: Remove Core::CurrentProcess()Lioncash
This only encourages the use of the global system instance (which will be phased out long-term). Instead, we use the direct system function call directly to remove the appealing but discouraged short-hand.
2019-09-04kernel/vm_manager: Correct doxygen comment parameter tags for ↵Lioncash
MapPhysicalMemory/UnmapPhysicalMemory Corrects the parameter names within the doxygen comments so that they resolve properly.
2019-09-04kernel/vm_manager: Move variables closer to usage spots in ↵Lioncash
MapPhysicalMemory/UnmapPhysicalMemory Narrows the scope of variables down to where they're only necessary.
2019-08-29kernel/vm_manager: Correct behavior in failure case of UnmapPhysicalMemory()Lioncash
If an unmapping operation fails, we shouldn't be decrementing the amount of memory mapped and returning that the operation was successful. We should actually be returning the error code in this case.
2019-08-29kernel/vm_manager: Reserve memory ahead of time for slow path in ↵Lioncash
MergeAdjacentVMA Avoids potentially expensive (depending on the size of the memory block) allocations by reserving the necessary memory before performing both insertions. This avoids scenarios where the second insert may cause a reallocation to occur.
2019-08-29kernel/vm_manager: std::move shared_ptr instance in MergeAdjacentVMALioncash
Avoids an unnecessary atomic reference count increment and decrement.
2019-08-29kernel/vm_manager: Deduplicate iterator creation in MergeAdjacentVMALioncash
Avoids needing to read the same long sequence of code in both code paths. Also makes it slightly nicer to read and debug, as the locals will be able to be shown in the debugger.
2019-08-29kernel/vm_manager: Simplify some std::vector constructor callsLioncash
Same behavior, one less magic constant to read.
2019-08-29kernel/vm_manager: Simplify some assertion messagesLioncash
Assertions already log out the function name, so there's no need to manually include the function name in the assertion strings.
2019-07-19Kernel: Address FeedbackFernando Sahmkow
2019-07-19VM_Manager: Align allocated memory to 256bytesFernando Sahmkow
This commit ensures that all backing memory allocated for the Guest CPU is aligned to 256 bytes. This due to how gpu memory works and the heavy constraints it has in the alignment of physical memory.
2019-07-18Merge pull request #2687 from lioncash/tls-processbunnei
kernel/process: Allocate the process' TLS region during initialization
2019-07-17Kernel: Downgrade WaitForAddress and SignalToAddress messages to Trace.Fernando Sahmkow
This messages were originally set as warnning since few games used these svcs and it was needed for debugging. This is no longer the case.
2019-07-14Merge pull request #2690 from SciresM/physmem_fixesFernando Sahmkow
Implement MapPhysicalMemory/UnmapPhysicalMemory
2019-07-11Remove unicorn mappings/unmappingsMichael Scire
2019-07-11Merge pull request #2717 from SciresM/unmirror_memorybunnei
Restore memory perms on svcUnmapMemory/UnloadNro
2019-07-11core/arm: Remove obsolete Unicorn memory mappingLioncash
This was initially necessary when AArch64 JIT emulation was in its infancy and all memory-related instructions weren't implemented. Given the JIT now has all of these facilities implemented, we can remove these functions from the CPU interface.
2019-07-11Restore memory perms on svcUnmapMemory/UnloadNroMichael Scire
Prior to PR, Yuzu did not restore memory to RW- on unmap of mirrored memory or unloading of NRO. (In fact, in the NRO case, the memory was unmapped instead of reprotected to --- on Load, so it was actually lost entirely...) This PR addresses that, and restores memory to RW- as it should. This fixes a crash in Super Smash Bros when creating a World of Light save for the first time, and possibly other games/circumstances.
2019-07-08Prevent merging of device mapped memory blocks.Michael Scire
This sets the DeviceMapped attribute for GPU-mapped memory blocks, and prevents merging device mapped blocks. This prevents memory mapped from the gpu from having its backing address changed by block coalesce.
2019-07-07Remove unused member function declarationMichael Scire
2019-07-07physmem: add helpers, cleanup logic.Michael Scire
2019-07-07clang-format fixesMichael Scire
2019-07-07address review commentaryMichael Scire
2019-07-07Implement MapPhysicalMemory/UnmapPhysicalMemoryMichael Scire
This implements svcMapPhysicalMemory/svcUnmapPhysicalMemory for Yuzu, which can be used to map memory at a desired address by games since 3.0.0. It also properly parses SystemResourceSize from NPDM, and makes information available via svcGetInfo. This is needed for games like Super Smash Bros. and Diablo 3 -- this PR's implementation does not run into the "ASCII reads" issue mentioned in the comments of #2626, which was caused by the following bugs in Yuzu's memory management that this PR also addresses: * Yuzu's memory coalescing does not properly merge blocks. This results in a polluted address space/svcQueryMemory results that would be impossible to replicate on hardware, which can lead to game code making the wrong assumptions about memory layout. * This implements better merging for AllocatedMemoryBlocks. * Yuzu's implementation of svcMirrorMemory unprotected the entire virtual memory range containing the range being mirrored. This could lead to games attempting to map data at that unprotected range/attempting to access that range after yuzu improperly unmapped it. * This PR fixes it by simply calling ReprotectRange instead of Reprotect.
2019-07-07kernel/process: Allocate the process' TLS region during initializationLioncash
Prior to execution within a process beginning, the process establishes its own TLS region for uses (as far as I can tell) related to exception handling. Now that TLS creation was decoupled from threads themselves, we can add this behavior to our Process class. This is also good, as it allows us to remove a stub within svcGetInfo, namely querying the address of that region.
2019-07-07kernel/process: Move main thread stack allocation to its own functionLioncash
Keeps this particular set of behavior isolated to its own function.
2019-07-06kernel/vm_manager: Rename 'new map' to 'stack'Lioncash
Provides a more accurate name for the memory region and also disambiguates between the map and new map regions of memory, making it easier to understand.
2019-07-05kernel/vm_manager: Handle stack/TLS IO region placement betterLioncash
Handles the placement of the stack a little nicer compared to the previous code, which was off in a few ways. e.g. The stack (new map) region, shouldn't be the width of the entire address space if the size of the region calculation ends up being zero. It should be placed at the same location as the TLS IO region and also have the same size. In the event the TLS IO region contains a size of zero, we should also be doing the same thing. This fixes our memory layout a little bit and also resolves some cases where assertions can trigger due to the memory layout being incorrect.
2019-07-03kernel/process: Default initialize all member variablesLioncash
Ensures a Process instance is always created with a deterministic initial state.
2019-07-03kernel/process: Decouple TLS handling from threadsLioncash
Extracts out all of the thread local storage management from thread instances themselves and makes the owning process handle the management of the memory. This brings the memory management slightly more in line with how the kernel handles these allocations. Furthermore, this also makes the TLS page management a little more readable compared to the lingering implementation that was carried over from Citra.
2019-07-03kernel/vm_manager: Add overload of FindFreeRegion() that operates on a boundaryLioncash
This will be necessary for making our TLS slot management slightly more straightforward. This can also be utilized for other purposes in the future. We can implement the existing simpler overload in terms of this one anyways, we just pass the beginning and end of the ASLR region as the boundaries.