Commit Graph
68025 Commits
Author SHA1 Message Date
Augustin Cavalier bc50ada648 kernel/slab: Use FIFO instead of LIFO queueing for the object cache.
This should make use-after-frees more likely to be caught by the
standard paranoia facilities (and make them less likely to be
exploitable as memory will take longer to be reused.)
2025-09-03 15:41:58 -04:00
Jérôme Duval 0937305b84 gnu/sched.h: fix CPU_COUNT on gcc2 C89
Change-Id: Ia193e342d2bbac8060189f062e35aca47426444e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9626
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-03 15:10:23 +00:00
Joachim Mairböck b54f586058 sys/wait.h: add WCOREDUMP as alternative to WIFCORED
As this is part of POSIX since 2024, WCOREDUMP is the new default name.
WIFCORED is retained under _DEFAULT_SOURCE.

Fixes #19735.

Change-Id: Ic3f65e47b436bae92fe82ef73c3094be6bc9f29d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9622
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-01 16:33:57 +00:00
Jim906 53930893f4 nfs4: Improve compliance with VFS policy
* Eliminate the use of acquire_vnode as a probe to see whether a node
  has been constructed on the client side.
* Put the root node in unmount.
* In DirectoryCache::_LoadSnapshot(), don't mark a node removed unless
  certain that no other hard links exist.  The old logic might cause
  problems if, after marking a node removed, the client found another
  link to the file in another server directory.

The reason for removing the asserts from FileSystem::GetInode() is
that, with get_vnode calls replacing acquire_vnode calls, this may be
called earlier in the process of file creation, before
FileSystem::fInoIdMap contains an entry for the new file.

The changed logic in _LoadSnapshot isn't directly related to the new
VFS asserts.  It is meant to correct a problem that I noticed
incidentally when making the other changes.

Change-Id: I075485bc68ea9443be899add948116f0a0bca047
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9624
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-09-01 15:59:09 +00:00
Jérôme Duval e1e1c75a1f gnu/sched.h: fix CPU_* definitions to match glibc
add CPU_COUNT and cpu_set_t

Change-Id: I9b92cab27a8bb4fda71a99721801013647e02588
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9618
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-09-01 08:00:26 +00:00
Augustin Cavalier ff9a75a6f5 kernel/EntryCache: Always resize if needed in _AddEntryToCurrentGeneration.
Otherwise, the only place we resize the table is Remove(), and if
that doesn't get called (because no files are being deleted) then
we will rarely, if ever, resize the table, leading to performance
issues.

Fixes a performance regression easily seen by running "grep -R".
2025-08-30 12:36:35 -04:00
Augustin Cavalier 23f75d5229 BFS: Don't acquire/put the indices node in BPlusTree.
Fixes #19733.
2025-08-30 12:26:34 -04:00
Augustin Cavalier 6a3146aad9 kernel/timer: Slightly optimize spin().
Move the math operation out of the loop.
2025-08-30 11:28:19 -04:00
Augustin Cavalier 13e97a61cc kernel/x86: Use rdtsc in the fallback arch_debug_snooze case.
This allows us to avoid extra calculations and read barriers
in spin() from system_time(), and it should be easier to detect
as an "idle loop" if emulators want to do that.
2025-08-30 11:28:19 -04:00
Joachim Mairböck b0c4061d51 bindfs: Put the root node in unmount.
Now required.

Fixes #19734.

Change-Id: I13dd5ea1f7e90c7e22ebfa072fe2e413742aab67
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9620
Reviewed-by: waddlesplash <[email protected]>
2025-08-30 15:20:49 +00:00
Joachim Mairböck e62a065081 packagefs: Put the root node in unmount.
Now required.

Part of #19734.

Change-Id: I6e438b2d018480a5a63ab3ba0a43838e4d019c8d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9619
Reviewed-by: waddlesplash <[email protected]>
2025-08-30 15:20:49 +00:00
Autocomitter 07613144d8 Update translations from Pootle 2025-08-30 08:10:55 +00:00
Augustin Cavalier 45f8b627d5 ext2: Put the root node in unmount.
This reverts commit 2df6cc0b3b.

Now required (again).
2025-08-29 15:04:04 -04:00
Augustin Cavalier 670620af72 NTFS: Put the root node in unmount.
Now required.
2025-08-29 15:04:03 -04:00
Augustin Cavalier 37563c2a01 FAT: Put the root node in unmount().
Now required.
2025-08-29 15:04:03 -04:00
Augustin Cavalier 6b86bc6ea3 kernel/fs: Handle root vnode ownership correctly and add more assertions.
In 5b14757a30 (2005), a change was made
to have root nodes be owned by filesystems, rather than
by the VFS (as BeOS did.) However, later on,
in fe5928847a (2011),
the adding of covered vnodes broke that.

As put_vnode's error was silently ignored, this went unnoticed
until this week, when the new asserts started firing.

So, to fix this, increment the reference count of the root when
setting its covering vnode, and handle the root specially.
Assert in ~fs_mount that there are no vnodes left; if the
filesystem failed to free it, this assert will trip.

Fixes the new assert seen in #19642.
2025-08-29 15:04:03 -04:00
Jérôme Duval ad49acb949 null: merge /dev/zero and add a /dev/full
present on both FreeBSD and Linux.
useful to test a "disk full" condition.

Change-Id: Ibac6b50e8063c90e3e324ec04ac136c34298cc7f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9617
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-08-29 06:57:40 +00:00
Augustin Cavalier effc4f4704 ramfs: Optimize Volume::NodeAttributeRemoved() slightly.
Use the pointer to the Index stored with the Attribute
rather than doing an unnecessary lookup.

Also clean up code style.
2025-08-28 19:39:40 -04:00
Augustin Cavalier 8aae7e134a ramfs: Miscellaneous code cleanups.
No behavioral change intended.
2025-08-28 19:38:40 -04:00
Augustin Cavalier 2d6a1945f0 ramfs: Put key length in the type in Attribute::GetKey.
Many of the callers of this method didn't initialize
the length parameter properly, which led to uninitialized
memory being used as part of the min() calculation, which
caused all sorts of problems.

Now we don't require them to pass in anything, and use the
constant directly.

Fixes #19252.
2025-08-28 19:38:12 -04:00
Augustin Cavalier 8f7bb51e20 ramfs: Properly update indexes when attribute sizes change.
Otherwise we'll have incorrect data in the index.

Part of #19252.
2025-08-28 19:35:06 -04:00
Augustin Cavalier 4e09216c77 ramfs: Keep track of attribute indexed state better and add assertions.
The "ASSERT(!fInIndex || fInIndex != inIndex);" one, tracking
state transitions, catches the underlying cause of #19252.
2025-08-28 16:57:13 -04:00
Augustin Cavalier 6818591003 kernel/fs: Add assertions to acquire_vnode and put_vnode.
* panic under KDEBUG if the node does not exist.

 * panic always if the node reference count was 0.
   We don't handle 0 -> 1 transitions here, and it doesn't make
   sense to acquire "another" reference to a node you
   haven't referenced.

Would have caught the ext2 use-after-free fixed in an earlier
commit.
2025-08-28 13:57:11 -04:00
Augustin Cavalier 4390b6b5c2 BFS: Don't try to acquire/put the indices node.
It's not published, so we will just get errors, or
(starting with the next commit) assertions.
2025-08-28 13:55:24 -04:00
Augustin Cavalier 0bb8848f51 freebsd_network: Use endpoint max packet size for USB xfer data length if unset.
This is what FreeBSD does. Needed for the upstream FreeBSD
version of the "pegasus" driver.
2025-08-28 13:44:30 -04:00
Augustin Cavalier dd90a96b5f freebsd_network: Fix assertion in usbd_xfer_set_frame_len.
Setting the length of a frame outside the current xfer frame count
(but less than the maximum count) is allowed on FreeBSD.

Fixes a KDL encountered with the FreeBSD version of the ASIX
USB ethernet driver.
2025-08-28 13:42:54 -04:00
Jérôme Duval 843f2bcce4 ext2: fix inode blocks count after enlarge or shrink
Change-Id: I6ac6253b761f25d567b969d8303fbf0858e47221
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9616
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-08-28 13:12:23 +00:00
Jérôme Duval 2df6cc0b3b ext2: don't put the root vnode in unmount hook
as the vfs already put all vnodes before calling unmount.
found with the guarded heap.

Change-Id: Ia8d9ea22db1eb4241efe470bea27a00a413bedb3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9615
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-08-28 13:12:23 +00:00
Jérôme Duval 795849800c ext2: remove orphan list support
it's too easy to get a broken orphan list.

Change-Id: Ib84e84bd685017cb7e1d1a3ae34f0fa6897aacec
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9614
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-08-28 13:12:23 +00:00
Augustin Cavalier a940b0fa8f XHCI: Submit physical transfers directly without a bounce buffer.
XHCI's DMA requirements are very relaxed, we can set TRB addresses
without having to align everything to page boundaries, it seems.
The only restriction is that some controllers may not support
64-bit DMA, but we only do 32-bit at present anyway, so just
reject transfers with non-32-bit addresses and add a constraint
in the USB disk driver.

Tested with QEMU, seems to be working.

Change-Id: I6a2b1689ce1a718aaba7622addbd8ab2fc57ca75
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9612
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-08-27 16:56:11 +00:00
Augustin Cavalier a317b36cfc usb_disk: Use IOSchedulerSimple.
Unlike NVMe, USB disks are often slow, so we want the benefits
of the real I/O scheduler and asynchronous operations.

The downside is that all USB requests will be submitted as
physical, rather than virtual as some are at present. This
means that in some cases the bouncing will cause double-copying
unnecessarily. (However, it should be possible to avoid that
in all cases for XHCI at least.)

Change-Id: I7d827da7b5769d4ba988ae6cb3964e6c2190e56a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9611
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-08-27 16:56:11 +00:00
Augustin Cavalier 505b9a5c31 usb_disk: Lock memory before acquiring device locks.
Otherwise, if we are locking memory that's mapped from this
same usb_disk device, we'll cause a double lock.

Should fix #19715. But really, we should probably be using
an IOScheduler here, so the next commit will implement that.

Change-Id: Icd62955338ef66444ec6a14e0310f60061456d8f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9610
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-08-27 16:56:11 +00:00
Augustin Cavalier fb6c279a24 kernel/x86: Use MWAITX or TPAUSE in arch_debug_snooze, if available.
These instructions are only available on more recent CPUs (MWAITX
on AMD since around 2015 or so, TPAUSE on Intel since around 2020.)
They allow idly waiting on the TSC even when interrupts are
disabled.

Most hypervisors do not have these available (KVM does provide
them, though not on all configurations), but on bare metal this
should make a nice difference to KDL power consumption: I tested
with a Ryzen 3700X, according to my UPS (so including monitor
and peripherals) the system used ~106 W at idle, 160 W in KDL
before this patch, and 125 W in KDL after it.

Change-Id: Id7a22ecd33f3fc005b2c312f945dc3cd364e96fa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9604
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-08-25 20:16:16 +00:00
Augustin Cavalier 2082e1b86e kernel/debug: Introduce arch_debug_snooze() and make use of it.
The idea is to add a facility that will use less CPU than
the loops we currently use. The default implementation just
calls spin(), which is rdtsc+pause. This already may save
some power compared to what we previously did, which was to
re-check serial ports, PS/2, etc. every single loop in
the debugger, broken up only by "pause".

Change-Id: Ie421adae5c25ad6ae0c266d1d28c2ea7b81ae465
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9603
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-08-25 20:16:16 +00:00
nipos 6de89c6cdf BMCMenuBar: Add hover effect, like on buttons
Fixes #19671

Change-Id: I2ef001666ac4fa88364c7c5d5c95b0d96d5a090a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9605
Reviewed-by: Stefano Ceccherini <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-08-25 14:33:15 +00:00
X512 03d4f24535 BPicture: fix clipping region storage
Part of #1133.

Change-Id: I0d727056dd7302f5a320987b83a27c9571e9684f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9609
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-08-25 14:32:39 +00:00
nipos 20e469a794 Icon-O-Matic: Disable "Remove" menu item when no transformer is selected
Fixes #19342

Change-Id: Iaaa5d84d76802d35cf9f30a5aa0a1ee749697e65
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9606
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Zardshard <[email protected]>
2025-08-25 14:31:11 +00:00
Augustin Cavalier 65daa8c146 kernel/x86: Clean up AMD C1E feature detection.
* If the CPUID bit is present, don't bother checking the models.
   (This will happen on hypervisors.)

 * Set the CPUID bit if we determine it's present.

 * Only do this on CPU 0.
2025-08-22 15:04:34 -04:00
Augustin Cavalier d3627801d7 kernel/x86: Avoid re-reading the APIC timer config unnecessarily. 2025-08-22 15:02:05 -04:00
Niklas Poslovski 8c6a5085ef MediaPlayer: Use B_PANEL_TEXT_COLOR for total duration in PlaylistWindow
Change-Id: Ie3d515d183b38f1da678f0c97879458dc1d770a6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9602
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-08-22 18:40:26 +00:00
Niklas Poslovski 6c038f9be8 cddb_lookup: Resolve DNS only if a network request is needed.
Fixes #19641

Change-Id: I82c61038d689466a0eadee4e66bcad9e6995d119
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9597
Reviewed-by: waddlesplash <[email protected]>
2025-08-22 13:57:10 +00:00
Niklas Poslovski 21ac4eb60f AboutSystem: Fix minimum width of SysInfoView
Fixes #19707

Change-Id: If536b85db4ab91d5f0f323e616c32fcdf799b7fa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9596
Reviewed-by: waddlesplash <[email protected]>
2025-08-18 18:14:26 +00:00
Autocomitter e631da8906 Update translations from Pootle 2025-08-16 08:11:50 +00:00
Augustin Cavalier 4df505d911 kernel/EntryCache: Use a hash table with atomics for insertions.
This massively cuts down on lock contention in Add(), since insertions
only acquire a write-lock in the case where a generation rolls over,
same as Lookup() does.

"git status" in buildtools, cold disk cache in a 4-core VM, seems about
the same, maybe slightly slower (~0.5s seemed typical, out of 20-21s),
while with a hot disk cache it's much faster: ~9.8s -> ~2.4s. Compile
performance seemed about the same.

Change-Id: Ia73f35fbbad3b3ac9ed783ea38cb8e2cb9818b5b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9580
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-08-14 00:40:41 +00:00
Sylvain78 bab2e8e624 RemoteDesktop: cursor on connection
Send current state of cursor at connection
Send cursor location at connection

No default cursor on remote side

Fixes #15903.

Change-Id: I0d8d7e1908b5c28e5401eaa80fd228f85120f8b4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9280
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Máximo Castañeda <[email protected]>
2025-08-11 18:31:35 +00:00
Peter van Dijk dc7e982148 intel_extreme: add support for 8086:5a85 Apollo Lake GT1 (Intel HD500)
plus PCH ID for brightness control

plus untested 5a84 entry

Change-Id: I2bc63390f932f52b47324be9e13366a26f8cec2b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9578
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2025-08-07 06:37:08 +00:00
John Scipione 82fb83956a BSlider: Set text to panel colors. Fixes #19700
Change-Id: If5b16052a093dbd19c0e85b53d604ed36903710e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9581
Reviewed-by: nephele nephele <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-08-06 22:13:18 +00:00
X512 ecc2dea520 TokenSpace: fix GCC 2 build
Change-Id: Iab645e1219cb3aeba21a01815fc0abc8c7b84b4e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9582
Reviewed-by: waddlesplash <[email protected]>
2025-08-06 16:52:33 +00:00
Augustin Cavalier a67167e336 BView: Perfom CheckLockAndSwitchCurrent before using fBounds. 2025-08-05 18:38:52 -04:00
Augustin Cavalier 1483db6e71 Revert "BColumnListView: Don't invalidate if the row is below the visible rect."
This reverts commit 07f87734c5.

Not needed after the previous commit.
2025-08-05 13:33:02 -04:00