When PAT is in use and MTRRs are ignored and left unchanged, it is still
useful to know what it was set up to by the firmware.
Change-Id: I6b0c0f1277659c81fa9b3e9b7bb2c5df92cfdf0f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8341
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Using the page attribute table to set the memory type on a per page
mapping basis is the more modern and flexible approach to physical
memory type handling compared to using MTRRs.
Most of the needed infrastructure was already in place, as setting the
page table entry attributes was already done for uncachable and
write-back memory types. Using the PAT now also allows to set the last
remaining memory type of write-combining through the PTE flags. The PAT
is configured to have entry 4 mean write-combining and the PAT bit in
the PTE is set to point to that.
When PAT is supported and not disabled, MTRRs are completely ignored
and left as set up by the system firmware, where the basic uncachable
and RAM ranges are supposed to be set up. These configurations are then
overridden by the PTE flags as needed.
Change-Id: I0a74b3fc7d3ba9fa384251290ce41621b69d3a02
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8340
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
We allow requesting an explicit memory type when calling
map_physical_memory but default to the uncached B_MTR_UC when not given.
When called without an explicitly requested memory type, allow
arch_vm_set_memory_type to modify and return an effective memory type.
When an overlapping range already exists, the effective memory type is
set to the one of the existing mapping. If there is an explicit memory
type request that conflicts with an existing range, or if multiple
overlaps with conflicting types would be produced, the mapping is
disallow (and a panic is triggered under KDEBUG).
This effectively detects and panics when conflicting aliases of physical
memory would be created. This is also useful on an MTRR based setup,
as such overlaps cannot be properly represented.
When using the page attribute table (PAT) to set the memory type on a
per page virtual memory mapping basis, this is needed to prevent
aliasing of the same physical memory with different types. As per the
specs, such aliasing is unsupported and may result in undefined
operations that lead to system failure.
The mechanism is extended to the general arch_vm_set_memory_type as such
aliasing prevention also seems to apply to other architectures (at least
on ARM, aliasing is also strongly discouraged).
Change-Id: I7aaf6ea8415e92e74cd1643b67793a6857619eea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8339
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
We set flags above the timeout check, so we need to use |= and
not lose the SHARED flag we already set.
Fixes some testcases in the POSIX testsuite, and the shared
semaphore code in Gecko/Firefox.
Except on kernel_cpp.cpp. We don't use it for most of libroot, so
we don't need it for most of runtime_loader either. The two preceding
changes were all that's necessary to fix things with builtins enabled.
Very slight performance improvement (the "run 1000 shells" benchmark
seems to decrease by about 0.4 seconds out of 16.5 or so.)
Tooling used by HaikuDepotServer relies on typing features that
exist in Python >= 3.9.
Change-Id: I926d464130a3cef331a00b9a6abbbad5edfcefda
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8326
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
* Don't use ASID-delimited flushes for kernel space. The ASID comes
from TTBR0_EL1, but kernel address space comes from TTBR1_EL1, so
this never works.
* Adjust ProcessRange to operate on unmasked VAs. This means that
the kernel space tag bits are preserved and passed into the
callback, which can then pass to them to whatever flushes are
necessary correctly.
Change-Id: If86aeea105f50fc4f294ce1c85cea5dfc938f5cf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8324
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* Extract clean/dirty logic into helpers that can be reused.
* Make sure helpers handle both SWDBM and HWDBM.
* Preparation for the introduction of a SWDIRTY flag in a subsequent
change.
Change-Id: I18b695b73294b9f8a1623bc2daec3f537316dd67
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8317
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Fix off-by-one issue and the init of the
default language in the case there's no
network connectivity.
Resolves #19090
Change-Id: I3d89bde16f67a8f50f4a08eead3d619a9f9d82f3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8328
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
* also set the active checkbox on edit
* part of #7930
Change-Id: Ia91e5f7295e7868647cf940aa1f281bd8dab1918
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8323
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
* Added all Tigerlake PCI IDs from Intel documentation with all possible
host bridge configurations.
* Tested on 0x9a78 with 0x9A02 host bridge.
* Fixed uppercase letters in PCI IDs to lowercase to match existing code
Change-Id: I5ac8b857b952a2daa93364d9b1c640621d680f5d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8156
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
It was disabled when adding the hypervisor CPUID leaf reading to
the bootloader, but that's not really necessary. This way, if
a hypervisor does not provide that CPUID leaf but does provide
the value in the standard CPUID or MSR, we will still read it
correctly anyway.