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.)
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]>
* 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]>
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".
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.
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.
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.
* 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.
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.
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]>
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]>
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]>
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]>
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]>
* 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.
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]>
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]>