Commit Graph

67029 Commits

Author SHA1 Message Date
Jessica Hamilton
7c6ab83094 configure: detect supported retry flags for wget.
Some systems may be using wget2 symlinked to wget (Fedora,
currently), which doesn't support --retry-on-host-error.

Change-Id: I9fac080e7ac1cc4c39a03f6c27e9c42f8697ecff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8336
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-10-14 11:01:19 +00:00
Pierre Ducroquet
66582b42a5 Printers window position: fix initial position
on a fresh Haiku install, Printers window title is hidden
due to the window position. Also use a better filename
for the window position settings.

Change-Id: Iee6a8fd0d992c5265f07082e5df99c577433b21d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8420
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-10-14 10:59:12 +00:00
Augustin Cavalier
2116682cac bootloader: Round up heap region allocation sizes to B_PAGE_SIZE.
In testing, the allocation sizes I was seeing were all multiples
of the page size anyway, but of course there's no requirement
that they are, so we need to round here.

Pointed out by mmlr.
2024-10-13 21:16:44 -04:00
Augustin Cavalier
8b813adf6d bootloader/bios_ia32: Allocate physical memory from the kernel separate from the bootloader.
Just start the kernel allocations after the end of the identity map
(i.e. the first 8 MB of RAM.) This way, we can avoid putting the
bootloader heap and page table memory into the kernel ranges
at all, which avoids leaking it.
2024-10-12 14:37:32 -04:00
Augustin Cavalier
eb5855c963 bootloader/bios_ia32: Turn off tracing of the SMP code.
This is mostly just spam at this point, but a few of the traces
are turned from TRACE to dprintf() so they stay around.
2024-10-12 14:32:43 -04:00
Augustin Cavalier
c63558614e libroot: Use timespec_to_bigtime for time conversions in the POSIX semaphore implementation. 2024-10-12 13:48:14 -04:00
Augustin Cavalier
0324754ddb Add MoveOnScreen() calls to a number of applications.
Technically reverts 039f93ce5e,
but just moves the call elsewhere.

Should fix #19164.

Change-Id: I3f240d4a28a4ec522382440944a3c80a74bbaa0e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8445
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-12 17:33:25 +00:00
Augustin Cavalier
9d9aa08a75 USB: Include <Referenceable.h>.
It's implicitly included on some arches but not others, it seems.
2024-10-12 12:56:09 -04:00
Augustin Cavalier
b511d6b064 kernel/vm: Improve new-range logic in vm_allocate_early_physical_page.
* Break upon finding an allocatable page.

 * Use addr_range& where possible.
2024-10-12 12:54:41 -04:00
Augustin Cavalier
12357279a8 kernel/vm: Try expanding upwards from the last allocated range.
The most likely case is that the last range is the one we actually
want to try expanding, so this should be a slight efficiency gain.
But it also will help in avoiding allocating "low" memory when
it isn't necessary.
2024-10-12 12:40:47 -04:00
Augustin Cavalier
bb7ace43c2 kernel/vm: Clean up logic in vm_allocate_early_physical_page.
Use local addr_range& variables instead of array accesses.
Functionally equivalent but much nicer to read.
2024-10-12 12:40:47 -04:00
Augustin Cavalier
23cf326b86 USB: Properly report initialization status in Stack::InitCheck().
Should fix one of the new KDLs in #19117 due to the PhysicalMemoryAllocator
failing to initialize.
2024-10-12 12:40:47 -04:00
Niklas Poslovski
baf30547f7 ScreenSaver: Use B_PANEL_TEXT_COLOR for text in the PasswordWindow
Change-Id: Id4f1cc65b15b74c6a8e2cf551f7fdfc7fe481cca
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8389
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-12 15:56:14 +00:00
Autocomitter
091140b15a Update translations from Pootle 2024-10-12 08:06:46 +00:00
Augustin Cavalier
b6ea04cf89 USB: Transfers should hold references to their Pipes.
This way, the Pipe won't be seen as "idle" when there are still
transfers in flight with references to it.

May help with diagnosing or even outright fix #17549, #18768, #17799
and #17348.
2024-10-11 11:24:11 -04:00
Augustin Cavalier
f7325a93db USB: Use BReferenceable for USB objects.
The "busy" counter functionally amounted to a reference count.
So just turn it into a real one, instead.
2024-10-11 10:46:18 -04:00
Augustin Cavalier
50496cd3da BReferenceable: CountReferences() needs to use atomic_get. 2024-10-11 10:22:37 -04:00
Augustin Cavalier
0dfa0e581d kernel/x86: Implement DebugGetReverseMappingInfo for X86VMTranslationMap64Bit.
Change-Id: I57b734dabaf1ed02fc681cb0b957fa7392c2f69f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8367
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-10-11 14:19:38 +00:00
Niklas Poslovski
0a5286c120 Screen: Use B_PANEL_TEXT_COLOR for text in the RefreshWindow
Change-Id: If52c7462f6900643a8e5875b79399542e6524017
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8388
Reviewed-by: nephele nephele <nep-git@packageloss.eu>
2024-10-11 07:43:37 +00:00
Augustin Cavalier
d2b9dcde31 kernel/vm: Only print "not implemented" messages in VMTranslationMap under KDEBUG.
Change-Id: I63e3c71b40d3ff5ae4a272fbbb1da96d7d2d8f38
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8443
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-10 20:07:14 +00:00
Augustin Cavalier
9e3eeba450 bootloader: Actually, don't release the heap just yet.
The EFI loader still needs it inside platform_start_kernel,
unfortunately.
2024-10-10 15:36:52 -04:00
Augustin Cavalier
545ea51c99 bootloader: Actually release the heap.
This avoids leaking the bootloader heap memory into the kernel.
Ideally it'd be dropped automatically, but in seems in many cases
it isn't (even on EFI).

Adjust platform logic to always remove the physical allocated range,
and ignore the return code and reuse the memory anyway if we can.
2024-10-10 15:04:47 -04:00
Volo
81a981f14a efi/serial: fix serial re-init on x86_64
serial_init should be called after calling ExitBootServices

Change-Id: I2a04ee1eaf1d1fe9aaed3fa65b5521161ff74130
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8435
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2024-10-10 16:40:15 +00:00
Augustin Cavalier
875b13d582 bootloader: Overhaul heap region allocation.
Previously, there was only platform_init_heap/platform_release_heap,
which allocated a single static heap region for the heap to use,
and any subsequent heap allocations had to go through the standard
platform_allocate_region, which allocates regions visible both
to the bootloader and the kernel.

But as mentioned in previous changes, it isn't always easy to
release regions allocated that way. And besides, some bootloaders
(like EFI) use a completely separate mechanism to allocate
bootloader-local memory, which will never get "leaked" into
the kernel.

So instead, refactor all platforms to instead provide two
new methods: platform_{allocate,free}_heap_region. On EFI
this is easy to implement; on most other platforms we have
logic based more on the old platform_init_heap or allocate_region.

(On the BIOS loader in particular, we can only fully release
the memory if it's the last thing we allocated in the physical
addresses. If the "large allocation" threshhold is lowered
back to 16 KB, then we are unable to do this enough times
that we will run past the end of the 8 MB identity map and
thus fail to boot. But with the larger threshhold, we don't
leak nearly as much, and don't hit the threshhold.)

This should further reduce the amount of bootloader memory
permanently "leaked" into the kernel's used memory, though
on some platforms it may still be nonzero.

Change-Id: I5b2257fc5a425c024f298291f1401a26ea246383
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8440
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-10 16:13:11 +00:00
Augustin Cavalier
359a04ba96 bootloader: Cleanup handling of LargeAllocations.
* Remove unused SetTo; clear Address/Size to 0 on init.

 * Free all LargeAllocations in heap_release. (This method isn't
   actually called by default before kernel entry, though, so
   it probably doesn't matter much.)

Change-Id: If038274adcd65adae527235d16860af659ef37b6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8439
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-10-10 16:13:11 +00:00
Augustin Cavalier
d1ef184af6 bootloader: Add remove_{physical|virtual}_allocated_range methods.
Will be used in following commits.

Change-Id: Ica89d28cbf6980aca8dc347dfdcb200a0e637e9a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8442
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-10 16:13:11 +00:00
Augustin Cavalier
5e451463d0 kernel/vm: Add assertion for a TODO comment in mark_page_range_in_use.
It should be OK to call this during kernel startup without using
reservations, since it's mostly used for fixed memory ranges
specified by the bootloader.

Also turn a later dprintf into a panic.
2024-10-10 11:39:20 -04:00
Augustin Cavalier
1db0961121 kernel/vm: Remove an obsolete comment.
page_num_t is typedef'd to phys_addr_t, so it's 64-bits on 32-bit
platforms with PAE. In fact it's been so since the introduction
of phys_addr_t, so this comment was obsolete from the start...
2024-10-10 11:20:20 -04:00
Augustin Cavalier
cd430b6fe5 kernel/vm: Also try starting new ranges in vm_allocate_early_physical_page.
If the existing allocated ranges are from physical memory ranges that
are just too small, then we'll need to start a new "allocated" range
based on the next-available physical memory range.

Should fix the "PANIC: error allocating early page!" tickets
(i.e. #14659 and friends.)
2024-10-10 00:44:27 -04:00
Augustin Cavalier
27d0a861e0 kernel/vm: Clean up vm_allocate_early_physical_page.
Clean up comments, merge assignments with declarations, etc.
No functional change intended.
2024-10-09 23:42:37 -04:00
Augustin Cavalier
b1e579c6f1 kernel/vm: Clean up dump_caches command.
* Declare kCacheInfoTableCount as uint32 and avoid casts.

 * Combine rootCount checks and consolidate + de-indent logic.
2024-10-09 23:41:36 -04:00
Augustin Cavalier
04c9b279cb packagefs: Followups to the directory locking change.
* Fix the build with DEBUG enabled.

 * Add some more read-locks, to be safe.
2024-10-09 23:29:03 -04:00
Augustin Cavalier
38946ff82f bootloader: Increase the "large allocation" threshhold to 128 KB.
Not all platforms can properly release memory allocated via
platform_allocate_region() at present; in particular the BIOS
loader seems to (at least partially) leak it. And due to how the
kernel args ranges are handed off to the kernel, it seems
allocated physical pages that aren't virtually mapped are
leaked at present as well.

That seems like a bug that we should likely fix, and moreover
the heap shouldn't use that facility at all (but instead
request bootloader-local memory if possible; on the BIOS
loader that will ultimately go through similar logic, but
on e.g. EFI it will be entirely separate.)

But in the meantime, we can just increase the size of the
"large allocation" threshhold so that packagefs temporary buffers
(of 64 and 93 KB) stay on the main heap, and don't hit that
facility at all. The "maximum boot loader heap usage" seems
to go up by about ~200 KB with this change (e.g. 588 KB -> 797 KB),
so increase the default heap size by 256 KB to compensate.

This fixes most of the rest of #14831: memory usage after the
boot has finished is down by over 100 MB (!). The remaining
problems and leaks can be dealt with in later changes.
2024-10-09 22:19:45 -04:00
Augustin Cavalier
10bba152b3 bootloader: Set a default heap size for all platforms.
Use the one from the BIOS loader (1.25 MB) and apply it everywhere.
2024-10-09 22:08:36 -04:00
Augustin Cavalier
6dae8511ff kernel/lock: Reinstate ASSERT_UNLOCKED_RW_LOCK in _rw_lock_read_lock.
This reverts commit 13a5c7f91f,
and adds an inline comment explaining why this actually isn't allowed,
despite "working" in most circumstances.

Doesn't affect anything in default builds (KDEBUG_RW_LOCK_DEBUG
is not enabled under KDEBUG.)
2024-10-09 16:23:01 -04:00
Augustin Cavalier
bc89edc3c3 kernel/vm: Add some more information to the commitment <= size check.
May help with diagnosing #19155.
2024-10-09 14:56:35 -04:00
Augustin Cavalier
87a66be550 BFS: Optimize the search for the next free block.
We already started at the first-free in the block bitmap, but
after that we would just check individual bits as we went along.

Now we skip forwards to the next free block when encountering a
used block, by comparing to UINT32_MAX (all blocks used) and using
ffs() with a bitwise NOT (to find the first unused block in a chunk.)

This will benefit fragmented partitions more than non-fragmented ones.
I didn't see a significant speedup on my compile benchmark in a VM.

Fixes #18929.

X512 tested this patch and confirmed it reduces CPU usage on a
partition that he saw long times spent in AllocateBlocks on.

Change-Id: If71b5e24c585c2cc08879c8aefc80af8ae7da91f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8186
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-10-09 17:59:59 +00:00
Augustin Cavalier
6e690f7d11 drivers/network: Rename "vmx" to "vmxnet" and clean up glue. 2024-10-09 13:40:20 -04:00
Augustin Cavalier
b62f05cbe7 kernel/vm: Use CREATE_AREA_DONT_COMMIT_MEMORY in vm_map_physical_memory_vecs.
Should fix an "ASSERT UNREACHABLE" KDL encountered when this method
is used.
2024-10-09 13:35:27 -04:00
Augustin Cavalier
3ac3785347 ICUTimeConversion: Remove special casing in _FillTmValues for GMT.
This basically reverts the changes in this function back to before
5b4d5ef897.

As c686c2216c is left intact, #19047
is still fixed regardless.
2024-10-09 13:34:34 -04:00
CodeforEvolution
48d27198d0 vmx: Introduce VMXNET3 Network Driver from FreeBSD 14.1
Tested with VMWare Workstation Pro 17.6.0 with Haiku x86_64 hrev58201.
To test, had to manually open the .vmx file associated with the VM and added the line:
ethernet0.virtualDev = "vmxnet3"

Change-Id: Ic76dcc61583707345bee46624814a38f66eb4f9f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8438
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-08 12:16:49 +00:00
Augustin Cavalier
0059775c1d packagefs: Make directory nodes rw_locked instead of child entries.
This saves 40 bytes from the size of Node (on 64-bit architectures.)
UnpackingDirectory is still at 200 bytes, while UnpackingLeafNode
is now 96 instead of 136. This saves ~5MB of memory on my system
(UnpackingLeafNodes go from 16.2MB to 11.2MB.)

The general strategy is for Directories to use their own locks, while
all other nodes read-lock their parent directory during use. There are
a few edge cases around node creation and removal in the case of
non-directory nodes; see inline comments in Volume's
_RemoveNodeAndVNode as well as packagefs_put_vnode.

Since it's now possible for a node's parent to change or be deleted
when we don't have the lock (but only a reference), we need a lock
protecting just that field to hold while we acquire a reference to
the parent. (Right now, this is just one static rw_lock for all Nodes;
this could be changed in the future if necessary, but it seems performant
enough for the moment.)

Tested with basic system functionality, installing/uninstalling packages,
uninstalling packages with files still in use, HaikuPorter builds, and
more. All still seems to work as expected.

Change-Id: I054187316c66b77ea1951c6d1ea8e5b75715c082
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7930
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-08 12:13:19 +00:00
Owen Anderson
6519d02771 arm64: Port working MaxPagesNeededToMap from RISCV
Change-Id: Ib532621656c57a34989879c43cc02a5bf81dc7bd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8437
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2024-10-08 11:42:49 +00:00
Owen Anderson
17c50417f8 arm64: Fix double locking when calling FreeTable
Change-Id: I159ccd17ec6c06d759e856f5397bf00a7473d1e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8436
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-08 11:42:49 +00:00
Andrew Lindesay
f597685760 HaikuDepot: Fix Open Button Name
The "open" button on an installed package is currently missing the
name of the application to launch.

Fixes #19147

Change-Id: I24cca3c5f1f4f11f81e99e4223042a0081c7babf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8434
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-10-06 17:46:40 +00:00
Niklas Poslovski
0076659590 ICU: Fix dates in the future, avoid returning B_ERROR
Change-Id: I51a2ead9484f4ac1affd8baf4f94c6984db26070
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8387
Reviewed-by: humdinger humdinger <humdinger@mailbox.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-06 17:37:48 +00:00
Autocomitter
a7a4f17d60 Update translations from Pootle 2024-10-05 08:08:07 +00:00
Augustin Cavalier
9f07fe52a4 kernel/vm: Don't commit memory for non-private clones in vm_clone_area.
The source area should already have dealt with commitments (or not.)
Fixes cloning of physical map areas and the like (#19143.)
2024-10-03 12:07:35 -04:00
Augustin Cavalier
ce2b9f5ec2 kernel/vm: Fix interaction between set_area_protection and set_memory_protection.
* When the page_protections array is allocated, we should clear the
   protections from the area's flags, since they aren't used for
   anything when the page_protections array is activated.

 * When set_area_protection is called and there is a page_protections
   array in use, it should be freed, and we should reset the protections
   on all pages.

 * Add some tests related to these behaviors.
2024-10-02 16:39:36 -04:00
Augustin Cavalier
d3b93408f1 kernel/vm: Add ASSERT_UNREACHABLE() in VMCache::Commit.
This should never be invoked; only derived-class implementations
should be.
2024-10-02 16:09:17 -04:00