summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
AgeCommit message (Collapse)Author
4 daysCast atomic_load_int(9) to signed int when loading `securelevel'.Vitaliy Makkoveev
The return value of atomic_load_int(9) is unsigned so needs a cast, otherwise securelevel=-1 gets misrepresented. From Paul Fertser.
5 daysFix some typos in comments in i386/amd64 bootblocksMike Larkin
Also fix some trailing whitespace in comments. From Christian Schulte, thanks
9 daysEnable ixv(4) in RAMDISK_CDYASUOKA Masahiko
ok stu deraadt
12 daysremove vmx_pmap_find_pte_ept(), used by removed EPT mprotect ioctlJonathan Gray
ok mlarkin@
13 daysremove unused XINTR() defineJonathan Gray
2024-11-08Add a work-in-progress version of ice(4), a driver for Intel E810 devices.Stefan Sperling
Ported from FreeBSD. This driver does not pass packets yet, lots of code is still missing. The driver will remain disabled in kernel configs until it is ready. At this stage, code for device initialization should be fairly complete. Some hardware features will require additional firmware packages to be loaded. My plan is to get things working in the basic "safe mode" first, which does not require external firmware. I will continue working on this driver in-tree, with funding from genua. Help is welcome. ok dlg@
2024-11-08psp(4) waits for acknowledgement of wbinvd from other CPU.Alexander Bluhm
If any other CPU has not finished wbinvd, PSP command may fail. To avoid races, call wbinvd_on_all_cpus_acked() which waits for acknowledgement from IPI handler. Provide stub to build non-MP kernels. from hshoexer@; OK mlarkin@
2024-11-08remove unused pmap_move()Jonathan Gray
2024-11-08remove unused VM_MAXUSER_ADDRESS32Jonathan Gray
2024-11-07Expand amd64 wbinvd_on_all_cpus() with acknowledge.Alexander Bluhm
Implement wbinvd_on_all_cpus_acked() similar to pmap_tlb_shootpage(). This ensures, wbinvd has been executed on all cores when the function returns. This is needed to avoid psp(4) races. from hshoexer@; OK mlarkin@
2024-11-07Constify strings in symbol-related ddb interfaces, and make the iteratorMiod Vallat
callback interface a bit simpler. ok beck@ claudio@ mpi@
2024-11-05The first field of struct cfdriver is a pointer. Put NULL rather than 0 here.Miod Vallat
2024-11-05The MI boot code used to have an infinite loop trying to boot the kernel,Miod Vallat
which got limited to at most two tries 26 years ago for the 2.3 release, but the documentation was never updated to match this change. Do it now. Reported by Nir Lichtman on tech@
2024-11-05Enable ixv(4)YASUOKA Masahiko
ok jan
2024-11-04remove ability to specify root/dump/swap on st(4)Jonathan Gray
support for tape block devices was removed in 2016 ok miod@
2024-11-02Kill unused pmap_collect().Martin Pieuchot
ok miod@
2024-11-02Add ixv(4), a driver for virtual functions of Intel 82598EB, 82559,YASUOKA Masahiko
and X540. The driver was originally written by Intel and released as ixv driver version 1.5.32 and ported to OpenBSD by Yuichiro NAITO, naito.yuichiro at gmail.com. tested by henson at acm.org and many others. ok jmatthew
2024-10-28Unlock KERN_ALLOWKMEM. The `allowkmem' is atomically accessed integer.Vitaliy Makkoveev
Also use atomic_load_int(9) to load `securelevel'. sysctl_securelevel() is mp-safe, but will be under kernel lock until all existing `securelevel' loading became mp-safe too. ok mpi
2024-10-24Stop leaking kernel stack guard pages.Mark Kettenis
ok mpi@, anton@
2024-10-22put opening { on same line as struct nameJonathan Gray
ok claudio@
2024-10-22remove prototypes with no matching functionJonathan Gray
2024-10-21We have not been swapping out kernel stacks since forever. So justMark Kettenis
allocate the uarea with zeroed pages using km_alloc(9). Adjust the amd64 code that creates a guard page at the top of the kernel stack to use pmap_kremove(9) instead of pmap_remove(9) to reflect that the uarea no longer uses "managed" pages. ok mpi@
2024-10-21remove unused MP_PICMODE defineJonathan Gray
2024-10-14Fix build w/o SUSPEND optionJan Klemkow
with tweaks from miod@ ok miod@
2024-10-10allow MSI with the QEMU default pc-i440fx machineJonathan Gray
This makes it possible to use MSI for virtual functions of Intel network devices without having to specify the q35 machine. QEMU is detected by testing for the Qumranet pci subsystem vendor id, suggested by sf@. MSI previously wasn't enabled as i440fx models a machine from 1996 with ACPI 1.0, and MSI is only enabled for ACPI >= 2.0. Initial patch from Yuichiro NAITO. ok yasuoka@ sf@
2024-10-08Make bus_dmamem_alloc(9) recognize the BUS_DMA_64BIT flag and interpretMark Kettenis
it as a request for memory without any DMA restrictions, which means that the call is allowed to allocate memory above the 4GB boundary on amd64. ok mpi@, mlarkin@
2024-10-07Remove VMFUNC feature detection and tracking.Dave Voutila
vmm(4) doesn't use the VMX VMFUNC instruction. ok mlarkin@
2024-10-06use rdmsr_safe() instead of rdmsr() for probing featureSebastien Marie
the second could raise general protection fault on non-existant MSR fix with help of jsg@ ok dv@
2024-10-05remove unneeded includesJonathan Gray
2024-10-04Allow boot loader to run as AMD SEV guest on QEMU with EFI.Alexander Bluhm
When efibooting amd64, the boot loader rewrites the page table built by EFI firmware to ensure that there are no read-only mappings. The rewrite is needed for some HP EFI BIOS, that maps computrace section read-only. When efibooting on SEV enabled QEMU, we would have to ensure the crypt bit is set when changing page tables. However, there is no need for the HP workaround when booting on QEMU (or any other VM), so just do not modify the page table, when SEV gest mode is detected. from Sebastian Sturm; via hshoexer@; OK kettenis@
2024-10-04Allow kernel boot on QEMU with AMD SEV.Alexander Bluhm
When booting an OpenBSD kernel on Linux QEMU with SEV enabled, the hypervisor does not forward the SME feature, only the SEV bit is set. Therefore do not depend on SME when checking for SEV guest mode in locore0. from Sebastian Sturm; via hshoexer@; OK jsg@
2024-10-02amd64: implement a pmap_shootept() for non-MP kernels.Dave Voutila
Simplifies some of the recent INVEPT changes and mirrors the design of other pmap tlb shootdown functions that provide simplified non-MP implementations. ok mlarkin@
2024-10-02Move some PCI MMIO defines from vmm(4) kernel headers to userland.Dave Voutila
vmm(4) doesn't need this information anymore. vmd(8) is the only consumer of this information. ok mlarkin@
2024-09-26Fix amd64/GENERIC not linking due to missing pmap_shootept symbol.Dave Voutila
My recent commit to add an INVEPT ipi missed an ifdef related to MP machines. ok krw@
2024-09-26Add an ipi for executing INVEPT to flush EPT on remote cpus.Dave Voutila
Similar to how the fast ipi for tlb flush is implemented, this adds one for calling INVEPT to invalidate EPT caches on the cpu. This is the first step to allowing guest memory to not be wired by UVM and decreases the behavioral differences between Intel and AMD's nested paging in vmm(4) and pmap(9). This change does not hook EPT ptes into the PV list, so the ipi is only used during address space teardown and pte removal. (With the removal of the "mprotect" ioctl, vmm(4) no longer modifies EPT ptes other than inserting them and removing them.) ok mlarkin@
2024-09-26remove unneeded psl.h includeJonathan Gray
2024-09-21We aren't ready to choose S0-over-S3 based upon the S0ix bit in FADT.Theo de Raadt
Some machines which work great in S3, don't work great in S0. Some people want to be able to force S0, mostly for testing purposes (or to notice improvements as changes are made in the tree). Provide a TEMPORARY method via machdep.lidaction=-1 which will be S0-suspend while =1 remains S3 suspend. This button will not remain long-term, but for now, and during 7.6, it will be better than nothing. ok ratchov kettenis
2024-09-21vmm(4): remove EPT mprotect ioctlMike Larkin
This old ioctl isn't used by vmd(8) and is getting in the way of some improvements we want to do. It was used by solo5 but the person who was helping maintain this is no longer involved with that project. ok dv
2024-09-20remove unneeded semicolons; checked by millert@Jonathan Gray
2024-09-04vmm: set highest cpuid feature leaf based on host cpu.Dave Voutila
Fixes Linux guests on older Intel hardware. vmm was reporting a value that doesn't match the host. Cap it at the highest value vmm currently emulates. ok bluhm@, ratchov@
2024-09-04Fix some spelling.Marcus Glocker
Input and ok jmc@, jsg@
2024-09-04make psp attach to ccp as a different driverJonathan Gray
'fine with me' hshoexer, ok bluhm@
2024-09-03For virtual addresses use fixed page frame without AMD SEV reduction.Alexander Bluhm
When running as a SEV guest, page frame mask is calculated from the CPUID provided "physical address bit reduction". The amd64 pmap code uses the variable pg_frame instead of the defined PG_FRAME 0x000ffffffffff000. There was one instance in pmap code where pg_frame was applied to virtual address, not physical address. On some machines the address bit reduction is rather large with six bits. So the calculated pg_frame is 0x00003fffffe00000. However, on amd64 VM_MAX_ADDRESS is defined as 0x00007fbfdfeff000. Masking a such large address with pg_frame caused havoc. Therefore, when masking virtual addresses, still use PG_FRAME. from hshoexer@
2024-09-03vmm(4)/vmx: avoid VPID leakage by allocating at vcpu init.Dave Voutila
VPID allocation being dependent on the host and guest config (consequently pushing it into the reset register handler) creates a leak where previous VPIDs are not freed if the hypervisor program resets a vcpu's registers. Recent SVM related changes pulled the VPID (ASID in AMD world) allocation up into vcpu initialization. This change does the same for VMX and cleans up appropriate logic. Minor changes to keep SVM and VMX styles in line with each other. ok bluhm@
2024-09-03move psp functions to psp.c and remove the ifdefsJonathan Gray
ok bluhm@ hshoexer@
2024-09-01Pledge "vmm" for ccp(4) ioctl(2).Alexander Bluhm
Limit ccp ioctls to processes that pledge vmm. Specific psp device ioctls for AMD SEV will allowed for vmd(8). from hshoexer@; input deraadt@ jsg@
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-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@