Commit Graph
66572 Commits
Author SHA1 Message Date
Owen Anderson 0caf23319c arm64: Use DEVICE_GRE memory when mapping MTR_WC.
* This is the closest thing ARM has the semantics of write-combining
  MTR on x86.

Change-Id: I12a1582e0af871e2ab729262e90695ffe928c85b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8223
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-09-04 17:15:24 +00:00
Owen Anderson 4e4d316738 arm64: Reserve ASID 0 for the kernel.
Change-Id: I1b80d4d3d2e34e75bc4f521bb8e97b090ae40daa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8222
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-09-04 17:15:24 +00:00
Owen Anderson 32c542bdf3 arm64: Adding tracing points to VM subsystem
Change-Id: I7a777738ca2d152c3f07b9c3d498d536ccf7d4b6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8221
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-09-04 17:15:24 +00:00
Owen Anderson 088b72e77c arm64: Clear low bits in the VA when querying.
Change-Id: I4e948c0ecc15a6765a176e6ecc6858a61dc14468
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8192
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-09-04 17:15:24 +00:00
Owen Anderson 8cb8c3d756 acpi: Map memory with writeback caching enabled.
* This fixes arm64 where disabling caching also disables
  unaligned accesses.
* This matches how FreeBSD implements this callback.

Change-Id: Iee081d4ecff05b05c3758502d0cdacfbc56b11d8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8191
Reviewed-by: Jérôme Duval <[email protected]>
2024-09-04 10:24:00 +00:00
Owen Anderson 4b9a9eab69 arm64: Always disable interrupts while taking sAsidLock.
Change-Id: Ifce9acb8c29fbb7bce90ab1dbee901fbf47827a9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8190
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-09-03 21:37:22 +00:00
Owen Anderson 4805230235 arm64: Flush TLB by ASID when servicing page faults.
Change-Id: Ib68f3f300890c0bdf8a9d335e0c76a22d9fe14c3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8189
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-09-03 21:37:22 +00:00
Owen Anderson 9406d2a4f2 arm64: Flush the entire ASID from the TLB anytime we reuse one.
Change-Id: I939e0512ecce4041a5625eb1962545f5468719ee
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8174
Reviewed-by: waddlesplash <[email protected]>
2024-09-03 21:37:22 +00:00
Owen Anderson 40f58daab3 arm64: Fix for Map() where a PA base was missing.
Change-Id: I7a3536357fe1a783757cd600ef9f651b0d6bb7bd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8173
Reviewed-by: Fredrik Holmqvist <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-09-03 21:33:08 +00:00
Owen Anderson 26741b0f82 arm64: Defer allocating empty page table until later in vm init.
* Fixes double-locking panic.

Change-Id: I51f3b82e65ad3fad90fa777347f24ca0567f129d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8172
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2024-09-03 21:33:08 +00:00
Owen Anderson 50bb52021c arm64: Fixes to the page fault handler.
* Improve atomicity of PTE updates.
* Centralize a few constants.

Change-Id: Iaeeb82e9dc7f7ca97d13ba816fb72c6475754310
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8171
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-09-03 21:33:08 +00:00
Owen Anderson a64e78a34e arm64: Clean up dead MMU code.
Change-Id: I67acc10f63d63d22900b56a6981af1c0eb25af7a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8162
Reviewed-by: Fredrik Holmqvist <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-09-03 21:33:08 +00:00
Owen Anderson 73c517437d arm64: Implement VMSAv8TranslationMap::Query and UnmapPage in terms of ProcessRange
Change-Id: I183ef62ecacab0f14bf533a845aaa96920d0e764
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8161
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2024-09-03 21:33:08 +00:00
Augustin Cavalier 2301efc9d9 pthread: Make rwlocks keep waiting on EINTR.
As specified by POSIX.

Fixes #16708.
2024-09-03 16:17:06 -04:00
Augustin Cavalier 4812636028 pthread: Return EINVAL for pthread_detach() if the thread is already detached.
Fixes #16706.
2024-09-03 15:55:44 -04:00
Augustin Cavalier 797b4eef8b pthread: pthread_cancel() on non-existent thread should return ESRCH.
As per POSIX. Fixes #16705.
2024-09-03 15:51:10 -04:00
Augustin Cavalier 95a871b37d libroot: Handle invalid timeouts being passed to unnamed_sem_timedwait.
According to the POSIX specification:

> The sem_timedwait() function shall fail if:
> [EINVAL]
> 	The process or thread would have blocked, and the abstime
>	parameter specified a nanoseconds field value less than zero
>	or greater than or equal to 1000 million.

Fixes #16693, #16694.
2024-09-03 15:38:19 -04:00
Augustin Cavalier 74181c7e1f libroot: _SC_SEM_NSEMS_MAX is functionally unlimited.
Haiku's Be-style semaphores have a global limit, but the
POSIX-style semaphores do not. Functionally there will be a limit
as to how many can be waited on at a time, but one will probably
hit thread limits before that happens.

This matches what FreeBSD does: specifies 256 for _POSIX_SEM_NSEMS_MAX
but then returns -1 for the sysconf value.

Fixes #16692.
2024-09-03 14:57:54 -04:00
Augustin Cavalier 8260adb68d gnulib-test-mbrtowc: Add test for the change in previous commit. 2024-09-03 14:35:47 -04:00
Augustin Cavalier 0559911493 ICUCtypeData: Fix conversion of surrogate pairs.
If a multibyte Unicode character is specified to MultibyteToWchar
one byte at a time, then resetting the state will lose the data
for the second character. We thus shouldn't re-read but instead
keep the existing character and just read the second one.

Fixes #19035.
2024-09-03 14:34:30 -04:00
Augustin Cavalier c686c2216c ICUTimeConversion: Also override to "GMT" in Gmtime().
Otherwise, when the current locale timezone is one that has
an offset to GMT of 0, we would wind up with its name in tm_zone
and not "GMT".

Follows up to #19047.
2024-09-03 14:02:46 -04:00
Augustin Cavalier 5b4d5ef897 ICUTimeConversion: Handle GMT properly in _FillTmValues.
We can be called with a timezone that isn't the same as the one
set in the current locale, in particular from gmtime(). We thus need
to handle this case properly by checking that the gmtoff is really
the timezone in the locale, or if it's GMT, to just use a static
string for the tm_zone instead.

Fixes #19047.
2024-09-03 12:51:59 -04:00
Augustin Cavalier 6b468e5635 libroot: Replace fpurge implementation with upstream glibc's.
This doesn't seem to fix #19039 however.
2024-09-03 12:02:18 -04:00
Augustin Cavalier 0ab7cc6d60 BFile: Use AT_FDCWD instead of -1. 2024-09-03 12:01:21 -04:00
Augustin Cavalier a6de998330 runtime_loader: Use AT_FDCWD instead of -1. 2024-09-03 12:01:00 -04:00
Augustin Cavalier 136442cb5d kernel/fs: Accept only AT_FDCWD and -1 for negative FDs in path_to_vnode.
-1 was our previous value for AT_FDCWD, so we should retain support
for it here for the moment. All other negative values will now result
in an error.

Part of #19048.
2024-09-03 11:51:31 -04:00
Augustin Cavalier 9854d38a3f BEntry: Use AT_FDCWD instead of hardcoding -1. 2024-09-03 11:49:37 -04:00
Augustin Cavalier b93d9fcf70 libroot: Clean up and unify link/linkat.
* Move Haiku -> POSIX error mapping to linkat.

 * Implement link in terms of linkat.
2024-09-03 11:20:51 -04:00
Augustin Cavalier 004833215d libroot: Return EBADF if a negative FD is specified to fdopendir.
And do some minor code cleanups.

Fixes #19060.
2024-09-03 11:20:07 -04:00
Augustin Cavalier 55e8238c72 libroot: Use AT_FDCWD rather than hardcoding -1 in many places.
AT_FDCWD is now -100, not -1, though the kernel accepts any negative
value at the moment.
2024-09-03 11:19:02 -04:00
Augustin Cavalier 90ae97dbac libroot: Remove another obsolete comment. 2024-09-03 11:16:54 -04:00
Augustin Cavalier f27384b845 usb_audio: Reduce log spam.
Fixes #19037.

Change-Id: I1c0a0b39a5d725b95dff5f2d9dd7d61568030146
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8188
Reviewed-by: waddlesplash <[email protected]>
2024-09-02 22:33:40 +00:00
Augustin Cavalier a062b2146e IORequest: Fix computation of parent-relative transfer offsets.
The local transferEndOffset should be relative to the parent (us),
not to the underlying filesystem. We thus need to subtract our
own offset from the operation's offset.

This fixes a regression from be8080575a.
Errors transferring data should now be properly reported in more cases.
2024-09-02 17:57:32 -04:00
John Scipione 7e6bc7ce71 Deskbar & Tracker: Use menu font where appropriate
i.e. not on Deskbar team menu, menu field menus or the clock
options menu but all regular menus at the top of the window
and other context-click menus.

Change-Id: If551aecd040500973a92fda2138b6ffe03cda279
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8154
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2024-09-02 21:18:03 +00:00
Augustin Cavalier 544336415d BFS: Give endian macros parentheses.
Some things that call these macros put expressions in them; to avoid
operator precedence problems we should put them in parens.

Change-Id: I57335ffb190c484778c4bc8075d5ca3597f1e7e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8184
Reviewed-by: waddlesplash <[email protected]>
2024-09-02 20:19:06 +00:00
Augustin Cavalier 0ef833e5e8 build: Only add haiku_source to package repository if HAIKU_INCLUDE_SOURCES is set.
This way, we won't build the source package unnecessarily for
nightly images when it isn't included in the build.
2024-09-02 15:59:58 -04:00
Augustin Cavalier f9123b49e5 kernel/allocator: Adjust type of index variable. 2024-09-02 15:28:39 -04:00
Augustin Cavalier 35d9b4075a kernel/allocator: Add missed change to block_allocator_init_boot(). 2024-09-02 15:27:47 -04:00
Jarosław Pelczar 9e89f7c068 VMCache: Use rwlock for sCacheListLock
Lookups are more frequent than cache deletions.

Signed-off-by: Augustin Cavalier <[email protected]>
A compile benchmark seems to have little if any performance improvement.
However, this codepath will be hit when allocating pages that are
cached, so it may provide a more significant improvement once file
caches are fully utilized.
2024-09-02 14:47:35 -04:00
Augustin Cavalier b33f369dde kernel/debug: Add ASSERT_UNREACHABLE.
Under KDEBUG it panics, under non-KDEBUG it's __builtin_unreachable,
allowing the compiler to optimize things a little more.
2024-09-02 14:16:40 -04:00
Augustin Cavalier b973a1b377 kernel/util: Add fls to BitUtils.
Implemented using __builtin_clz where available, otherwise using
an algorithm derived from "Bit Twiddling Hacks" which is similar
to the one ramfs uses. GCC and Clang seem to unroll the loop on
x86 at least (but it doesn't matter there as the builtin exists,
implemented using the "bsr" instruction.)
2024-09-02 14:16:05 -04:00
Augustin Cavalier 31b7065940 kernel/slab: Remove terminating 0 from kBlockSizes.
And fix a read past the end of an array. Based on changes by jarekpelczar.
2024-09-02 13:21:22 -04:00
Jarosław Pelczar 2b162ce972 VMKernelArea: Ensure it's final class
Nobody should derive from it

Signed-off-by: Jarosław Pelczar <[email protected]>
2024-09-02 13:00:08 -04:00
Oscar Lesta 12aa283408 libtracker: avoid Tracker crash while changing resolutions.
After settings Backgrounds to None for all worskapces, I was getting a 100%
reproducible segment violation on "fShowingBitmap->fBitmap->Bounds()" with every
resolution change.

Change-Id: I2a3640a3c33e571d772c1b38b21087346215dca8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8176
Reviewed-by: Adrien Destugues <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-09-02 15:19:56 +00:00
John Scipione c9ce7be28c AbstractSpinner: live update text color when enabled
... whatever motivated this to only work on disabled text views
has been resolved.

Change-Id: I3ae9d056870f1163d3fa074ab9a1dad96c0192f8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8168
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2024-09-01 22:55:30 +00:00
Owen Anderson f73ff202af arm64: Implement VMSAv8TranslationMap::Protect in terms of ProcessRange.
Change-Id: I2825d265fec69c2ae033ee09ff0ead9b098a7ca9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8160
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2024-09-01 22:48:50 +00:00
Owen Anderson 744bdd7337 arm64: Implement ClearFlags in terms of ProcessRange.
Change-Id: I36ac90a3dc9d0a7dbb8c3b448fd79f2121bac9f2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8159
Reviewed-by: Fredrik Holmqvist <[email protected]>
2024-09-01 22:48:50 +00:00
Owen Anderson bb67bf75fb arm64: Implement VMSAv8TranslationMap::ClearAccessedAndModified
* Heavily inspired by the RISC-V equivalent.

Change-Id: I7d2ed14fb0a246223a23f7df659b6006326a7013
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8155
Reviewed-by: Fredrik Holmqvist <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-09-01 22:48:50 +00:00
Owen Anderson baf574c96a arm64: Reimplement ProcessRange and use it to implement Map().
* Fully implement break-before-make PTE updating, fixing the
  race condition that necessitates it.
* Incorporate align-down logic into the normal flow of the table
  traversal.
* Drop support for huge pages and for table freeing for now. They
  can be reimplemented once we have a fully functional baseline.
* Further adoption of the new ProcessRange coming in subsequent
  patches.

Change-Id: I852c63aaeab48b847b4bb99b328dfe071d27bb29
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8139
Reviewed-by: Fredrik Holmqvist <[email protected]>
2024-09-01 22:48:50 +00:00
Owen Anderson aa4f1de9ad Fix clang build by making herror consistently weak.
* clang, unlike GCC, does not allow a weak declaration to override
  a strong definition. We need to make herror's definition in
  addition to declaring the weak alias above.

Change-Id: Iac1c00e66bdd73d6e214e2302e18a0d51b18c9d6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8148
Reviewed-by: Fredrik Holmqvist <[email protected]>
2024-09-01 22:48:50 +00:00