Commit Graph

874 Commits

Author SHA1 Message Date
MrPurple666 739e5c47ea WIP: DO-NOT-MERGE: NCE experiments: Better LRU cache implementation
It uses a better lru implementation, since initial as basic functions to LRU, use a modern system to it to make performance better
2025-04-12 22:54:32 -03:00
MrPurple666 3d43fecece WIP: DO-NOT-MERGE: NCE experiments: Initial LRU 2025-04-11 17:05:06 -03:00
MrPurple666 27ceda2c6c WIP: DO-NOT-MERGE: NCE experiments: Fix build errors 2025-04-11 17:04:55 -03:00
MrPurple666 777b674edf WIP: DO-NOT-MERGE: NCE experiments: Some optimizations on pre-fetch and cache 2025-04-11 17:04:45 -03:00
MrPurple666 d36031849e WIP: DO-NOT-MERGE: NCE experiments: Ensure guest context reflects thread state during unlock 2025-04-11 17:04:34 -03:00
MrPurple666 d621707001 WIP: DO-NOT-MERGE: NCE experiments
botw boots but with poor performance
2025-04-11 17:04:24 -03:00
crueter 9cef9f5dce Update fmt to allow for v11
Signed-off-by: swurl <swurl@swurl.xyz>
2025-04-10 01:11:22 +02:00
Briar c98be3d793 Update fastmem pointer handling to use std::optional 2025-04-04 03:23:32 +02:00
GPUCode 26a25d2280 core: Support multiple modules per patcher 2024-01-15 00:46:05 +02:00
Liam c366d8e8d9 core: track separate heap allocation for linux 2023-12-25 23:30:56 -05:00
Liam e2b5f2392e kernel: instantiate memory separately for each guest process 2023-12-22 21:52:49 -05:00
Fernando S 11fb4a3a11 Merge pull request #12417 from liamwhite/arm64-gcc-fix
nce: hide shadowing warnings from dynarmic headers
2023-12-20 18:46:08 +01:00
Liam cdf5beae3d nce: hide shadowing warnings from dynarmic headers 2023-12-20 11:07:50 -05:00
Liam 236173f804 nce: increase handler stack size 2023-12-19 15:24:13 -05:00
Liam f5846edffa nce: fix read size in simd immediate emulation 2023-12-19 12:51:19 -05:00
Liam 91aefd5d35 nce: adjust initialization for repeated calls 2023-12-11 23:02:01 -05:00
Liam ecb3d74dcd nce: implement instruction emulation for misaligned memory accesses 2023-12-10 18:23:42 -05:00
Liam e1b32b6c35 debug: fix reading of module names 2023-12-09 11:18:10 -05:00
Fernando S 9046851d9f Merge pull request #12236 from liamwhite/cpu-refactor
core: refactor emulated cpu core activation
2023-12-06 14:19:17 +01:00
Liam 33b7353d73 arm: fix context save of vector regs 2023-12-04 22:19:11 -05:00
Liam 3d5c6a73cb core: refactor emulated cpu core activation 2023-12-04 10:37:16 -05:00
Liam 79d497c022 nce: fix pre-text patch for single modules 2023-12-02 16:14:52 -05:00
GPUCode e6e15d2d10 core: Rename patcher file 2023-11-29 23:49:16 +02:00
GPUCode 181a7a027f oaknut: Address warnings 2023-11-25 00:47:43 -05:00
GPUCode 1e5a1d1702 Address more review comments 2023-11-25 00:47:43 -05:00
Liam 2e2b3de592 arm_nce: skip data aborts for crash handling parity 2023-11-25 00:47:36 -05:00
GPUCode a1818cddf6 arm: Print backtrace on data abort 2023-11-25 00:47:36 -05:00
Liam a3e2b0bd91 patch: check offsets from first code word 2023-11-25 00:47:36 -05:00
Liam 683b58b075 arm_nce: skip dc cvac on possibly write-protected areas 2023-11-25 00:47:36 -05:00
GPUCode 3814ca9d84 Address some review comments 2023-11-25 00:47:35 -05:00
Liam 19619b1b14 arm: Implement native code execution backend 2023-11-25 00:46:47 -05:00
Liam 317741356f core: check for thread dpc before eret 2023-11-13 11:28:23 -05:00
Liam 62e106dbe8 kernel: update KProcess 2023-10-21 20:03:41 -04:00
liamwhite 28b236b988 Merge pull request #10839 from lat9nq/pgc-plus
general: Reimplement per-game configurations
2023-08-02 14:25:52 -04:00
liamwhite a28a0c47f8 Merge pull request #10990 from comex/ubsan
Fixes and workarounds to make UBSan happier on macOS
2023-07-26 10:33:28 -04:00
Liam 545880f71b core: remove remaining uses of dynamic_cast 2023-07-21 19:37:29 -04:00
lat9nq 78f92086ca settings,general: Rename non-confirming enums 2023-07-21 10:56:54 -04:00
comex 85d77f636c Fixes and workarounds to make UBSan happier on macOS
There are still some other issues not addressed here, but it's a start.

Workarounds for false-positive reports:

- `RasterizerAccelerated`: Put a gigantic array behind a `unique_ptr`,
  because UBSan has a [hardcoded limit](https://stackoverflow.com/questions/64531383/c-runtime-error-using-fsanitize-undefined-object-has-a-possibly-invalid-vp)
  of how big it thinks objects can be, specifically when dealing with
  offset-to-top values used with multiple inheritance.  Hopefully this
  doesn't have a performance impact.

- `QueryCacheBase::QueryCacheBase`: Avoid an operation that UBSan thinks
  is UB even though it at least arguably isn't.  See the link in the
  comment for more information.

Fixes for correct reports:

- `PageTable`, `Memory`: Use `uintptr_t` values instead of pointers to
  avoid UB from pointer overflow (when pointer arithmetic wraps around
  the address space).

- `KScheduler::Reload`: `thread->GetOwnerProcess()` can be `nullptr`;
  avoid calling methods on it in this case.  (The existing code returns
  a garbage reference to a field, which is then passed into
  `LoadWatchpointArray`, and apparently it's never used, so it's
  harmless in practice but still triggers UBSan.)

- `KAutoObject::Close`: This function calls `this->Destroy()`, which
  overwrites the beginning of the object with junk (specifically a free
  list pointer).  Then it calls `this->UnregisterWithKernel()`.  UBSan
  complains about a type mismatch because the vtable has been
  overwritten, and I believe this is indeed UB.  `UnregisterWithKernel`
  also loads `m_kernel` from the 'freed' object, which seems to be
  technically safe (the overwriting doesn't extend as far as that
  field), but seems dubious.  Switch to a `static` method and load
  `m_kernel` in advance.
2023-07-15 12:00:28 -07:00
Liam 1f791daa01 arm_interface: correct breakpoint rewind condition 2023-07-09 12:03:25 -04:00
Merry 09012476db arm_dynarmic_32: Remove disabling of block linking on arm64 2023-06-27 23:51:49 +01:00
Liam 5b858c8306 core: decouple ARM interface from Dynarmic 2023-06-12 22:11:51 -04:00
bunnei a09fcccb72 core: arm_dynarmic_32: Update SaveContext/LoadContext. 2023-04-01 17:03:08 -07:00
Liam 6eaef51cf2 memory: rename global memory references to application memory 2023-03-23 20:28:47 -04:00
Liam 156516e399 kernel: use KTypedAddress for addresses 2023-03-22 09:35:16 -04:00
Liam c68577384a general: rename CurrentProcess to ApplicationProcess 2023-02-13 19:03:12 -05:00
Liam b91913334e kernel/svc: switch to generated wrappers 2023-02-06 23:57:44 -05:00
Kelebek1 8fea4c21b2 Be careful of mangled out of bounds read 2023-01-14 19:53:55 +00:00
Kelebek1 90f546cba4 Add stacktrace symbol demangling 2023-01-14 04:43:21 +00:00
Liam 7429e31f30 externals: update dynarmic, xbyak 2023-01-05 18:06:06 -05:00
Liam dfc09df118 core: add option to break on unmapped access 2022-12-02 08:25:45 -05:00
Fernando Sahmkow ee4b6380b9 Dynarmic: Remove inaccurate NaN from Auto CPU settings. 2022-11-17 16:59:41 +01:00
Liam 9509fb30a4 Initial ARM64 support 2022-11-09 16:58:49 -05:00
Liam 8544af06f5 arm_interface: curb infinite recursion in stacktrace generation 2022-10-27 16:01:05 -04:00
bunnei 97e4cd1c8f core: hle: kernel: k_thread: Implement thread termination DPC. 2022-10-18 19:13:34 -07:00
Liam 545875eaa1 k_server_session: preliminary support for userspace server sessions 2022-10-11 18:40:40 -04:00
Kyle Kienapfel ea00332a67 code: dodge PAGE_SIZE #define
Some header files, specifically for OSX and Musl libc define PAGE_SIZE to be a number
This is great except in yuzu we're using PAGE_SIZE as a variable

Specific example
`static constexpr u64 PAGE_SIZE = u64(1) << PAGE_BITS;`

PAGE_SIZE PAGE_BITS PAGE_MASK are all similar variables.
Simply deleted the underscores, and then added YUZU_ prefix

Might be worth noting that there are multiple uses in different classes/namespaces
This list may not be exhaustive

Core::Memory   12 bits (4096)
QueryCacheBase 12 bits
ShaderCache    14 bits (16384)
TextureCache   20 bits (1048576, or 1MB)

Fixes #8779
2022-08-19 16:08:40 -07:00
liamwhite 530b5032dd Merge pull request #8745 from merryhime/null-fastmem-arena
arm_dynarmic: Fix nullptr fastmem arenas
2022-08-12 14:57:32 -04:00
bunnei 448ed1ed01 Merge pull request #8729 from merryhime/cp15-barriers
arm_dynarmic_cp15: Implement CP15DMB/CP15DSB/CP15ISB
2022-08-09 16:12:53 -07:00
Merry c5b77f78f8 arm_dynarmic: Fix nullptr fastmem arenas
Unable to enable fastmem of exclusive access without a valid fastmem arena.
2022-08-09 20:48:19 +01:00
Liam a7027fa7c9 core/arm: fix build error 2022-08-07 21:39:54 -04:00
bunnei f5e9f8c9fe Merge pull request #8637 from liamwhite/bad-interrupts
kernel: unlayer CPU interrupt handling
2022-08-07 17:48:55 -07:00
Morph d97c307f4d Merge pull request #8240 from liamwhite/count-cycles
core/arm: re-enable cycle counting
2022-08-07 20:30:57 -04:00
Merry abf143229a arm_dynarmic_cp15: Implement CP15DMB/CP15DSB/CP15ISB 2022-08-07 22:16:49 +01:00
Andrea Pappacoda 6a2efdda2f chore: make yuzu REUSE compliant
[REUSE] is a specification that aims at making file copyright
information consistent, so that it can be both human and machine
readable. It basically requires that all files have a header containing
copyright and licensing information. When this isn't possible, like
when dealing with binary assets, generated files or embedded third-party
dependencies, it is permitted to insert copyright information in the
`.reuse/dep5` file.

Oh, and it also requires that all the licenses used in the project are
present in the `LICENSES` folder, that's why the diff is so huge.
This can be done automatically with `reuse download --all`.

The `reuse` tool also contains a handy subcommand that analyzes the
project and tells whether or not the project is (still) compliant,
`reuse lint`.

Following REUSE has a few advantages over the current approach:

- Copyright information is easy to access for users / downstream
- Files like `dist/license.md` do not need to exist anymore, as
  `.reuse/dep5` is used instead
- `reuse lint` makes it easy to ensure that copyright information of
  files like binary assets / images is always accurate and up to date

To add copyright information of files that didn't have it I looked up
who committed what and when, for each file. As yuzu contributors do not
have to sign a CLA or similar I couldn't assume that copyright ownership
was of the "yuzu Emulator Project", so I used the name and/or email of
the commit author instead.

[REUSE]: https://reuse.software

Follow-up to b2eb103829
2022-07-27 12:53:49 +02:00
Liam 3edb108f4b kernel: unlayer CPU interrupt handling 2022-07-25 12:14:15 -04:00
Morph b8cff68056 Merge pull request #8549 from liamwhite/kscheduler-sc
kernel: use KScheduler from Mesosphere
2022-07-25 12:00:31 -04:00
merry bdf6e32aed Merge pull request #8569 from merryhime/watchpoints
dynarmic: Abort watchpoints ASAP
2022-07-17 22:41:28 +01:00
Liam 9858c3ce34 core/arm: skip watchpoint checks when reading instructions 2022-07-15 19:47:28 -04:00
Merry f719a0a078 dynarmic: Abort watchpoints ASAP 2022-07-15 10:03:30 +01:00
Liam e47bced65d kernel: use KScheduler from mesosphere 2022-07-14 22:47:18 -04:00
Mai 485473f118 Merge pull request #8501 from liamwhite/backtrace-again
core/arm: better support for backtrace generation
2022-07-07 23:49:54 -04:00
Morph f64cc85d4b Merge pull request #8490 from liamwhite/read-code-stop
dynarmic: Stop ReadCode callbacks to unmapped addresses
2022-06-30 20:57:39 -07:00
Liam 416a71804b core/arm: better support for backtrace generation 2022-06-25 12:54:24 -04:00
Liam 83f1ecb73b kernel: make current thread pointer thread local 2022-06-23 00:28:00 -04:00
Liam 97edc7c0df core/arm: increase minimum_run_cycles 2022-06-21 20:37:16 -04:00
merry 8151f68522 core/arm: re-enable cycle counting 2022-06-21 20:36:24 -04:00
Liam 0d04631c1f dynarmic: Stop ReadCode callbacks to unmapped addresses 2022-06-21 20:01:43 -04:00
Liam 8d2abc710c core/debugger: memory breakpoint support 2022-06-16 13:18:07 -04:00
Liam a6c1036ddc core: centralize profile scope for Dynarmic 2022-06-14 18:19:04 -04:00
Liam 8f979d453d common: consolidate ELF structure definitions 2022-06-05 09:42:05 -04:00
Liam da50e98e3a core/debugger: Improved stepping mechanism and misc fixes 2022-06-01 02:15:15 -04:00
Liam 2ee161a0bf core/debugger: Implement new GDB stub debugger 2022-06-01 00:01:25 -04:00
Lioncash 9272114d86 general: Avoid ambiguous format_to compilation errors
Ensures that we're using the fmt version of format_to.

These are also the only three outliers. All of the other formatters we
have are properly qualified.
2022-05-14 16:48:34 -04:00
Merry 71b0b6274e Remove unused PrepareReschedule function 2022-04-24 12:10:16 +01:00
Morph 2b87305d31 general: Convert source file copyright comments over to SPDX
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-23 05:55:32 -04:00
Liam 80afee83ba core/arm: separate backtrace collection 2022-04-20 21:39:42 -04:00
bunnei cc53f4b48d Merge pull request #8188 from merryhime/jit-race-page-table-changed
dynarmic: Fix race when switching page tables
2022-04-16 00:24:53 -07:00
merry 0b947e0341 dynarmic: Fix single core mode
Regression introduced in ac87509300. Closes #8201.
2022-04-13 20:40:12 +01:00
merry 396a1dc9b0 dynarmic: Fix race when switching page tables 2022-04-10 15:46:29 +01:00
Liam 28fb3e8240 core: extract symbol reading 2022-04-09 02:16:34 -04:00
Fernando S 0bb26a7794 Merge pull request #8148 from merryhime/interrupts
dynarmic: Better interrupts
2022-04-07 16:21:41 +02:00
merry 8bcfa4046f dynarmic: Print stack trace on unrecognised instruction or other exception 2022-04-05 20:40:20 +01:00
bunnei 18017f7adf Merge pull request #8089 from merryhime/paranoia
configuration: Add Paranoid CPU accuracy level
2022-04-04 11:07:38 -07:00
merry ac87509300 arm_dynarmic: Use HaltReason for svc calls and reschedules 2022-04-03 18:20:11 +01:00
merry f54345590b dynarmic: Better interrupts 2022-04-03 16:39:48 +01:00
merry 5a37246da6 arm_dynarmic_64: Invalidate on all cores 2022-03-27 15:37:19 +01:00
merry e752529c4c configuration: Add Paranoid CPU accuracy level
Disables most optimizations for the paranoid.
2022-03-26 08:46:25 +00:00
bunnei 89a97915a8 Revert "dynarmic: Reduce size of code caches" 2022-03-22 18:32:54 -07:00
ameerj 22e01068e1 core: Reduce unused includes 2022-03-19 02:23:32 -04:00
Merry eb30b2382a dynarmic: Reduce size of code caches 2022-03-13 22:17:14 +00:00