Commit Graph

67288 Commits

Author SHA1 Message Date
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
Augustin Cavalier
b11cc78c16 kernel/vm: Add some more AssertLocked()s in VMCache commitment methods.
And remove a now-redundant one.
2024-10-02 16:08:41 -04:00
Augustin Cavalier
a0fd8467d9 kernel/vm: Add assertion for a TODO in SetMinimalCommitment. 2024-10-02 16:08:04 -04:00
Augustin Cavalier
0a4a06eee3 kernel/vm: Change cache commitment at end of Resize().
If we change it at the top, then we shrink the commitment before
we actually have released the relevant pages.
2024-10-02 15:57:42 -04:00
Augustin Cavalier
7f6fe7b354 kernel/cache: Add VMVnodeCache::Commit().
Does nothing, as Vnode (file) caches don't need to commit memory
at present.
2024-10-02 15:41:10 -04:00
Augustin Cavalier
f940c524eb ramfs: Add missing lock of VMCache in DataContainer. 2024-10-02 15:40:42 -04:00
Augustin Cavalier
c2aac52c17 packagefs: Just set cache->virtual_end rather than using Resize().
Resize() has extra logic to deal with shrinking the cache and
adding commitments, neither of which we need here.
2024-10-02 15:40:32 -04:00
Augustin Cavalier
502591624e kernel/vm: Don't commit memory for null and physical map areas.
The implementation does nothing at present besides change the
committed_size value of the cache, and in future commits will ASSERT.
2024-10-02 15:39:40 -04:00
Augustin Cavalier
4b15d71999 BMessage: Clean up properly when reading the stream fails.
Otherwise we leave things in an inconsistent state and could
wind up crashing later.

Fixes #18088.
2024-10-02 14:23:41 -04:00
Augustin Cavalier
69899fa72e kernel/vm: Truncate swap files when disabling or starting with swap disabled.
Fixes #4843.
2024-10-02 13:28:16 -04:00
Niklas Poslovski
7d539b9c63 Terminal: Don't change view size when changing font size in full screen
Fixes #17368

Change-Id: Ib7aa3c0ef4445abc8729e697d5d7e5714e9e44f2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8386
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-02 15:19:52 +00:00
Augustin Cavalier
12f69070c6 broadcom570x: Actually use MSIs.
We don't need to enable or disable interrupts when using them,
which should fix the TODO that lead to them being disabled always.
2024-10-02 11:09:44 -04:00
Owen Anderson
6bcb56f62d arm64: Implement icache synchronization to match documentation.
* Derived from the implementation of __clear_cache in compiler-rt

Change-Id: I6de588b3645997ecceab4590287ca5d816c4073e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8433
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-02 14:56:38 +00:00
Augustin Cavalier
95d8739f18 kernel/x86: Allow overlapping of memory types with physical memory ranges in MTRRs.
Otherwise, all RAM that has a more specific type than the physical range
will hit the assertion below. We also don't want to return the type
set here, so put this check before the effectiveType check.

Change-Id: I703242221771732c69accce66380b5a0efdc77e3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8345
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-01 20:54:08 +00:00
Niklas Poslovski
4e9899d5a6 FontDemo: Fix selecting a font family directly, without selecting a specific style
Fixes #18448

Change-Id: Ia32254721696c691b2c49cede70c2818b6668b2f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8382
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-01 16:28:07 +00:00
Niklas Poslovski
c858eda663 libshared/CalendarView: Vertically center date texts
Fixes #18288

Change-Id: Ifd99573bb30c5690ffbe809dfb3cf933220fd7f0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8383
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-01 16:24:33 +00:00
Niklas Poslovski
ab6c30cf9f Icon-O-Matic: Open 'Save as'/'Export as' dialog in the folder of the current file
Fixes #2750

Change-Id: Ib23695b168ef905d097bf259d26998181415640d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8381
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Zardshard <0azrune6@zard.anonaddy.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-10-01 16:22:27 +00:00
Máximo Castañeda
6894c8a7f7 app_server: don't minimize on single click on resize corner
hrev55002 unintentionally turned a single click in the resize corner of
a window into a minimize command. Change that back and minimize only on
double-click, like with the tab and other border parts.

Fixes: #19137
Change-Id: Ic9c76c809531d718fac911eaf668770edc3e5b89
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8427
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-09-30 19:55:33 +00:00
John Scipione
2a9f66d232 Tracker: Do not prompt user if drag from query
Fixes #9971

Change-Id: I6a4fe23d847ef36de4e1afe04eac0ccb185ba886
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8375
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-09-30 15:59:59 +00:00
Jérôme Duval
039f93ce5e ActivityMonitor: restores default position when it starts out of screen
Change-Id: Ied6339a900f3314be39a7ec1a4b9906d20c529e7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8373
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2024-09-30 15:57:23 +00:00
Jérôme Duval
ad747ccb1c virtio_pci: Fix index out of bounds
* Update size of registersArea[] to fix index out of bounds
in init_bus() and uninit_bus() caused by mismatching
between sizeof(registersArea[]) and loop counters.
Pointed out by cppcheck.
* actually use index to populate registers and registersArea arrays.

Change-Id: Iec6337c7dd475bb86f94fe8f2a7b8fed9776ee28
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8376
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>
2024-09-30 15:57:23 +00:00
Máximo Castañeda
cbc8ea5218 input_server: don't lock device list for mouse settings
Instead of traversing the list of input devices when we are not given a
mouse name, update a list of currently running ones on device start and
stop. This makes the input_server message loop independent of other
threads holding the device list lock.

Fixes: #19100
Change-Id: I2d0d55da04fa506bef88bf731e1a719a64958a17
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8359
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-30 15:54:20 +00:00
Jim906
b14c5d98b2 FAT: prevent sector count overflow
* Don't let users format a volume with more sectors than can fit in
  the 32 bits that the FAT spec provides for storing the sector count on
  disk. Since dosfs_initialize() assumes 512-byte sectors, this
  will truncate FAT volumes at ~2.2 TB when a user tries for format
  a partition larger than that.
* Mount read-only if the sector count read from disk is lower than it
  should be.
* Account for an unrelated overflow in struct device_geometry that
  could theoretically occur when mounting a large FAT image file.
* Set the struct mount read-only flag earlier during mounting, to
  avoid a fillinusemap error when changing to read-only inside
  fat_volume_init.
* Addresses #19079.

Change-Id: I3d15940dc18f50e5c8562fefee3b1749c4b93b6f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8426
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-30 15:52:06 +00:00
Owen Anderson
c062bccf52 arm64: Make more consistent use of is_pte_accessed
Change-Id: Ic86dc2fd6471cf25e64966515866fcc143f8d908
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8425
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>
2024-09-30 15:48:51 +00:00
Owen Anderson
4ac9940c6f arm64: ASID 0 is no longer reserved for the kernel.
Change-Id: I52dcc424c0e2f8cf1c9cfb5ada9e99df2b506057
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8424
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-09-30 15:48:51 +00:00
Owen Anderson
58cef789de arm64: Fix handling of UXN bit in VMSAv8TranslationMap::Query
* A clear UXN bit only implies B_EXECUTE_AREA if the page was also
  user-readable.

Change-Id: I01203b6539cc60550a5825c663af5d8cfe57f751
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8423
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-30 15:48:51 +00:00
Owen Anderson
f2e8f48cc3 arm64: Clean up VMSAv8TranslationMap::ClearFlags
* Save a TLB flush on the case where we only clear the accessed flag.

Change-Id: Icd9210d616a2eca13a9be9497f2a787ab0eaf266
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8422
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-30 15:48:51 +00:00
Owen Anderson
1c408b7298 arm64: Cleanup VMSAv8TranslationMap::FreeTable
Change-Id: Ib2cb0f728e4ca4b69096b21ae336d43c621a71e7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8421
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-30 15:48:51 +00:00
Owen Anderson
df59dfec3b arm64: Set MMU granule sizes to a consistent value in bootloader.
Change-Id: Ia36885df6dec5ac0ac9ce41271115aa7a8c3e6df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8418
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-30 15:48:51 +00:00
Owen Anderson
d2397007a1 arm64: Fix a range overrun in ProcessRange
* Make the recursion logic in much more explicit
* Resolves a rare assertion failure in Protect()

Change-Id: I9d93293836251e158ea226792852a63f6d91f3ab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8366
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-30 15:48:51 +00:00
Owen Anderson
1fa60a5cda arm64: Fix TLB flushing in interrupts to handle kernel vs user space
Change-Id: Id19236345cf05284c8c5f02360a4a2b3f22fd16d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8365
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-30 15:48:51 +00:00
Michael Lotz
556aca31e9 x86: Disable PAT for CPUs where it is broken.
All Pentium II and IIIs as well as some Pentium 4 models have an errata
saying that PAT is broken for the upper four entries at least in some
circumstances. As the upper entries are used for write-combining in our
PAT setup, avoid using PAT on such CPU models.

Change-Id: Iaf85eda06b656dc42f94257fc24802fc5d4bab14
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8419
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-09-29 08:00:16 +00:00
Autocomitter
bd0df5737a Update translations from Pootle 2024-09-28 08:06:26 +00:00
Autocommitter
622b14a4aa Catalogs: save the latest state of the r1beta5 branch 2024-09-28 08:06:26 +00:00
Alexander von Gluck
909ef790b1 system/kernel: add missing posix_memalign, fixes guarded_heap
Change-Id: Id035aa607a5a2a8545a85416d97cdd4a1b069203
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8369
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-26 00:19:13 +00:00
Alexander von Gluck
7b1d348567
3rdparty/cloud: A few small fixes to sysprep-gcp
Change-Id: I001d824f65cf135507aac65acc586de5be7ad386
2024-09-25 16:54:00 -05:00
Augustin Cavalier
5ea41d287c kernel/vm: Check the page's cache in the "supposed to be free page" panic.
Change-Id: I8db000723f67023c845b79721385a9e1ebc6cef7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8368
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-25 21:18:51 +00:00
Augustin Cavalier
b665a3ab2a kernel/vm: Use DebugGetReverseMappingInfo() in dump_page_long.
Iterating over every single page in a 64-bit address space is far
too expensive. Instead, use DebugGetReverseMappingInfo(), which
iterates over the page translation map's page tables.

(The only thing that implements this at present, however, is
X86VMTranslationMapPAE, so it won't be too useful on 64-bit
just yet. But at least we won't hang for very long periods
of time on 64-bit at least.)
2024-09-25 11:49:53 -04:00
Augustin Cavalier
718918a70a kernel/vm: Dump page information with the "supposed to be free page" panic.
May help with diagnosing #19126.
2024-09-25 11:46:05 -04:00
Jim906
7bb3369978 FAT: allow RW access to volumes up to 2 TB
* Fix an instance of storing block number in a signed 32-bit variable,
  which could overflow on volumes > 1 TiB.
* See discussion in #11119.

Change-Id: I138b56613775c364b259e3a0e68ba8bfe9a7f904
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8362
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-09-25 13:58:40 +00:00
Alexander von Gluck
9a6a20d468
3rdparty/cloud: Update instructions for gcp
* Unfortunately, functionality of Haiku r1beta5 under
  gcp is blocked by #18962 (virtio_scsi not getting irqs
  with our now guarded heap)

Change-Id: Ibf70419762e9a222bcb86b7418282cc409e17986
2024-09-24 16:07:58 -05:00
Augustin Cavalier
d0ff5bacff ArchitectureRules: Reinstate the -fno-builtin-fork for 32-bit x86 only. 2024-09-24 14:47:27 -04:00