summaryrefslogtreecommitdiff
path: root/sys/arch
AgeCommit message (Collapse)Author
2024-09-01spelling; checked by jmc@, ok miod@ mglocker@ krw@Jonathan Gray
2024-08-29Hide all EPT-related bits behind #ifdef in amd64 pmap.Dave Voutila
A few functions and symbols were included in non-VMM builds. This tucks more of them behind the "#ifdef NVMM > 0" check and cleans up RAMDISK kernels. ok mpi@, feedback from chris@
2024-08-28If bounce buffers do not fit, defragment mbuf.Alexander Bluhm
Some packets were dropped by vio_encap() when using bounce buffers. These mbufs are too fragmented for the pre allocated bounce buffer pages. By returing EFBIG the network driver will call m_defrag() and try again. This fixes the problem. OK sf@ hshoexer@
2024-08-28Enable per-cpu page cache.Miod Vallat
2024-08-28splnet() not needed in activate functionTheo de Raadt
ok gkoehler
2024-08-27Enable AMD SEV support in vmm(4).Alexander Bluhm
Bring the pieces for vmm(4) to support guests with SEV memory encryption on AMD CPUs. The corresponding vmd(8) changes will follow. Emulate cpuid 0x8000001f so the guest can discover SEV features. Allow vmd(8) to enable SEV on VM creation. Inform vmd(8) about the c-bit position and ASID assigned to each VCPU. Note that vmd(8) has to be rebuilt with the new header files. from hshoexer@; input dv@; OK mlarkin@
2024-08-26replace multiple '.arch armv8.3-a' with a pauth target attributeJonathan Gray
'no objection' kettenis@
2024-08-25typoMiod Vallat
2024-08-25make activate function confirm to the common idiom; ok miodTheo de Raadt
2024-08-23Enable per-cpu page cache; tested on Octeon.Miod Vallat
2024-08-23Switch alpha to MI mplock code.Miod Vallat
2024-08-23Make sure pmap_kernel's mutex field gets correctly initialized rather thanMiod Vallat
bss initialized.
2024-08-22Fix merge of bounce buffer segments in amd64 bus dma.Alexander Bluhm
If the physical pages are contiguous, _bus_dmamap_load_buffer() tries to merge the segments. In case of mbuf chains, it can happen that the physical bounce buffers are contiguous, but the virtual addresses of mbuf m_data are not. Then during transmit _bus_dmamap_sync() tries to copy segments where it cannot access the virtual source address which is mapped in a different mbuf. So if bounce buffers are used, physical and virtual buffer must be contigous, to merge a segment. While there, split check and decrement of variable i in a for loop to make the code readable. with and OK hshoexer@
2024-08-22unrequired header file in vmm_machdep.cMike Larkin
2024-08-20match the config_activate_children() sequences found in other usb hostTheo de Raadt
controller drivers.
2024-08-20Fix whitespace in amd64 bus dma.Alexander Bluhm
2024-08-20fix bus_dmamap_destroyStefan Fritsch
With bounce buffers, we must pass a larger size to free() ok bluhm@ hshoexer@
2024-08-20Calculate used bounce buffers in amd64 bus dma correctly.Alexander Bluhm
There was an off-by-one bug when comparing the used pages for bounce buffers with the available pages. As a result _bus_dmamap_load_buffer() returned ENOMEM although there was one buffer left. Also the _dm_nused field was updated and never reset in case of an error. Use a local variable to count the used pages and update global map->_dm_nused only if _bus_dmamap_load_buffer() was successful. This fixes hanging network transmits if bounce buffers are enforced for vio(4). OK sf@ hshoexer@
2024-08-18Use define to test bounce buffer in amd64 bus dma.Alexander Bluhm
To debug bounce buffers easily on non-SEV hardware, introduce a define FORCE_BOUNCE_BUFFER that activates them. Default is off, no functional change. OK miod@
2024-08-18don't need to put config_activate_children inside cfattach, becauseTheo de Raadt
NULL means the same ok kettenis
2024-08-17Use km_alloc(9) to allocate USPACE instead of uvm_pglistalloc(9).Martin Pieuchot
ok miod@
2024-08-14Implement bounce buffering for AMD SEV in amd64 bus dma.Alexander Bluhm
When running as SEV guest, as indicated by variable cpu_sev_guestmode, allocate additional pages for each segment on dma map creation. These pages are mapped with the PMAP_NOCRYPT attribute, i.e. the crypt bit is not set in the PTE. Thus, these pages are shared with the hypervisor. When the map is loaded with actual pages, the address in the descriptor is replaced by the corresponding bounce buffer. Using bus_dmamap_sync(), data is copied from the encrypted pages used by guest drivers to the unencrypted bounce buffers shared with the hypervisor, and vice versa. If the kernel is not running in SEV guest mode, which means as normal host or non-SEV guest, no bounce buffers are used. from hshoexer@; based on ancient code of mickey@; OK kettenis@
2024-08-14Introduce qwz(4), a work-in-progress port of the Linux ath12k driver.Patrick Wildt
This driver is not working yet, it's a copy of qwx(4) which bit-by-bit will be adjusted to work on the newer generation of chips. Even though this is only a minor bump over the previous generation, the changes are large enough that bringup, debugging and long-term maintenance would suffer trying to squash them into a single driver. This can be reconsidered once we have reached a stable state.
2024-08-12other growth has happened and I'm out of current culling options,Theo de Raadt
so mpi(4) gets removed from the floppy.
2024-08-08Start wire_count for EPT pde pages at 1.Dave Voutila
Corrects an off-by-one error that results in EPT pte's not being removed properly. ok mlarkin@
2024-08-08Prevent spurious "/bsd.upgrade is not u+x" message when the file is missing.Miod Vallat
ok kn@
2024-08-08Make user ci_flags is declared volatile.Miod Vallat
2024-08-08Print suspend-to-idle debug info in a more concise matter.Mark Kettenis
ok mlarkin@, deraadt@
2024-08-07crank to 7.6-beta, release date is vagueTheo de Raadt
2024-08-06The devicetree spec says in section 2.4:Mark Kettenis
If an interrupt-generating device does not have an interrupt-parent property, its interrupt parent is assumed to be its devicetree parent. Implement this aspect of the spec in the same way as Linux does by not just looking at the immediate parent but keep on walking up the tree until we hit a node with an "interrupt-controller" property or a node that has an "interrupt-parent" property. similar diff as committed for arm64 a couple of days ago ok jca@
2024-08-05The devicetree spec says in section 2.4:Mark Kettenis
If an interrupt-generating device does not have an interrupt-parent property, its interrupt parent is assumed to be its devicetree parent. Implement this aspect of the spec in the same way as Linux does by not just looking at the immediate parent but keep on walking up the tree until we hit a node with an "interrupt-controller" property or a node that has an "interrupt-parent" property. same diff as committed for arm64 yesterday ok patrick@
2024-08-04The devicetree spec says in section 2.4:Mark Kettenis
If an interrupt-generating device does not have an interrupt-parent property, its interrupt parent is assumed to be its devicetree parent. Implement this aspect of the spec in the same way as Linux does by not just looking at the immediate parent but keep on walking up the tree until we hit a node with an "interrupt-controller" property or a node that has an "interrupt-parent" property. ok patrick@
2024-08-04Add intelpmc(4), a driver for the power management controller found onMark Kettenis
various Intel SoCs. The driver takes care of calling the AML methods needed to enter low power idle states during suspend-to-idle (S0i). The driver also implements some debug code that prints the residency of various power states in dmesg. Based on some earlier code by jcs@ ok jcs@
2024-08-02Code patch out the retpoline in the signal trampoline justPhilip Guenther
like the others. Nudged, test, and ok deraadt@
2024-08-01Add device tree mapping for Samsung Galaxy Book4 Edge.Marcus Glocker
ok kettenis@
2024-07-31Add ufshci(4) at fdt support.Marcus Glocker
This lets me boot the Samsung Galaxy Book4 Edge in DT mode with ufshci(4), based on a WIP DTB file. ok kettenis@
2024-07-30Make the Samsung Galaxy Book4 Edge (x1e80100) boot in ACPI mode;Marcus Glocker
Until now the kernel did panic during early boot because we couldn't respond to the battery requests sent to the 0xa1 "bus". This (dummy) driver registers a 0xa1 region space very early, and responds with a static zero value to satisfy the battery requests on 0xa1, which let us boot successfully to multi-user. In the future this machine should be operated in FDT mode, and an improved AML parsing interface might make this workaround obsolete also for RAMDISK. Help and OK kettenis@, deraadt@
2024-07-30Populate most of the remaining hwcap and hwcap2 flags based on the detectedMark Kettenis
CPU features. ok naddy@
2024-07-29Set the target ACPI to S5 when we're powering down the machine. PreventsMark Kettenis
us from trying to put devices into the D3 power state which some hardware doesn't appreciate. ok ratchov@, deraadt@
2024-07-27Use ".arch_extension fp" for the signal trampoline since it saves andMark Kettenis
restores the FPU registers (running in userland). And add an ".arch_extension nofp" afterwards such that the remaining kernel code can't touch the FPU. Needed to build with clang18 ok jsg@
2024-07-26On AMD vmm(4) set SVM_INTERCEPT_INVLPGA in intercept1.Alexander Bluhm
According to the AMD64 Architecture Programmer's Manual volume 2 the intercept SVM_INTERCEPT_INVLPGA needs to be set in vmcb.intercept1 (vector 3, offest 00Ch) instead of intercept2 (vector 4, offset 010h). SVM_INTERCEPT_INVLPGA is bit 26, so before vcpu_reset_regs_svm() was actually setting an intercept for CR10, which does not exist. from hshoexer@; OK mlarkin@
2024-07-26use the fp target attribute with fpu_save()/fpu_load()Jonathan Gray
otherwise clang 18 errors when inline assembly uses floating point registers with nofp in -march ok kettenis@
2024-07-24If the CPU cores implement FEAT_IDST, emulate access to the CPU IDMark Kettenis
registers from userland and set HWCAP_CPUID. This will allow detection of features to be introduced into the architecture in the future without allocating new HWCAP_xxx or HWCAP2_xxx bits. We provide the same sanitized view of the CPU ID registers as is currently available through sysctl(2). Note that this introduces an unconditional read of ID_AA64MMFR2_EL1. This is known to cause problems on older versions of QEMU. If this turns out to be a problem in cases where updating QEMU is not an option, we'll have to implement a workaround. Also note that since we don't emulate the CPU ID registers on older core, this means that microarchitectural optimizations keyed of reads of MIDR_EL1 are not possible on OpenBSD. I don't think that is a real problem. ok jca@
2024-07-24vmm(4): drop checks for EPT or RVI in some functions.Dave Voutila
vmm(4) only supports using nested paging on Intel or AMD and no longer supports HLAT or shadow paging. ok mlarkin@
2024-07-21For AMD SEV determine C-bit position and guest mode in locore0.Alexander Bluhm
Actually determine the C-bit position if we are running as a guest with SEV enabled. Configure pg_crypt, pg_frame and pg_lgframe accordingly, using the physical address bit reduction provided by cpuid. from hshoexer@; OK mlarkin@
2024-07-21Populate hwcap and hwcap2 based on the sanitized values of the ID registerMark Kettenis
values and the feature bits that we recognize. ok naddy@, jca@
2024-07-21Export basic HWCAP bits to let applications detect Altivec & VSX on powerpc64Jeremie Courreges-Anglas
Input from miod@ and gkoehler@, tests & ok gkoehler@
2024-07-21Export basic HWCAP bits to let applications detect Altivec on powerpcJeremie Courreges-Anglas
Input from miod@ and gkoehler@, tests & ok gkoehler@
2024-07-21A few manual ret-cleans. Seeing as these pertain to interrupt servicing,Theo de Raadt
the stack utilization ends up near the the deep end of the stack where, retcleans are useful. tested for a while in snaps ok bluhm
2024-07-18Fix typos in previous commit spotted by naddy@Mark Kettenis