Commit graph

792 commits

Author SHA1 Message Date
Liam
8c59543ee3 kernel: update KProcess 2023-10-21 20:03:41 -04:00
liamwhite
fca7d975fd
Merge pull request #10839 from lat9nq/pgc-plus
general: Reimplement per-game configurations
2023-08-02 14:25:52 -04:00
liamwhite
d3da1e6517
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
05bc024260 core: remove remaining uses of dynamic_cast 2023-07-21 19:37:29 -04:00
lat9nq
d146dd9d12 settings,general: Rename non-confirming enums 2023-07-21 10:56:54 -04:00
comex
d7c532d889 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
82568412f6 arm_interface: correct breakpoint rewind condition 2023-07-09 12:03:25 -04:00
Merry
e3c548d081 arm_dynarmic_32: Remove disabling of block linking on arm64 2023-06-27 23:51:49 +01:00
Liam
8506915208 core: decouple ARM interface from Dynarmic 2023-06-12 22:11:51 -04:00
bunnei
9c94faaa2b core: arm_dynarmic_32: Update SaveContext/LoadContext. 2023-04-01 17:03:08 -07:00
Liam
41d99aa89d memory: rename global memory references to application memory 2023-03-23 20:28:47 -04:00
Liam
fb49ec19c1 kernel: use KTypedAddress for addresses 2023-03-22 09:35:16 -04:00
Liam
ceda2d280e general: rename CurrentProcess to ApplicationProcess 2023-02-13 19:03:12 -05:00
Liam
2415d37ea2 kernel/svc: switch to generated wrappers 2023-02-06 23:57:44 -05:00
Kelebek1
42b16bb33a Be careful of mangled out of bounds read 2023-01-14 19:53:55 +00:00
Kelebek1
80a55c1663 Add stacktrace symbol demangling 2023-01-14 04:43:21 +00:00
Liam
1ee0540f82 externals: update dynarmic, xbyak 2023-01-05 18:06:06 -05:00
Liam
6072b22a0b core: add option to break on unmapped access 2022-12-02 08:25:45 -05:00
Fernando Sahmkow
bc95753107 Dynarmic: Remove inaccurate NaN from Auto CPU settings. 2022-11-17 16:59:41 +01:00
Liam
cbaf642ffe Initial ARM64 support 2022-11-09 16:58:49 -05:00
Liam
3e6840a74c arm_interface: curb infinite recursion in stacktrace generation 2022-10-27 16:01:05 -04:00
bunnei
57a77e9ff4 core: hle: kernel: k_thread: Implement thread termination DPC. 2022-10-18 19:13:34 -07:00
Liam
61a8696510 k_server_session: preliminary support for userspace server sessions 2022-10-11 18:40:40 -04:00
Kyle Kienapfel
14e9de6678 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
5a6a26449c
Merge pull request #8745 from merryhime/null-fastmem-arena
arm_dynarmic: Fix nullptr fastmem arenas
2022-08-12 14:57:32 -04:00
bunnei
4bd8adfe42
Merge pull request #8729 from merryhime/cp15-barriers
arm_dynarmic_cp15: Implement CP15DMB/CP15DSB/CP15ISB
2022-08-09 16:12:53 -07:00
Merry
9bdef7428a 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
aae208d07f core/arm: fix build error 2022-08-07 21:39:54 -04:00
bunnei
01bb5d5c4d
Merge pull request #8637 from liamwhite/bad-interrupts
kernel: unlayer CPU interrupt handling
2022-08-07 17:48:55 -07:00
Morph
30515b3b27
Merge pull request #8240 from liamwhite/count-cycles
core/arm: re-enable cycle counting
2022-08-07 20:30:57 -04:00
Merry
50cda3bd7b arm_dynarmic_cp15: Implement CP15DMB/CP15DSB/CP15ISB 2022-08-07 22:16:49 +01:00
Andrea Pappacoda
cdb240f3d4
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 01cf05bc75
2022-07-27 12:53:49 +02:00
Liam
6523854dd6 kernel: unlayer CPU interrupt handling 2022-07-25 12:14:15 -04:00
Morph
591d1f1b09
Merge pull request #8549 from liamwhite/kscheduler-sc
kernel: use KScheduler from Mesosphere
2022-07-25 12:00:31 -04:00
merry
09300abe92
Merge pull request #8569 from merryhime/watchpoints
dynarmic: Abort watchpoints ASAP
2022-07-17 22:41:28 +01:00
Liam
a9a9999efd core/arm: skip watchpoint checks when reading instructions 2022-07-15 19:47:28 -04:00
Merry
40e39ddd46 dynarmic: Abort watchpoints ASAP 2022-07-15 10:03:30 +01:00
Liam
0624c880bd kernel: use KScheduler from mesosphere 2022-07-14 22:47:18 -04:00
Mai
313f047f97
Merge pull request #8501 from liamwhite/backtrace-again
core/arm: better support for backtrace generation
2022-07-07 23:49:54 -04:00
Morph
78ce053b4d
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
8f8c0b69dc core/arm: better support for backtrace generation 2022-06-25 12:54:24 -04:00
Liam
2c56e94702 kernel: make current thread pointer thread local 2022-06-23 00:28:00 -04:00
Liam
d657ea69c9 core/arm: increase minimum_run_cycles 2022-06-21 20:37:16 -04:00
merry
30e8876ea4 core/arm: re-enable cycle counting 2022-06-21 20:36:24 -04:00
Liam
1fd194141a dynarmic: Stop ReadCode callbacks to unmapped addresses 2022-06-21 20:01:43 -04:00
Liam
208ed712f4 core/debugger: memory breakpoint support 2022-06-16 13:18:07 -04:00
Liam
20eab9fed9 core: centralize profile scope for Dynarmic 2022-06-14 18:19:04 -04:00
Liam
3c313a43fd common: consolidate ELF structure definitions 2022-06-05 09:42:05 -04:00
Liam
989d4a7a41 core/debugger: Improved stepping mechanism and misc fixes 2022-06-01 02:15:15 -04:00
Liam
fb4b3c127f core/debugger: Implement new GDB stub debugger 2022-06-01 00:01:25 -04:00