Commit graph

2351 commits

Author SHA1 Message Date
Liam
82c5e2472e general: fix mac compile 2023-11-26 19:50:10 -05:00
GPUCode
1e5a1d1702 Address more review comments 2023-11-25 00:47:43 -05:00
GPUCode
3930e3d7fd core: Define HAS_NCE macro 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
3a5992f2ef kernel: Manually specify aslr region start 2023-11-25 00:46:15 -05:00
GPUCode
2590906d14 core: Respect memory permissions in Map 2023-11-25 00:46:15 -05:00
Liam
b8b198ec48 fix apple clang build again 2023-11-14 11:53:02 -05:00
Liam
53bf815d4b k_capabilities: ignore map region when KTrace is disabled 2023-11-11 10:45:43 -05:00
Liam
f43c66f811 k_page_table: fix shutdown 2023-11-10 12:01:35 -05:00
Liam
dcb79112e0 k_page_table: use more precise icache invalidates 2023-11-10 12:01:35 -05:00
Liam
713f292a25 kernel: add KPageTableBase
Co-authored-by: Kelebek1 <eeeedddccc@hotmail.co.uk>
2023-11-10 12:01:35 -05:00
Liam
ae885084e2 kernel: fix extraneous ref 2023-10-21 22:16:41 -04:00
Liam
f0c6de7dd2 kernel: signal thread on termination completed 2023-10-21 20:03:41 -04:00
Liam
c00faac482 kernel: add missing TLR clear 2023-10-21 20:03:41 -04:00
Liam
62e106dbe8 kernel: update KProcess 2023-10-21 20:03:41 -04:00
Fernando S
979b5b7b5b Merge pull request #11748 from liamwhite/kern_1700
kernel: update for 17.0.0
2023-10-20 17:08:00 +02:00
Liam
d96b03a1c0 kernel: fix incorrect calculation of used non system memory value 2023-10-20 09:12:10 -04:00
Liam
92a65b4947 kernel: fix format string error 2023-10-20 02:41:32 -04:00
Liam
5be32a6147 kernel: make check fully constexpr for broken msvc constant folding 2023-10-20 02:34:15 -04:00
Liam
84ce50cc1b k_page_table: add MapFirstGroup 2023-10-20 02:34:15 -04:00
Liam
010fc2f562 kernel: update KMemoryRegionType values 2023-10-20 02:34:15 -04:00
Liam
d73dbceba6 k_page_table: implement PermissionLocked 2023-10-20 02:34:15 -04:00
Liam
3e0887f205 k_page_table: add new CheckMemoryState helper 2023-10-20 02:34:15 -04:00
Liam
144ae38fb3 kernel: split Io memory state, add PermissionLocked attribute 2023-10-20 02:34:15 -04:00
Liam
c9dab6d0c1 kernel: reshuffle ini1 size, add slab clear note 2023-10-20 02:34:15 -04:00
liamwhite
ee42690234 Merge pull request #11766 from liamwhite/open-sesame
k_page_table: add missing page group open when locking memory
2023-10-13 09:29:05 -04:00
Liam
060b9482da k_page_table: add missing page group open when locking memory 2023-10-12 15:00:26 -04:00
Liam
66472af2d0 kernel: mark TLS accessors as noinline for non-MSVC LTO 2023-10-12 09:16:22 -04:00
Liam
97d79bf8a6 kernel: implement transfer memory 2023-10-04 22:32:27 -04:00
Liam
445d504f94 ci: fix new codespell errors 2023-10-02 18:03:05 -04:00
Liam
b938c81e08 k_page_table: skip page table clearing on finalization 2023-10-01 23:38:56 -04:00
Kelebek1
f9f340064f Reduce core timing mutex contention 2023-09-19 23:10:03 +01:00
Liam
efef3d8487 core: improve debug workflow 2023-09-14 16:44:15 -04:00
Danila Malyutin
7f0de0f204 msvc: set warning level to /W4 globally
And fix a bunch of warnings
2023-09-03 18:42:10 +04:00
liamwhite
aa16fd2422 kernel: offset code entry point for 39-bit address space type (#11326) 2023-08-25 23:59:32 +02:00
Liam
50ce2f0b7b kernel: remove relative task registration 2023-08-14 18:12:06 -04:00
Liam
5f2c56cd15 core: remove ResultVal type 2023-08-08 11:09:37 -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
46234254b1 core: reduce TOCTTOU memory access 2023-07-22 11:19:29 -04:00
liamwhite
de2fb523e3 Merge pull request #11094 from liamwhite/get
kernel: misc cleanup of page table accessors
2023-07-22 11:17:36 -04:00
Liam
545880f71b core: remove remaining uses of dynamic_cast 2023-07-21 19:37:29 -04:00
lat9nq
c1fa82a168 k_system_control: Always return some memory size 2023-07-21 10:56:55 -04:00
lat9nq
e952af53be core,common: Give memory layout setting an enum
Allows for 6GB and 8GB layouts to be selected.
2023-07-21 10:56:55 -04:00
lat9nq
bd8630531e settings,core,config_sys: Remove optional type from custom_rtc, rng_seed
core: Fix MSVC errors
2023-07-21 10:56:07 -04:00
lat9nq
30e4e8c2f4 general: Silence -Wshadow{,-uncaptured-local} warnings
These occur in the latest commits in LLVM Clang.
2023-07-18 19:31:35 -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
b47ce23b31 kernel: reduce page table region checking 2023-07-14 22:33:10 -04:00
Liam
6b6f0b21b9 k_process: PageTable -> GetPageTable 2023-07-14 21:43:15 -04:00