66870 Commits

Author SHA1 Message Date
Owen Anderson
bb43aaacca arm64: Introduce SWDIRTY bit on page table entries.
* This allows us to correctly track dirty pages through RW->RO
  remappings.

Change-Id: I4309d5170ad66a175e884d1b28f31430adb7d67f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8318
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-09-16 16:55:35 +00:00
Owen Anderson
6a2e4f41f7 arm64: Make DBM and clean/dirty handling consistent throughout.
* Extract clean/dirty logic into helpers that can be reused.
* Make sure helpers handle both SWDBM and HWDBM.
* Preparation for the introduction of a SWDIRTY flag in a subsequent
  change.

Change-Id: I18b695b73294b9f8a1623bc2daec3f537316dd67
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8317
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-16 16:55:35 +00:00
Niklas Poslovski
2fafe865b1 Tracker: Make status text in StatusWindow readable in dark mode
Change-Id: I19eb4ad0b32f6fae7e75d4ac777521e0a2ba5b67
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8297
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: nephele nephele <nep-git@packageloss.eu>
hrev58128
2024-09-15 09:10:24 +00:00
Andrew Lindesay
ad2df681ab HaikuDepot: Fix Language Menu
Fix off-by-one issue and the init of the
default language in the case there's no
network connectivity.

Resolves #19090

Change-Id: I3d89bde16f67a8f50f4a08eead3d619a9f9d82f3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8328
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
hrev58127
2024-09-15 04:55:10 +00:00
Jérôme Duval
c936122410 intel: enable the active checkbox, if it's the first primary partition
* also set the active checkbox on edit
* part of #7930

Change-Id: Ia91e5f7295e7868647cf940aa1f281bd8dab1918
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8323
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
hrev58126
2024-09-12 18:44:32 +00:00
Ilmari "ilzu" Siiteri
afa8cd9c31 intel_extreme: Add more Tigerlake PCI IDs
* Added all Tigerlake PCI IDs from Intel documentation with all possible
host bridge configurations.
* Tested on 0x9a78 with 0x9A02 host bridge.
* Fixed uppercase letters in PCI IDs to lowercase to match existing code

Change-Id: I5ac8b857b952a2daa93364d9b1c640621d680f5d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8156
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
hrev58125
2024-09-12 17:41:42 +00:00
Augustin Cavalier
fbf5967e67 packagefs: Restore accidentally removed rw_lock initializations.
Incorrect rebase from the change that removes these from Node.
hrev58124
2024-09-11 15:23:40 -04:00
Augustin Cavalier
088e0628c2 packagefs: Acquire some more write locks to fix assertion failures. hrev58123 2024-09-11 15:20:35 -04:00
Augustin Cavalier
dfb09e12b1 packagefs: Set and unset node parents in Directory rather than Node::Init.
This way we can ASSERT() that the node doesn't belong to some other
directory.
2024-09-11 15:20:35 -04:00
Augustin Cavalier
cb29c48dfa packagefs: Add more write-locked assertions.
Also fix a memory leak on failure in mount().
2024-09-11 15:20:35 -04:00
Augustin Cavalier
57bc041d4b packagefs: Add CountReferences method to InlineReferenceable. 2024-09-11 15:20:35 -04:00
Jérôme Duval
6533131daf posix: dladdr was introduced in POSIX-2024, but with Dl_info_t
instead of Dl_info

Change-Id: Id2fe6d4b094c57ea49260c5765206c5e4bac5a63
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8274
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
hrev58122
2024-09-11 14:02:22 +00:00
Augustin Cavalier
a5dbc9f81c HaikuPorts: Synchronize. hrev58121 2024-09-10 23:21:22 -04:00
Augustin Cavalier
70b84c8aa2 kernel/locks: Assert that rwlocks have no readers on destruction.
Previously only whether there were active waiters was checked.
hrev58120
2024-09-10 23:02:18 -04:00
Augustin Cavalier
2d07400f07 nvme_disk: Unlock the ReadLocker before notifying the IORequest.
SetStatusAndNotify might call us back for more I/O, and we don't
need (or want) to hold a read-lock for that. It will be acquired
anew if necessary.
hrev58119
2024-09-10 18:13:32 -04:00
Augustin Cavalier
13a5c7f91f kernel/lock: Remove ASSERT_UNLOCKED_RW_LOCK from _rw_lock_read_lock.
It's valid to read-lock the same rwlock twice, of course.

(Only affects KDEBUG_RW_LOCK_DEBUG builds, the assertions do
nothing on any other.)
2024-09-10 18:12:20 -04:00
Augustin Cavalier
dd45194d37 kernel/lock: Adjust KDEBUG_RW_LOCK_DEBUG logic in _rw_lock_read_unlock.
We need to always decrement the count by 1 even if we own the lock.
Seems to fix some intermittent hangs with KDEBUG_RW_LOCK_DEBUG.
2024-09-10 17:24:57 -04:00
Augustin Cavalier
1705e9761a kernel/x86: Don't disable the CPUID/MSR TSC frequency read on hypervisor.
It was disabled when adding the hypervisor CPUID leaf reading to
the bootloader, but that's not really necessary. This way, if
a hypervisor does not provide that CPUID leaf but does provide
the value in the standard CPUID or MSR, we will still read it
correctly anyway.
hrev58118
2024-09-10 17:07:10 -04:00
Augustin Cavalier
1e13801271 kernel/locks: Add another assertion to _rw_lock_unset_read_locked.
This method is only used when KDEBUG_RW_LOCK_DEBUG is enabled,
which it isn't by default (even when KDEBUG is.)
2024-09-10 17:05:12 -04:00
Augustin Cavalier
0d931e6321 registrar: Use BMessage::MakeEmpty().
Shouldn't be a functional change, but more idiomatic.
2024-09-10 17:04:21 -04:00
Augustin Cavalier
f7c5998eb0 kernelland_emu: Include <debug.h> and set defines before <lock.h>. 2024-09-10 17:04:02 -04:00
Augustin Cavalier
f5f11192a1 kernel/slab: Add some more information to slab_object KDL command. 2024-09-10 17:03:43 -04:00
Augustin Cavalier
bfc4b17442 kernelland_emu: Fix build following kernel mutex ABI changes. hrev58117 2024-09-10 16:13:25 -04:00
Augustin Cavalier
65f942aada WebPositive: Add missed conversion from BString to HashString. hrev58116 2024-09-10 15:48:16 -04:00
Owen Anderson
edb17c548f Revert "arm64: Use DEVICE_GRE memory when mapping MTR_WC."
This reverts commit 0caf23319cb4e9f9c8a2ecd30e133e98a1d2b989.
This change is not safe because changing MAIR may invalidate
early mappings. It's also not clear if it's needed, as e.g.
FreeBSD does not use Device GRE mappings.

Change-Id: I95a904ee928281d44989ce707ed1ac59985a308d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8268
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Milek7 Milek7 <me@milek7.pl>
hrev58115
2024-09-10 18:46:23 +00:00
Owen Anderson
4bb796cf9d arm64: Fix issues pointed out in post-commit review.
* Use fInitialLevel throughout
* Fix a mix-up of platform-independent and platform-dependent flags.
* Use break-before-make in Protect()

Change-Id: Idfd69727ca5c438fe89df830d5e61780c3fb6a36
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8258
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Milek7 Milek7 <me@milek7.pl>
hrev58114
2024-09-10 18:46:14 +00:00
Augustin Cavalier
ab4fc43458 EntryCache: Cache the entry's hash value.
EntryCacheEntry was padded out to 40 bytes, so this doesn't increase
its size (on 64-bit platforms).

Also increase entriesSize to actually be a power of 2.

This saves us a string comparison when the hashes don't match.
It saved around ~1400 such string comparisons during a boot, and then
rebuilding HaikuDepot, it saved around ~10,000 (both numbers after
factoring in the hashes that compared equal but the directory
values differed, as we skip the string comparisons in that case too.)

Time to compile HaikuDepot seems slightly improved, on average.
hrev58113
2024-09-10 14:07:37 -04:00
Augustin Cavalier
1af0198a7d EntryCache: Unify hash computation logic and use uint32 for it.
Some methods returned uint32 and others returned size_t. We always
set only the lower 32 bits of the value, so just use uint32 everywhere.
2024-09-10 13:43:18 -04:00
Augustin Cavalier
b8a2c90991 EntryCache: Use memcpy to copy the strings.
We already use strlen() once, we might as well cache that result
and then use memcpy() instead of strcpy().
2024-09-10 12:40:00 -04:00
Jarosław Pelczar
abc06f6bc2 EntryCache::Add: Avoid potential deadlock when waiting for memory
If system RAM is very low, avoid potentially long waiting for entry
cache to be populated. If entry couldn't be cached, nothing serious
is going to happen.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
hrev58112
2024-09-10 12:39:24 -04:00
Augustin Cavalier
f3a9981f9f kernel/vm: Add dangling-reference assertions to AddressSpace{Read,Write}Locker.
Inspired by a change from jpelczar.
2024-09-10 12:35:41 -04:00
Augustin Cavalier
b4798ac6a7 kernel: Add assertions to ensure vm_page_reservation is destroyed with a count of 0.
Inspired by some of jpelczar's changes.
2024-09-10 12:13:38 -04:00
Augustin Cavalier
5f8fe75449 freebsd_network: Don't include <vm/vm_page.h> in bus_dma.cpp.
The BSD headers prevent using ASSERT definitions in it if we do,
and one will be added in the next commit. Just declare the one
method we need from it instead.
2024-09-10 12:11:57 -04:00
Augustin Cavalier
fcae3b6674 kernel/thread: Unset user_data only after unblocking the thread.
This amends 352548d0a3ce33d0c3bad5e8217ed5f4abc90ced.

If the thread was migrated to another CPU after it was blocked with a
timeout and then was unblocked without needing the timeout, this handler
could possibly race with the thread waking up on the other CPU, resulting
in the other thread thinking it doesn't need to cancel the timer when
the timer is still in the process of running.

May fix #18983.
hrev58111
2024-09-10 11:17:38 -04:00
Augustin Cavalier
d8e26ab4d1 HaikuDepot: Switch to using BString::HashValue. hrev58110 2024-09-09 23:36:39 -04:00
Augustin Cavalier
cfdc362817 pthread_barrier: Actually unlock the barrier lock.
If we just unblock all threads without actually releasing the lock,
then in the case where all threads have performed the atomic_add
but none have actually started waiting, we'll deadlock forever.

Fixes Mesa deadlocking when using our pthread barriers (at present
it's been using its own.)
hrev58109
2024-09-09 23:08:00 -04:00
Augustin Cavalier
151f01c21d Debugger: Remove unused includes.
Missed in prior change.
hrev58108
2024-09-09 22:35:29 -04:00
Augustin Cavalier
f4e0ce8d61 kernel/lock: Fix ABI compatibility between KDEBUG and non-KDEBUG builds.
This breaks kernel ABI on KDEBUG builds (but not non-KDEBUG builds),
but it does so in order to resolve a long-standing incompatibility
between them: until now, any kernel add-ons built against one which
made use of these lock facilities could not be run on the other;
instead you would get hangs and/or crashes.

After this change, kernel add-ons built with a KDEBUG configuration
should work on a non-KDEBUG kernel, while add-ons built with a
non-KDEBUG configuration will fail to load on a KDEBUG kernel
with unresolved symbols, preventing incorrect and broken operation.
hrev58107
2024-09-09 22:35:05 -04:00
Augustin Cavalier
cf5249749d libbsd: Use timespec_to_bigtime for time conversions in kqueue.
The FreeBSD manpage indicates that it will fail with EINVAL if
an invalid timespec is passed.
hrev58106
2024-09-09 17:33:04 -04:00
Augustin Cavalier
6a2d53e723 Debugger: Use BString::HashValue().
Previously BString::HashValue() had an identical hash to the one
in StringUtils::HashValue(), but now it uses hashdjb2, so this
means Debugger will now use that also.

Tested basic Debugger functionality, seems to still work.

Change-Id: Ia341daa56249967a494df46e6e0a69a74c8b5fe2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8266
Reviewed-by: Rene Gollent <rene@gollent.com>
hrev58105
2024-09-09 18:13:29 +00:00
Niklas Poslovski
f589347ebc Tracker: Fix text color in FilePermissionsView
Change-Id: I7bb4ff2529d664ae759b931f51fb26125ce84a83
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8296
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
hrev58104
2024-09-09 17:46:13 +00:00
Augustin Cavalier
c07586a343 kernel/low_resource_manager: Add wait entry before releasing the semaphore.
Otherwise the low_resource thread's run may complete before we
even start waiting, which makes things much slower as we then
have to wait all the way to the timeout.
2024-09-09 13:44:18 -04:00
Augustin Cavalier
54113084a4 kernel/locks: Add another assertion to _mutex_unlock.
We should only get an error return code in this method when the mutex
was destroyed, in which case waiter.thread should be NULL.

Also do some minor code cleanups.

May help with diagnosing #18983.
2024-09-09 13:42:26 -04:00
Augustin Cavalier
67c0b8f2d1 BString, HashString: Replace string hashes with hashdjb2. hrev58102 2024-09-09 13:39:29 -04:00
Augustin Cavalier
e9254dd79c Package Kit, WebPositive: Standardize string hashes.
Use either HashString or BString::HashValue (both of which currently
use the "modified hashpjw".)
2024-09-09 13:39:28 -04:00
John Scipione
73b4c7a698 HaikuDepot: Prevent crash when hovering over or clicking on conditions
... before the text is loaded by checking that the text document is set.

Remove fMouseDown member and MouseUp() override.
Get mouse button down from the current window message.

Call inherited BView methods.

Fixes #19077

Change-Id: I79edb1860e3bd7864d2362d7f59fb3a583d19053
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8260
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
hrev58101
2024-09-09 16:26:01 +00:00
Jérôme Duval
1754f053a3 pthread: add PTHREAD_MAX_NAMELEN_NP for pthread_setname_np
Change-Id: I52e9e8a672f76048e1ff0c4a6ddeeecb2d134a5a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8259
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
hrev58100
2024-09-09 14:41:35 +00:00
Niklas Poslovski
7fe83eb50d Mail: Use mix_color to make quote colors readable in dark mode
Fixes #18968

Change-Id: Ic8a63820ef004fbc0d98a80f4dccde2b90d1fa1a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7951
Reviewed-by: nephele nephele <nep-git@packageloss.eu>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
hrev58099
2024-09-09 08:40:55 +00:00
John Scipione
f657ee8e46 WebPositive: Small corrections to hrev58090
Add missing break statement (and remove curly brackets).
Use FindColor instead of GetColor, no default color on failure.

Change-Id: Ic868a82ec653226a4fbdec57b5fa7d3f58b2bf27
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8244
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: nephele nephele <nep-git@packageloss.eu>
hrev58098
2024-09-09 08:40:01 +00:00
Augustin Cavalier
0d71a44091 mixer: Also delay starting the mixer until the realTime is recent.
If it's more than a second in the past, continue delaying.
May help with #19074 and/or #18981.
hrev58097
2024-09-08 15:22:06 -04:00