Commit Graph

67288 Commits

Author SHA1 Message Date
Augustin Cavalier
8728f4797f libroot: Move malloc implementations to their own subdirectory.
No functional change intended.
2024-09-16 16:12:01 -04:00
Augustin Cavalier
f6313044f1 kernel/vm: Add "unimplemented" messages in VMTranslationMap::Debug methods.
This way, when certain KDL commands don't work on architectures that
don't implement these methods, it won't be a mystery as to why.
2024-09-16 16:00:01 -04:00
Augustin Cavalier
d29c0e6ee5 libroot: Fix shared unnamed semaphore acquisition with timeouts.
We set flags above the timeout check, so we need to use |= and
not lose the SHARED flag we already set.

Fixes some testcases in the POSIX testsuite, and the shared
semaphore code in Gecko/Firefox.
2024-09-16 15:38:29 -04:00
Augustin Cavalier
2eb83002c5 strace: Add FlagsTypeHandler for the mutex option flags.
So that MUTEX_SHARED etc. are displayed in strace output.
Also fix indentation, and the name of the "toFlags" parameter
in syscall definitions.
2024-09-16 15:36:12 -04:00
Augustin Cavalier
e1d0a30ed4 bin: Link launch_roster against libshared. 2024-09-16 14:48:54 -04:00
Augustin Cavalier
532c5e75d3 TextTable: Ignore ANSI escape codes when counting text width.
Otherwise the launch_roster table will be misaligned.
2024-09-16 14:39:31 -04:00
Alexander von Gluck IV
ece6263825 launch_roster: Spice up launch_roster, add color and details to job list
Change-Id: Iae907da336209bcbe39d37bfa35f090b46e783d2

Amended by waddlesplash to use TextTable.
2024-09-16 14:38:04 -04:00
Augustin Cavalier
33ce9b1b5c runtime_loader: Remove -fno-builtin from compiler options.
Except on kernel_cpp.cpp. We don't use it for most of libroot, so
we don't need it for most of runtime_loader either. The two preceding
changes were all that's necessary to fix things with builtins enabled.

Very slight performance improvement (the "run 1000 shells" benchmark
seems to decrease by about 0.4 seconds out of 16.5 or so.)
2024-09-16 13:23:46 -04:00
Augustin Cavalier
6a519848d8 runtime_loader: Add cast in ELF TLS to appease GCC.
Otherwise when builtins are enabled, we get class-memaccess warnings.
2024-09-16 13:19:47 -04:00
Augustin Cavalier
6863cd3038 runtime_loader: Add calloc() to heap implementation.
Taken from the bootloader's version, which this heap is based on.
2024-09-16 13:18:57 -04:00
Jessica Hamilton
b6554e72fc configure: allow specifying python to use --with-python.
Change-Id: Iba5e5a428a4cd84e6dc149943c033d2c5025ae23
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8327
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-16 16:57:03 +00:00
Jessica Hamilton
c40570934e configure: add a version check for python.
Tooling used by HaikuDepotServer relies on typing features that
exist in Python >= 3.9.

Change-Id: I926d464130a3cef331a00b9a6abbbad5edfcefda
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8326
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-16 16:57:03 +00:00
Jessica Hamilton
e22ea41c57 configure: add missing sanity check for cross tools options.
Change-Id: Ia79a7eb654dc4bb8dfa35df0f85b2428965e1571
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8325
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-16 16:57:03 +00:00
Owen Anderson
83316034af arm64: Remove unnecessary TLB flush
Change-Id: I4c1c68dffee4fe054100293410b8988f623a8e9d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8319
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
af5e461fb1 arm64: Fix TLB flushing of the kernel address space.
* Don't use ASID-delimited flushes for kernel space. The ASID comes
  from TTBR0_EL1, but kernel address space comes from TTBR1_EL1, so
  this never works.
* Adjust ProcessRange to operate on unmasked VAs. This means that
  the kernel space tag bits are preserved and passed into the
  callback, which can then pass to them to whatever flushes are
  necessary correctly.

Change-Id: If86aeea105f50fc4f294ce1c85cea5dfc938f5cf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8324
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
Owen Anderson
129bc12b13 arm64: Factor out access flag checking when flushing TLB entries.
Change-Id: Id4c5f79042a801f1dcd2a553783862ec762c94ea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8322
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
Owen Anderson
0a36780989 arm64: Implement UnmapArea
Change-Id: Ia46b9c03dc471a795baf7b82fc146c39ce4ebeb9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8321
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
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
Owen Anderson
3b098011b4 arm64: Implement UnmapPages
* Derived from RISC-V implementation

Change-Id: Ia5d95dce3dc9936f5bb6d03ed04ff4133162d93d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8320
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
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>
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>
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>
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>
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.
2024-09-11 15:23:40 -04:00
Augustin Cavalier
088e0628c2 packagefs: Acquire some more write locks to fix assertion failures. 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>
2024-09-11 14:02:22 +00:00
Augustin Cavalier
a5dbc9f81c HaikuPorts: Synchronize. 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.
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.
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.
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. 2024-09-10 16:13:25 -04:00
Augustin Cavalier
65f942aada WebPositive: Add missed conversion from BString to HashString. 2024-09-10 15:48:16 -04:00
Owen Anderson
edb17c548f Revert "arm64: Use DEVICE_GRE memory when mapping MTR_WC."
This reverts commit 0caf23319c.
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>
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>
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.
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>
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