Commit Graph

63757 Commits

Author SHA1 Message Date
Augustin Cavalier
25334001eb intel_extreme: Disable engine for SOC0 as it also locks up. 2022-03-30 18:11:41 -04:00
Augustin Cavalier
c25f6f53b5 kernel/vm: Completely replace mlock() implementation.
The old implementation used the real lock_memory(). This is problematic
and does not work for a large number of reasons:

1) Various parts of the kernel assume memory is locked only very
   temporarily, and will often wait on locked memory to become unlocked.
   The transient nature of locks is further demonstrated by the fact that
   lock_memory acquires references to structures, like the address space,
   which are only released by unlock_memory

2) The VM has a hard assumption that all lock_memory calls will be
   exactly balanced, and maintains internal "WiredRange" structures
   on areas, etc. corresponding to the original lock_memory calls.
   Maintaining separate data structures as this code did is a recipe
   for even more problems when the structures are manipulated separately,
   leading to confusing or incorrect behavior on unlocks.

3) Areas with locked memory cannot be deleted, nor can the pages which are
   locked be removed from the areas/caches. This of course is most notable
   when destroying teams which locked memory, but the problem also occurs
   when just using delete_area, resize_area, mmap/munmap, etc.

Because of (2) and especially (3), adding support for mlock()-like semantics
to the existing memory locking system is just not a good option. A further
reason is that our lock_memory is much stricter than mlock(), which only
demands the pages in question must remain resident in RAM and cannot be
swapped out (or, it seems, otherwise written back to disk.)

Thus, this commit completely removes the old implementation (which
was seriously broken and did not actually automatically unlock memory
on team exit or area destruction at all, etc.) and instead adds a new
feature to VMAnonymousCache to block certain pages from being written out.
The syscall then just invokes this to do its work.

Fixes #17674. Related to #13651.

Change-Id: Id2745c51796bcf9a74ba5325fe686a95623cd521
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5147
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-03-30 20:17:50 +00:00
Augustin Cavalier
88275138ba kernel/util: Implement more features in the Bitmap class.
* Resize(): adds more space to the end of the bitmap.
 * Shift(): moves all bits in the map up or down.
 * Use size_t instead of int for indexes.

Also add unit tests for the new functions (they seem to be passing.)

Reference material for shift implementation:
2c56d43c1e/bitops.h (L977)

Change-Id: Ia85768aaeed7bd3ffef3a9f575f05331e048fe50
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5146
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-03-30 20:17:50 +00:00
X512
9dacea2ee7 remove unused linker scripts
Change-Id: Ia65c23d44b5f7cbae87d9cfcab411aa02f6f1fd0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5167
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-03-30 20:06:38 +00:00
PulkoMandy
38a9416057 intel_extreme: use proper generation for Tiger Lake devices
The CPU in these is generation 11, but the graphics unit is actually
generation 12. Thanks to KapiX for pointing this out!
2022-03-30 21:16:17 +02:00
Augustin Cavalier
dcaf47fd7f cppunit: Enable CPPUNIT_HAVE_SSTREAM for the non-legacy GCC.
This fixes a ton of -Wdeprecateds in the unit tests.
2022-03-29 19:09:38 -04:00
Augustin Cavalier
830f67ef99 cppunit: Whitespace cleanup, no functional change. 2022-03-29 19:09:01 -04:00
Augustin Cavalier
c42ce973eb profile: Track unknown image hits in Inclusive mode.
Solves a TODO.
2022-03-29 17:25:16 -04:00
X512
52a7b62f61 runtime_loader: disable importing its own symbols
Now only image relative relocations are produced. runtime_loader do not use symbol
resolution for itself and programs can't link with it. Also it is loaded in
special way and do not register in image list available for symbol resolution.
So there are no meaning in self importing.

Change-Id: Iff3cb0ee5ef1dd307134d52c3c911759c59a9b5c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5153
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-03-29 20:40:18 +00:00
Andrew Lindesay
f6e2256327 HaikuDepot: Send Repository Code on API
Some APIs will require the repository source
code to be sent in the future instead of the
repository code.  This change prepares for
this.

Change-Id: Iccf0baca077ab81356ed81c18d14122a5b0dacec
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5137
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-03-29 15:44:52 +00:00
Lt-Henry
4e37ed5c0e usb_hid: digitizer usage constants from 1.3 specification
Change-Id: I25a8020e70fc432fd315f0be1092a3fe94e78a8f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5148
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-03-29 14:54:22 +00:00
David Karoly
c5d3ca339c runtime_loader: ignore PT_ARM_UNWIND sections
Change-Id: I966e366c73d495c3b3396f0dd4b44bafaf5c77c5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5136
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-03-29 07:10:41 +00:00
David Karoly
d232643ed8 boot/efi/arm: add debug logs for initial CPU state
Change-Id: I08df563ef6967f5f9734bbe11ac643c3b68f504f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5151
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-03-29 07:09:14 +00:00
David Karoly
7fdf6e8639 boot/efi/arm: switch serial output to legacy after exiting EFI boot servieces
Change-Id: If7ba007d24cc95ce0a43adc320932e3e1678c25b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5159
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-03-29 07:08:48 +00:00
David Karoly
a3ef09d41e boot/efi/arm: implement PL2 to PL1 transition
Change-Id: Ib30a943f68430ecbe33d8c7fe88c67267f9deff9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5150
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-03-29 07:08:24 +00:00
PulkoMandy
d039f12b31 intel_extreme: add PCI ID for Tiger Lake
Internal display on my laptop isn't detected yet so modesetting doesn't
work, but at least I get vblank interrupts and backlight control.

Fixes #17569

Change-Id: I86dd56bc3fc2c288688242e34d9220028036ab74
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5156
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-03-29 07:08:01 +00:00
Jérôme Duval
467b19de28 intel_extreme: setup Gen11 interrupts
added register names from i915 as that's what the register dump tool uses.

Change-Id: I4c4db881f55ffa820c0a6a058a533328a0b5d68f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5161
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-03-29 07:08:01 +00:00
Alexander von Gluck IV
7bbfd0ff49 3rdparty/docker/bootstrap: Cleanup, little modernization
Change-Id: Icc16b3fca48ffe072aed06c495d93fc3c74deead
2022-03-28 19:38:38 -05:00
Alexander von Gluck IV
52f7c93894 3rdparty/pulkomandy: Fix rm on unbootstrap script
Change-Id: I8c58195906e426971dc1ebd9ae2da23cfa6159c8
2022-03-28 19:38:38 -05:00
Jérôme Duval
a191388ea6 pci: add some pcie extensions labels
Change-Id: I938e2d47d60dc631b8b57d3afefcfb2a85374bad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5160
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-03-28 14:52:28 +00:00
X512
ebeab0cf70 rumtime_loader: fix TLS for riscv64
Change-Id: I55593dea936af31135b8e9159f8b6a64270369c0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5157
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-03-27 16:15:41 +00:00
PulkoMandy
fa288877c5 acpi_battery: accept revision 1 struct with only 20 items
The revision 1 structure should have 21 items, but on my laptop, it doesn't.
That's fine, we can parse it as if it was a revision 0 structure. This way I
can see the battery status on my machine.

Change-Id: I743173e05318d686049454983e378a08c0a1980a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5155
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-03-26 20:48:49 +00:00
PulkoMandy
7f5e1044ee pci_info: print 64bit BARs in a more readable way
Change-Id: Id3f42a6c93290ddb1825208bd11ca2c40b073914
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5154
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-03-26 20:48:49 +00:00
Jérôme Duval
e0102ba38b boot/x86: if __uint128 is available, use it
Change-Id: I2b01b8e205ffcfb9f3901715a7c8382a21d4f575
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5140
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-03-25 09:51:39 +00:00
Jérôme Duval
4df4b48fc6 configure & build: make use of 64-bit libgcc and libsupc++ for EFI/x86_64
Change-Id: I7636530d927843d155b9d7dada2db4f67c875290
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5139
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
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>
2022-03-25 09:51:39 +00:00
Augustin Cavalier
69b5103b54 kernel/vm: Add user address checks to mlock routines.
Also adjust general checks at the beginning. Patterned after
_user_set_memory_protection.
2022-03-24 12:56:31 -04:00
Augustin Cavalier
760270af02 kernel/vm: Use ObjectDelter and slight cleanup to the mlock() routines. 2022-03-24 12:03:25 -04:00
David Karoly
5ba6ef84ef boot/efi: use 8250 driver for bcm2835 mini-UART
Change-Id: I1f42447e537ea7522ac299f028d530beb5067350
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5142
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2022-03-24 13:24:55 +00:00
David Karoly
9d65dbf1cb boot/efi: rework address-cells and size-cells handling
see Devicetree Specification,
section 2.3.5 #address-cells and #size-cells

The #address-cells and #size-cells properties may be used in any
device node that has children in the devicetree hierarchy and
describes how child device nodes should be addressed.

The #address-cells and #size-cells properties are not inherited from
ancestors in the devicetree. They shall be explicitly defined.

If missing, a client program should assume a default value of 2
for #address-cells, and a value of 1 for #size-cells.

Change-Id: Iafed49358540f8ac7aa673c3dc0191c9b580250b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5144
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2022-03-24 13:24:22 +00:00
Augustin Cavalier
f5ea62c478 HaikuDepot: Fix another instance of std::remove. 2022-03-24 09:15:35 -04:00
Augustin Cavalier
79a174c793 HaikuDepot: Fix usage of std::remove.
That's right kids, std::remove doesn't (and can't) actually remove
things from containers! Instead you have to pass its results into
container::erase in order to do anything at all.

Fixes #17579, and in my testing at least, the strange crashes
and heap corruptions.
2022-03-23 16:21:17 -04:00
Augustin Cavalier
4329a83fe6 HaikuDepot: Inherit from BWindow last so it is destroyed before everything else.
This eliminates the need for the early deletion of certain controls.

Part of #17579.
2022-03-23 16:19:46 -04:00
Jérôme Duval
06c5115cf0 btrfs: check status before the flags
Flags() uses fItem.
should help with #14486

Change-Id: I2593280f92e9843a2d57d66bf9b793748fb14f3d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5141
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-03-23 15:52:34 +00:00
Jérôme Duval
69cab3d4f6 intel_extreme: remove gen8 interrupt handler on exit
should fix #17535

Change-Id: I09d62090c68bd50494ca168d92d3df7b0c6fd0b4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5138
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-03-23 09:29:07 +00:00
Augustin Cavalier
7a52ac780b ipro1000: Upgrade to FreeBSD 13.1.
Includes support for new I219 device families.

Taken from the 13.1 releng branch (currently on "beta 2" status.)
Tested in QEMU and VMware. The "e1000" device works OK in QEMU,
"e1000e" does not anymore, but reportedly the FreeBSD devs say
it does on bare metal, so this is probably a QEMU bug (it doesn't
seem to be a commonly used device.)
2022-03-22 15:36:40 -04:00
Augustin Cavalier
92030a4a60 Revert "vfs: functions to change a vnode busy status and ID"
This reverts commit 8497a2cc28.

The VFS layer is not at all ready for this. Many places in the
code implicitly assume ino_t values will never change. This
functionality is only necessary for live shrinking of partitions,
which is a feature niche enough we do not need to worry about
implementing it in the first round of resizing (if ever.)
2022-03-22 11:38:06 -04:00
urnenfeld
c1c3f9812b boot/efi/arm64: Rework exception level handling
* Deal additionally with EL1 context
* Reuse possible present TTBRx allocations
* Dump MMU & System Control Registers

Change-Id: If27531f3c9d3fa096da11e8a7d46dd7d82a90e33
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5108
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: David Karoly <karolyd577@gmail.com>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-03-21 20:06:59 +00:00
Augustin Cavalier
09ea42fa68 freebsd_network: Rearrange taskqueue_block functions and add NULL checks.
Should fix #17218.
2022-03-21 15:48:59 -04:00
Jérôme Duval
168f941be5 kernel/x86_64: align the stack before calling user_debug_pre_syscall
Fixes #17531

Change-Id: Ia406ca15438bb2b432e9ebbe9f6db074f973af95
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5113
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-03-21 19:24:20 +00:00
Adrien Destugues
f0a8e7e247 Tracker: don't call debugger if a file has an invalid resource
This is a bit excessive: a file with a B_MINI_ICON resource of the wrong
size should not result in crashing Tracker, the resource should simply
be ignored.

Fixes #17668.

Change-Id: I55a210eb829e568d254d8ab569720145c0ea5a09
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5115
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-03-20 12:28:15 +00:00
Augustin Cavalier
d5ff3cd050 kernel/system_info: Address review comments.
* Combine "i" and "firstCPU" iteration variables.
 * Use better variable names.

Change-Id: Ifc6fcaea6519dc4a791600f4a8bcdd38f02434f3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5111
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
2022-03-18 17:02:30 +00:00
Jérôme Duval
c0ab9f51b2 intel_extreme: handle generic DTD block found in the VBT
Change-Id: Id27180b3a33778d4da66ab45b330839ae90c6382
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5110
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2022-03-17 07:24:11 +00:00
Jérôme Duval
d5137e7776 intel_extreme: find VBT in OpRegion version 2.0 and from 2.1
we check the OpRegion version and use the rvda pointer when available.
from 2.1 the pointer is relative.

Change-Id: I64d8aea65368aa3c5597f63a2b96b6a430e04315
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5109
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-03-17 07:24:11 +00:00
Alexander von Gluck IV
8fed6717a7 mkdos: Drop from image. Use mkfs -t fat
Change-Id: If79f67126e23bea6c8dbb348f075832cd0bf8360
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5107
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-03-16 01:00:39 +00:00
Alexander von Gluck IV
d188fff30b kernel/fs/fat: Fix volume label of newly created filesystems
* solves #17659
* We assigned the volume label to the root, but not the boot
  sector (partition boot sector, not MBR)

Change-Id: I9c53204c18709c2d225cc8ea338290aa89d42083
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5106
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Reviewed-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-03-16 00:48:49 +00:00
Andrew Lindesay
f67e053883 HaikuDepot: Size Package Files
Obtain the size of local package files.

Fixes #17445

Change-Id: Ica15d3f7c1e80bcf9b3b23d6af851cc33b5b6253
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5016
Reviewed-by: Andrew Lindesay <apl@lindesay.co.nz>
2022-03-16 00:31:52 +00:00
Adrien Destugues
2d80f9e236 EFI: add support for dw-apb-uart used on Allwinner A10 SoC
Yet another 16550 clone under a different name. Why does device-tree
have a "compatible" setting if everyone puts a different name for the
same thing?

Change-Id: Ia889a527a36739df747ba48d4606c09764703607
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5103
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-03-15 18:26:18 +00:00
Adrien Destugues
ef41059432 EFI: get address-cells and size-cells from the device tree
They were hardcoded to 2, which is not correct on all devices. As a
result, getting addresses and sizes on pure 32bit devices would fail.

Change-Id: Icf542c9e8d6b7136219014fe08dd601387de4762
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5102
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-03-15 18:26:18 +00:00
Jérôme Duval
f37f79066c intel_extreme: add IDs for Jasper Lake
tested with Acer Swift SF114-34
2022-03-15 16:51:13 +01:00
Adrien Destugues
7b7cc2944b Allwinner A10 docs: fix broken link
Change-Id: I40d3bebd2f70def0a4074f2bec74c574f44d46cd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5101
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-03-14 21:35:41 +00:00