Commit Graph

63541 Commits

Author SHA1 Message Date
Rudolf Cornelissen
7a52a73261 intel_extreme: added IDs for ASUS laptop in ticket #16825 2021-11-30 22:25:03 +00:00
Jérôme Duval
3fedf64872 intel_extreme: enable KabyLake
Change-Id: I81d04fdf8305efcc9250cfb975dd3466ebcb4058
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4740
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-11-30 08:06:56 +00:00
Kacper Kasper
66aae93087 intel_extreme: enable CoffeeLake
Change-Id: Id73c88d0815259fa7a8027f757ac430818492b1e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4739
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-11-30 08:06:56 +00:00
Augustin Cavalier
02077ffc42 kernel/condition_variable: Atomicize ConditionVariableEntry and drop the lock.
Before 2019, the entire ConditionVariable system was "giant"-locked:
that is, there was a single global lock that all ConditionVariable
and ConditionVariableEntry operations had to pass through. This of
course was not very performant on multicore systems and when
ConditionVariables see significant use, so I reworked it then to have
more granular locking.

Those patches took a number of attempts to get right, as having two
objects in separate threads that can each access the other not turn
into a deadlock or use-after-free is not easy to say the least,
and the ultimate solution I came up with erased most of the performance
gains I initially saw on the first (partially broken) patchsets.

So I have wanted to revisit this and see if there was a better way
even since then. Recently there have been a few reports of
ConditionVariable-related panics (apparently double unlocks),
notably #16894, and so that was reason enough to actually revisit
this code and see if a better solution could be found.

Well, I think I have come up with one: after this commit, Entries
no longer have their own lock, and instead accesses to Entry members
are almost always atomic; and there is now a case where we spin inside
Variable::_NotifyLocked as well as one in Entry::_RemoveFromVariable.

This leads to somewhat simpler code (no more lock/unlock dance in Notify),
though it is significantly more difficult to understand the nuances of it,
so I have left a sizable number of comments explaining the intricacies
of the new logic.

Note: I initially tried 1000 for "tries", but on a few instances I did see
the panic hit, strangely. I don't think the code that is waited on can
be reasonably reduced any further, so I have just increased the limit to
10000 (which is still well below what spinlocks use.) Hopefully this suffices.

Quick benchmark, x86, compiling HaikuDepot and the mime_db in VMware, 2 cores:
before:
real    0m23.627s
user    0m25.152s
sys     0m7.319s

after:
real    0m23.962s
user    0m25.229s
sys     0m7.330s

Though I occasionally I saw sys times as low as 7.171s, so this seems
to be at least not a regression if not a definitive improvement.

Change-Id: Id042947976885cd5c1433cc4290bdf41b01ed10e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4727
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-11-30 02:18:27 +00:00
Kacper Kasper
7a855aa5c7 intel_extreme: fix overflow in SKL PLL calculation
* RGB 4K@60Hz clock is 594MHz, that multiplied by 5 overflows int value.

Change-Id: Idda04119d582fa4e30c7729296ad5959b29dba77
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4738
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Rudolf Cornelissen <rudhaiku@gmail.com>
2021-11-29 18:14:21 +00:00
Kacper Kasper
fe9ab0f353 intel_gart: add support for Gen8+ GPUs
Change-Id: I8b84e278f33542c359fc0d783f571e06ebc89b2a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4737
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Rudolf Cornelissen <rudhaiku@gmail.com>
2021-11-29 18:14:21 +00:00
Rudolf Cornelissen
c199501e81 intel_extreme: add laptop panel detection and mode scaling for DDI systems 2021-11-29 13:30:27 +00:00
Rudolf Cornelissen
6ed123e532 intel_extreme: always assume panel on eDP on laptops. 2021-11-27 18:15:07 +00:00
Rudolf Cornelissen
03ed104900 intel_extreme: enabled all known skylake gfx cards since they are pgm'd now 2021-11-26 23:52:15 +00:00
Rudolf Cornelissen
39e05c7d01 intel_extreme: skylake PLL works, all outputs fully functional. 2021-11-25 22:41:48 +00:00
Murai Takashi
4500c381d2 drivers/graphics/framebuffer: fix include guard
Pointed out by LGTM (Duplicate include guard).

Change-Id: Idc0e0cd48f85d4635f87355f36eb03932aa36d2e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4736
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-11-25 12:20:29 +00:00
David Karoly
493b3fc409 bus_managers/fdt: check for NULL
Change-Id: Ib33b2591c2966a266e0813e042d388dbe88ef939
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4700
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-11-24 13:39:23 +00:00
David Karoly
191fa37376 kernel/uart: fix GetChar for PL011
Check RX buffer status when GetChar is called in no-wait mode.
This fixes an 'infinite keypress' issue that used to occur
after 16 keypresses.

Change-Id: I47762de387b07c4fed46cc192cd3b81fdabfb270
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4732
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-11-24 13:38:14 +00:00
Augustin Cavalier
750ed8dd41 nvme_disk: Implement TRIM.
Only lightly tested (in QEMU with qcow2 images: it seems to work
and not to discard actual data.) Use with caution!
2021-11-23 17:57:37 -05:00
Augustin Cavalier
ab2a1b20e3 nvme_disk: Add a missing CALLED() and another assert. 2021-11-23 17:57:36 -05:00
Augustin Cavalier
3ff0d7a882 libroot: Compile x86_64's arch_string with -fno-builtin.
Otherwise, GCC and Clang create infinite recursions.
Fixes #15827.
2021-11-23 16:36:48 -05:00
Augustin Cavalier
2532a28785 Avoid using unions for LongDirEntry.
GCC still assumes that the dirent has no data past the end for some
scenarios here and still mis-optimizes things. Therefore, drop the
usages of unions altogether, and instead use a casted character array.

Additionally, use B_FILE_NAME_LENGTH for the array, not B_PATH_NAME_LENGTH,
and make sure to add 1 for the NULL terminator.
2021-11-23 16:36:18 -05:00
Augustin Cavalier
8be37ed439 kernel/smp: Avoid casting spinlocks, which are structures.
The lock entry is the first thing in the struct, so this is a no-op
change, but it is safer to do in case of changes, of course.

Spinlocks have been structures for quite a long time, so this was
probably just missed in the conversion.
2021-11-23 13:52:44 -05:00
Augustin Cavalier
ba3ee26af0 WindowInfo: Use char[0] for FLA instead of char[1].
This is a private structure, so despite being an ABI break,
it should not cause any problems.
2021-11-23 13:50:45 -05:00
Augustin Cavalier
3d34a937af Package Kit: Build FetchUtils outside HAIKU_TARGET_PLATFORM_HAIKU. 2021-11-23 13:49:14 -05:00
Augustin Cavalier
1998232e12 libpackage_build: Add FetchUtils.
Change-Id: I2394d35c520c6cdde6e7cb09039d0d8f5689f19f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4731
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-11-23 18:41:20 +00:00
Augustin Cavalier
2be10edfb9 Package Kit: Improvements to partial download handling.
* Move IsDownloadComplete call into DownloadFileRequest; this way
   we will always revalidate checksums even if the file is fully
   downloaded instead of skipping that.

 * Treat ERANGE as a "bad data" error in PackageManager (it usually means
   we have a size mismatch between the local and the server's file)

 * If we fail checksum validation or get ERANGE, and we reused a download,
   immediately try again without reusing the download. This fixes most
   problems that previously required you to delete old transaction
   directories.

Change-Id: Ia3079655691b871e0b206e366b59fca0f832c63d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4730
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-11-23 18:32:28 +00:00
Augustin Cavalier
001e157a7b libroot_build: Add better error checking to _kern_dup.
This way, we will get a more coherent crash instead of
an unceremonious one. Follow-up to #17389.

Change-Id: Iffbf421ce85d638628243d5785ba61ff6b9a8043
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4729
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-11-23 17:24:46 +00:00
Augustin Cavalier
23888052c9 ntfs: Fix off-by-one error in d_name copy.
Should fix incorrect directory contents after the dirent refactor.

Change-Id: Ic2b5024b62c9d9f9485c4695b59d0e971109f09d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4728
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-11-22 21:13:36 +00:00
Rudolf Cornelissen
e8e267b4c1 intel_extreme: fix 64-bit build, use 2021-11-22 12:56:07 +00:00
Rudolf Cornelissen
efde34c2fc intel_extreme: add haswell/skylake PLL calcs, no functional change yet. 2021-11-22 11:14:36 +00:00
Jérôme Duval
4106e3f146 kernel/x86: rework get_frequency_for
we don't sample if the last sample is too recent and use the cached result.

Change-Id: I17ed29bda7fe7276f1a4148b3e1985c9d32ae032
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4101
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-11-22 07:21:04 +00:00
Jérôme Duval
7c2c355f17 kernel: add frequency in cpu_info
use this in sysinfo.

Change-Id: I270ef1ab18c27c4804cb0cca2cb5088a17162636
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3214
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-11-22 07:20:25 +00:00
David Karoly
f265ecf8f7 Update gcc_bootstrap package for ARM
Change-Id: Iadef37c218f46b1f809a7c6405ebfc6a73cda20b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4726
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-11-20 12:59:28 +00:00
Rudolf Cornelissen
18bb9a28a6 intel_extreme: testing skylake mobile ticket #15516 2021-11-20 14:31:07 +00:00
Augustin Cavalier
10e35b7aae RTFTranslator: Free run_array using FreeRunArray.
This is more correct.
2021-11-19 19:38:11 -05:00
Augustin Cavalier
1cb5cfb244 libroot_build: Use a union for dirent structures.
Same fixe as applied to the rest of the Storage Kit a few commits ago.
2021-11-18 16:43:57 -05:00
Augustin Cavalier
d9df256704 FUSEVolume: Add a ROUNDUP() macro and use it.
No functional change intended, but this should make the code
easier to read.
2021-11-18 16:35:31 -05:00
Augustin Cavalier
afcfd3c5d5 BeBuild: Remove B_ALWAYS_INLINE.
This file should ideally contain only those things needed
across all system headers, even POSIX ones, and all other
declarations (B_* ones especially) should go in SupportDefs.h.
However, as nothing but riscv64 uses this right now, I've just
moved it to there.
2021-11-18 16:35:05 -05:00
Augustin Cavalier
7db2616c44 dirent: Use an actual flexible-length array for d_name.
GCC 11 treats [1] as a fixed-length array and not a flexible-length
array, and so some things that used direct strcmp("..", ent->d_name),
for instance, would be optimized out as being always unequal,
which was the cause of #17389. Using a real FLA informs GCC that
there is going to be more than one byte of data, and thus this
fixes that bug.

BeOS used [1] and not [0], possibly because it had to deal with
compilers (MetroWerks? Early GCC2?) that did not support FLAs.
GCC 2.95 does, using [0], and GCC 4 does, using [], so we can go
with that here.

(I did try using [0] for both, which seems to be OK with GCC 11,
but GCC 8 throws errors when d_name is dereferenced directly
as being-out-of-bounds. So, we have to use the #if here and give
newer GCC the [] syntax and not [0] to avoid that problem.)

The real question probably is whether or not we should backport
some variant of these changes to R1/beta3, as software at HaikuPorts
very well may run in to the same issue. (The alternative workaround
is to compile with -O1 and not -O2 for any affected software.) But
maybe this is an argument for keeping with the beta4 schedule of
this coming January...
2021-11-18 16:34:03 -05:00
Augustin Cavalier
9d242fb955 file_systems & Tracker: Do not assume sizeof(dirent) contains 1 byte for the name.
At present, it does, but that is an oddity we have preserved from BeOS
that the next commit is going to remove. (This commit thus wastes 1 byte
without the following one.)

Most changes are pretty straightforward: only a +1 is needed,
and a few removed from sizing calculations. Some filesystems like UDF
originally passed back the length with the \0 included, so they have
been adjusted further. UFS2 had some other sizing problems which are also
corrected in this commit.
2021-11-18 16:24:04 -05:00
Augustin Cavalier
8f03af00f8 Storage: Rework LongDirEntry to be a union.
Our dirent structure is "slim": it has a flexible-length array at the
end which must be allocated to whatever size the consumer wants. However,
we use [1] there and not [0] or [], which meant GCC thought it was not
a flexible-length array, and so it optimized various string accesses
that it assumed must be always false. Among these was BDirectory's
check for "." and "..", and so that resulted in infinite loops.

When changing our dirent structure to a proper FLA instead of [1],
GCC then throws errors on LongDirEntry as it has data "after" the
FLA; which is what we want, but there is no way to tell GCC that.
So now we use a union instead, which is the proper way to statically
allocate a FLA.

This is part of #17389, but the real fix requires changing our dirent
structure, which is coming in a separate commit.
2021-11-18 16:00:23 -05:00
Augustin Cavalier
9cc1718212 libbe_build: Fix build on non-Haiku platforms.
Probably should have tested that before pushing.
2021-11-18 15:42:17 -05:00
Augustin Cavalier
ec21dc91b1 libbe_build: Synchronize Directory.cpp with the main one.
The set_dir_fd code appears to be libbe_build specific, so that
and accompanying logic is preserved.
2021-11-18 12:13:47 -05:00
Augustin Cavalier
28c8a16a5a libbe_build: Synchronize Node.cpp with the main one.
Mostly formatting changes with a few minor bugfixes it appears.
2021-11-18 11:18:49 -05:00
Augustin Cavalier
a7639d2389 libroot_debug: Add aligned_alloc implementation.
Fixes #17407.
2021-11-18 11:14:53 -05:00
Augustin Cavalier
cf5edc8448 accelerants: Add default case for xy_command initialization.
Silences a GCC 11 warning.
2021-11-17 21:10:30 -05:00
Augustin Cavalier
52f87edca5 Time: operator() on the comparator structure must be const.
The STL seems to require it, but before GCC 11 that may not
have been properly enforced.
2021-11-17 21:10:05 -05:00
Augustin Cavalier
91a0b53040 HaikuDepot: Do not inadvertently modify the real errno.
Found by GCC 11 warnings.
2021-11-17 21:09:31 -05:00
Augustin Cavalier
eeddcfffbe accelerants: Fix mismatched prototypes.
Found by GCC 11.
2021-11-17 21:09:10 -05:00
Augustin Cavalier
f35fc7ebda Remove some dynamic exception specifiers.
GCC 11 does not like them, and GCC 2 does not seem to care.
2021-11-17 21:08:49 -05:00
Augustin Cavalier
e4f18add74 Game & Print Kits: Fix GCC 11 warnings. 2021-11-17 18:45:58 -05:00
Augustin Cavalier
f7338bb6a0 Media Kit: Fix/appease various GCC 11 warnings. 2021-11-17 18:45:35 -05:00
Augustin Cavalier
181529ce0c bsd/err.c: Upgrade to a newer version from FreeBSD.
* 3-clause BSD instead of 4-clause BSD
 * C89 compliance instead of K&R C, needed for GCC 11
2021-11-17 14:01:20 -05:00
Augustin Cavalier
afc04c50e5 kernel/debug: Add initialization to appease -Wmaybe-uninitialized. 2021-11-17 14:00:48 -05:00