Commit graph

36830 commits

Author SHA1 Message Date
Andreas Kling 9765f9f67e Kernel: Fix accidental overlaps in RegionTree::allocate_range_specific()
Thanks to Idan for spotting this! :^)
2022-04-03 23:07:29 +02:00
Andreas Kling 36d829b97c Kernel: Mark sys$listen() as not needing the big lock
This syscall already performs the necessary locking and so doesn't
need to rely on the process big lock.
2022-04-03 22:22:22 +02:00
Andreas Kling e103c5fe2d Kernel: Don't hog file descriptor table lock in sys$bind()
We don't need to hold the lock across the entire syscall. Once we've
fetched the open file description we're interested in, we can let go.
2022-04-03 22:20:34 +02:00
Andreas Kling 85ceab1fec Kernel: Don't hog file descriptor table lock in sys$listen()
We don't need to hold the lock across the entire syscall. Once we've
fetched the open file description we're interested in, we can let go.
2022-04-03 22:18:57 +02:00
Andreas Kling bc4282c773 Kernel: Mark sys$sendfd() and sys$recvfd() as not needing the big lock
These syscalls already perform the necessary locking and don't rely on
the process big lock.
2022-04-03 22:06:03 +02:00
Andreas Kling 92dfcdb6b1 Kenrel: Update a dmesgln() to say "RegionTree" instead of old class name 2022-04-03 22:00:19 +02:00
Andreas Kling 9e1da1f4f5 Kernel: Add a little explainer comment above RegionTree 2022-04-03 21:59:48 +02:00
Andreas Kling 8b01789ec4 Kernel: Improve RegionTree's internal helper function names
It's a bit nicer if functions that allocate ranges have some kind of
name that includes both "allocate" and "range". :^)
2022-04-03 21:56:16 +02:00
Andreas Kling 32dea6bde5 Kernel: Add missing include to PageDirectory.h 2022-04-03 21:51:58 +02:00
Andreas Kling 858b196c59 Kernel: Unbreak ASLR in the new RegionTree world
Functions that allocate and/or place a Region now take a parameter
that tells it whether to randomize unspecified addresses.
2022-04-03 21:51:58 +02:00
Andreas Kling e89c9ed2ca Kernel: Stop exposing RegionTree API for VM range allocation
...and remove the last remaining client of the API. It's no longer
possible to ask the RegionTree for a VM range. You can only ask it to
place your Region somewhere in available space.
2022-04-03 21:51:58 +02:00
Andreas Kling 07f3d09c55 Kernel: Make VM allocation atomic for userspace regions
This patch move AddressSpace (the per-process memory manager) to using
the new atomic "place" APIs in RegionTree as well, just like we did for
MemoryManager in the previous commit.

This required updating quite a few places where VM allocation and
actually committing a Region object to the AddressSpace were separated
by other code.

All you have to do now is call into AddressSpace once and it'll take
care of everything for you.
2022-04-03 21:51:58 +02:00
Andreas Kling e852a69a06 LibWeb: Make VM allocation atomic for kernel regions
Instead of first allocating the VM range, and then inserting a region
with that range into the MM region tree, we now do both things in a
single atomic operation:

    - RegionTree::place_anywhere(Region&, size, alignment)
    - RegionTree::place_specifically(Region&, address, size)

To reduce the number of things we do while locking the region tree,
we also require callers to provide a constructed Region object.
2022-04-03 21:51:58 +02:00
Andreas Kling cbf52d474c Kernel: Remove now-unused VirtualRangeAllocator
This has been replaced with the allocation-free RegionTree. :^)
2022-04-03 21:51:58 +02:00
Andreas Kling e8f543c390 Kernel: Use intrusive RegionTree solution for kernel regions as well
This patch ports MemoryManager to RegionTree as well. The biggest
difference between this and the userspace code is that kernel regions
are owned by extant OwnPtr<Region> objects spread around the kernel,
while userspace regions are owned by the AddressSpace itself.

For kernelspace, there are a couple of situations where we need to make
large VM reservations that never get backed by regular VMObjects
(for example the kernel image reservation, or the big kmalloc range.)
Since we can't make a VM reservation without a Region object anymore,
this patch adds a way to create unbacked Region objects that can be
used for this exact purpose. They have no internal VMObject.)
2022-04-03 21:51:58 +02:00
Andreas Kling ffe2e77eba Kernel: Add Memory::RegionTree to share code between AddressSpace and MM
RegionTree holds an IntrusiveRedBlackTree of Region objects and vends a
set of APIs for allocating memory ranges.

It's used by AddressSpace at the moment, and will be used by MM soon.
2022-04-03 21:51:58 +02:00
Andreas Kling 02a95a196f Kernel: Use AddressSpace region tree for range allocation
This patch stops using VirtualRangeAllocator in AddressSpace and instead
looks for holes in the region tree when allocating VM space.

There are many benefits:

- VirtualRangeAllocator is non-intrusive and would call kmalloc/kfree
  when used. This new solution is allocation-free. This was a source
  of unpleasant MM/kmalloc deadlocks.

- We consolidate authority on what the address space looks like in a
  single place. Previously, we had both the range allocator *and* the
  region tree both being used to determine if an address was valid.
  Now there is only the region tree.

- Deallocation of VM when splitting regions is no longer complicated,
  as we don't need to keep two separate trees in sync.
2022-04-03 21:51:58 +02:00
Andreas Kling 90a7b9e5b4 Tests: Make TestEFault not rely on automatic guard pages
I'm about to break automatic guard page allocation in sys$mmap(), so we
need to fix this test to not rely on it.
2022-04-03 21:51:58 +02:00
Andreas Kling 2d3fb6ac39 Tests: Clear errno before syscalls in TestEFault
This makes the debug output a little more helpful.
2022-04-03 21:51:58 +02:00
Andreas Kling df64b85925 Tests: Remove unused macro in TestEFault 2022-04-03 21:51:58 +02:00
Andreas Kling 2617adac52 Kernel: Store AddressSpace memory regions in an IntrusiveRedBlackTree
This means we never need to allocate when inserting/removing regions
from the address space.
2022-04-03 21:51:58 +02:00
Enver Balalic 7381474835 LibWeb: Don't break text lines if white-space: nowrap
If white-space is nowrap then we don't want to break a text_node
into multiple line boxes. This fixes the width calculation in the
min-content case for white-space: nowrap elements. Before this
the min-width would be the width of the biggest line box.
2022-04-03 21:51:15 +02:00
Nico Weber fd82121319 Tests: Add some test coverage for the TTF parser
This is in Tests/LibTTF instead of Tests/LibGfx because Tests/LibGfx
depends on serenity's file system layout and can't run in lagom,
but this new test runs just fine in lagom.
2022-04-03 19:16:03 +02:00
Nico Weber 9b24600779 Meta: Give Lagom build errors colored diagnostics
Non-lagom builds get this from the root CMakeLists.txt file,
but lagom builds didn't before this change.
2022-04-03 19:16:03 +02:00
Tim Schumacher de7aa80669 Ports: Add GNU core utilities 2022-04-03 19:15:14 +02:00
Tim Schumacher 4ba39c8d63 Kernel: Implement f_basetype in statvfs 2022-04-03 19:15:14 +02:00
Tim Schumacher 8209c2b570 AK: Add StringView::copy_characters_to_buffer() 2022-04-03 19:15:14 +02:00
Tim Schumacher 3237efc661 LibC: Implement __fseterr 2022-04-03 19:15:14 +02:00
Tim Schumacher 4f706d819a LibC: Implement __freadptrinc 2022-04-03 19:15:14 +02:00
Tim Schumacher 89ed0649f7 LibC: Implement __freadahead 2022-04-03 19:15:14 +02:00
Tim Schumacher 9b543ddb16 LibC: Implement __freadptr 2022-04-03 19:15:14 +02:00
kleines Filmröllchen 8da0cf7912 Applets: Add a network graph applet
This resource graph applet shows incoming network traffic graphically,
and the tooltip shows both TX and RX. The data of all adapters is
combined. The scale of the applet auto-adapts to the shown traffic load.

Co-authored-by: bgianfo <bgianf@serenityos.org>
2022-04-03 09:49:08 -07:00
kleines Filmröllchen 7a0cd6793e AK: Add non-const iterator for CircularQueue 2022-04-03 09:49:08 -07:00
Lenny Maiorani 9afc7d5379 LibCompress: Change DeflateSpecialCodeLengths to constexpr variables 2022-04-03 17:36:48 +01:00
Lenny Maiorani 35af46ee62 LibChess: Change UCI::Command::Type to enum class 2022-04-03 17:36:48 +01:00
Ali Chraghi 0eaed09517 TextEditor: Update file argument parser regex pattern 2022-04-03 18:54:47 +04:30
Linus Groh 5b48912d35 LibJS: Remove a bunch of gratuitous JS namespace qualifiers 2022-04-03 15:19:33 +01:00
Valtteri Koskivuori f2c02077ba Userland: Remove a few gratuitous IPC namespace qualifiers
Spotted this while trying to search for specific IPC encode/decode
implementations. Now they are all the same, so searching is easier.
2022-04-03 15:18:20 +01:00
Hunter Kvalevog 85ed64b99c Ports: Enable libx264 support in FFmpeg 2022-04-03 14:45:13 +01:00
Hunter Kvalevog a0bbadac14 Ports: Add x264 2022-04-03 14:45:13 +01:00
Jelle Raaijmakers 9ca15793e7 Meta: Move screenshots into subdir
It's a bit neater to give them their own directory instead of jamming
them in between our shell scripts :^)
2022-04-03 13:14:15 +01:00
Valtteri Koskivuori 45a81f5a2c Browser+LibWeb+WebContent: Add ability to inspect local storage
The storage inspector now has a new tab for local storage. The next step
would be to persist local storage and receive real-time notifications
for changes to update the table view.
2022-04-03 13:13:10 +01:00
Valtteri Koskivuori f2b4c044db LibIPC: Add encoder and decoder for AK::OrderedHashMap
Seems like a useful thing to have.
2022-04-03 13:13:10 +01:00
djwisdom a8a50a994b Base: Update font Ataraxia with additional glyphs
Latin Extended-A
 0132,0152,0153
 https://www.unicode.org/charts/PDF/U0100.pdf

LISU Supplement
 11FB0
 https://www.unicode.org/charts/PDF/U11FB0.pdf

Egyptian Hieroglyph Format Controls
 13430-13438
 https://www.unicode.org/charts/PDF/U13430.pdf

Ideographic Symbols and Punctuation
 16FE0-16FE4,16FF0,16FF1
 https://www.unicode.org/charts/PDF/U16FE0.pdf
2022-04-03 12:39:59 +01:00
djwisdom 0d8542536e Base: Update font Satori Regular with additional glyphs
Latin Extended-A
 0132,0152,0153
 https://www.unicode.org/charts/PDF/U0100.pdf

LISU Supplement
 11FB0
 https://www.unicode.org/charts/PDF/U11FB0.pdf

Egyptian Hieroglyph Format Controls
 13430-13438
 https://www.unicode.org/charts/PDF/U13430.pdf

Ideographic Symbols and Punctuation
 16FE0-16FE4,16FF0,16FF1
 https://www.unicode.org/charts/PDF/U16FE0.pdf
2022-04-03 12:39:42 +01:00
djwisdom 6f9ce7bc96 Base: Update font Satori Mono Regular with additional glyphs
Latin Extended-A
 0132,0152,0153
 https://www.unicode.org/charts/PDF/U0100.pdf

LISU Supplement
 11FB0
 https://www.unicode.org/charts/PDF/U11FB0.pdf

Egyptian Hieroglyph Format Controls
 13430-13438
 https://www.unicode.org/charts/PDF/U13430.pdf

Ideographic Symbols and Punctuation
 16FE0-16FE4,16FF0,16FF1
 https://www.unicode.org/charts/PDF/U16FE0.pdf
2022-04-03 12:39:42 +01:00
djwisdom 14349a40d5 Base: Update font Satori Mono Bold with additional glyphs
Latin Extended-A
 0132,0152,0153
 https://www.unicode.org/charts/PDF/U0100.pdf

LISU Supplement
 11FB0
 https://www.unicode.org/charts/PDF/U11FB0.pdf

Egyptian Hieroglyph Format Controls
 13430-13438
 https://www.unicode.org/charts/PDF/U13430.pdf

Ideographic Symbols and Punctuation
 16FE0-16FE4,16FF0,16FF1
 https://www.unicode.org/charts/PDF/U16FE0.pdf
2022-04-03 12:39:42 +01:00
djwisdom 5046f72ad1 Base: Update Satori Bold with additional glyphs
Latin Extended-A
 0132,0152,0153
 https://www.unicode.org/charts/PDF/U0100.pdf

LISU Supplement
 11FB0
 https://www.unicode.org/charts/PDF/U11FB0.pdf

Egyptian Hieroglyph Format Controls
 13430-13438
 https://www.unicode.org/charts/PDF/U13430.pdf

Ideographic Symbols and Punctuation
 16FE0-16FE4,16FF0,16FF1
 https://www.unicode.org/charts/PDF/U16FE0.pdf
2022-04-03 12:39:42 +01:00
Jelle Raaijmakers 31b72c20f0 Meta: Check port property for ports in the linter
We now make sure the directory name and `port` property are identical.
2022-04-03 12:35:14 +01:00
Jelle Raaijmakers d53c602e11 Ports: Set port to match the port's directory
We currently have no valid use case for having a `port` property
different from the directory name the port's residing in. We do have
issues when this is the case when referencing dependencies, so let's
make sure all ports have a sensible `port` property to begin with.
2022-04-03 12:35:14 +01:00