summaryrefslogtreecommitdiff
path: root/sys/amd64
Commit message (Collapse)AuthorAgeFilesLines
...
* MFC r345963, r345997:Konstantin Belousov2019-04-191-15/+2
| | | | | | | Implement resets for PCI buses and PCIe bridges. Notes: svn path=/stable/12/; revision=346378
* MFC r346062:Konstantin Belousov2019-04-161-50/+7
| | | | | | | | | pci_cfgreg.c: Use io port config access for early boot time. PR: 236838 Notes: svn path=/stable/12/; revision=346284
* After r346168, put the actual commit dates into UPDATING andDimitry Andric2019-04-131-1/+0
| | | | | | | | | ObsoleteFiles.inc. I completely forgot about those, sorry. This is a direct commit to stable/12. Notes: svn path=/stable/12/; revision=346179
* After r346168, put the actual commit dates into UPDATING andDimitry Andric2019-04-131-0/+1
| | | | | | | | | ObsoleteFiles.inc. I completely forgot about those, sorry. This is a direct commit to stable/12. Notes: svn path=/stable/12/; revision=346178
* MFC r345228:Konstantin Belousov2019-03-232-0/+69
| | | | | | | amd64 KPTI: add control from procctl(2). Notes: svn path=/stable/12/; revision=345446
* MFC r345227:Konstantin Belousov2019-03-233-2/+21
| | | | | | | amd64: Add md process flags and first P_MD_PTI flag. Notes: svn path=/stable/12/; revision=345445
* MFC r345226:Konstantin Belousov2019-03-231-17/+22
| | | | | | | amd64: fix switching to the pmap with pti disabled. Notes: svn path=/stable/12/; revision=345444
* MFC r345225:Konstantin Belousov2019-03-231-6/+3
| | | | | | | amd64: rewrite cpu_switch.S fragment to reload tss.rsp0 on context switch. Notes: svn path=/stable/12/; revision=345443
* MFC r345190:Konstantin Belousov2019-03-221-0/+4
| | | | | | | | Provide deterministic (and somewhat useful) value for RDPID result, and for %ecx after RDTSCP. Notes: svn path=/stable/12/; revision=345413
* MFC r344873:Andrey V. Elsukov2019-03-141-1/+1
| | | | | | | Fix typo. Notes: svn path=/stable/12/; revision=345125
* MFC r343964, r344121, r344128, r344593, r344594:Konstantin Belousov2019-03-121-1/+2
| | | | | | | ASLR. Notes: svn path=/stable/12/; revision=345067
* MFC 340020: Don't enter DDB for fatal traps before panic by default.John Baldwin2019-03-081-1/+1
| | | | | | | | | | | | | | | | | Add a new 'debugger_on_trap' knob separate from 'debugger_on_panic' and make the calls to kdb_trap() in MD fatal trap handlers prior to calling panic() conditional on this new knob instead of 'debugger_on_panic'. Disable the new knob by default. Developers who wish to recover from a fatal fault by adjusting saved register state and retrying the faulting instruction can still do so by enabling the new knob. However, for the more common case this makes the user experience for panics due to a fatal fault match the user experience for other panics, e.g. 'c' in DDB will generate a crash dump and reboot the system rather than being stuck in an infinite loop of fatal fault messages and DDB prompts. Notes: svn path=/stable/12/; revision=344905
* MFC r344353:Konstantin Belousov2019-03-065-7/+466
| | | | | | | | Add kernel support for Intel userspace protection keys feature on Skylake Xeons. Notes: svn path=/stable/12/; revision=344848
* MFC r344352:Konstantin Belousov2019-03-062-1/+5
| | | | | | | amd64: add defines and decode protection keys and SGX page faults reasons. Notes: svn path=/stable/12/; revision=344847
* MFC r344256:Konstantin Belousov2019-02-261-34/+19
| | | | | | | amd64: cleanup pmap_init_pat(). Notes: svn path=/stable/12/; revision=344573
* MFC r344232:Mark Johnston2019-02-251-13/+9
| | | | | | | Fix refcount leaks in the SGX Linux compat ioctl handler. Notes: svn path=/stable/12/; revision=344521
* MFC r344296:Konstantin Belousov2019-02-221-0/+16
| | | | | | | Provide convenience C wrappers for RDPKRU and WRPKRU instructions. Notes: svn path=/stable/12/; revision=344466
* MFC r343617, r343618:Konstantin Belousov2019-02-151-6/+7
| | | | | | | Make iflib a loadable module. Notes: svn path=/stable/12/; revision=344149
* MFC r343780:Konstantin Belousov2019-02-051-2/+4
| | | | | | | | | | amd64: clear callee-preserved registers on syscall exit. Approved by: so Security: CVE-2019-5595 Notes: svn path=/stable/12/; revision=343781
* MFC linuxulator stack memory disclosure fixesEd Maste2019-01-231-0/+1
| | | | | | | | | | | | | | | r343260 linuxulator: fix stack memory disclosure in linux_ioctl_v4l r343261 linuxulator: fix stack memory disclosure in linux_ioctl_termio r343262 linuxulator: fix stack memory disclosure in linux_sigaltstack r343263 linuxulator: fix stack memory disclosure in linux_sigaltstack admbugs: 765 Reported by: Vlad Tsyrklevich <vlad@tsyrklevich.net> Security: Kernel stack memory disclosure Sponsored by: The FreeBSD Foundation Notes: svn path=/stable/12/; revision=343343
* MFC r343108:Konstantin Belousov2019-01-201-10/+10
| | | | | | | | | Trim whitespace at EoL, use tabs instead of spaces for indent. PR: 235004 Notes: svn path=/stable/12/; revision=343211
* MFC r342933:Fedor Uporov2019-01-132-2/+2
| | | | | | | | | | | Fix errno values returned from DUMMY_XATTR linuxulator calls Reported by: weiss@uni-mainz.de Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D18812 Notes: svn path=/stable/12/; revision=342998
* MFC r342686:Mark Johnston2019-01-091-12/+9
| | | | | | | Avoid setting PG_U unconditionally in pmap_enter_quick_locked(). Notes: svn path=/stable/12/; revision=342891
* MFC r342767:Konstantin Belousov2019-01-071-0/+1
| | | | | | | x86: Report per-cpu IPI TLB shootdown generation in ddb 'show pcpu' output. Notes: svn path=/stable/12/; revision=342824
* MFC r341272,r341273,r341351Mateusz Guzik2018-12-191-70/+77
| | | | | | | | | amd64: tidy up copying backwards in memmove amd64: remove stale attribution for memmove work amd64: handle small memmove buffers with overlapping stores Notes: svn path=/stable/12/; revision=342240
* MFC r341719Mateusz Guzik2018-12-191-4/+0
| | | | | | | amd64: stop re-reading curpc on subyte/suword Notes: svn path=/stable/12/; revision=342239
* MFC r341364Mateusz Guzik2018-12-191-0/+30
| | | | | | | amd64: align target memmove buffer to 16 bytes before using rep movs Notes: svn path=/stable/12/; revision=342238
* MFC r341442, r341443:Mark Johnston2018-12-042-0/+5
| | | | | | | Plug memory disclosures via ptrace(2). Notes: svn path=/stable/12/; revision=341490
* MFC r341096:Konstantin Belousov2018-12-041-6/+8
| | | | | | | Fix assert condition in pmap_large_unmap(). Notes: svn path=/stable/12/; revision=341468
* MFC r340994Eric van Gyzen2018-11-281-0/+2
| | | | | | | | | | | | | Prevent kernel stack disclosure in getcontext/swapcontext Expand r338982 to cover freebsd32 interfaces on amd64, mips, and powerpc. Security: FreeBSD-EN-18:12.mem Security: CVE-2018-17155 Sponsored by: Dell EMC Isilon Notes: svn path=/stable/12/; revision=341146
* MFC r340772:Mark Johnston2018-11-251-0/+2
| | | | | | | Clear unused bytes in ia32_osendsig(). Notes: svn path=/stable/12/; revision=340919
* MFC r340387: Add evdev support to amd64 and i386Niclas Zeising2018-11-202-0/+10
| | | | | | | | | | | | | | | | This merge is done sans sys/i386/conf/MINIMAL, since that doesn't exist in stable/12, only current. Include evdev support and drivers in the amd64 GENERIC and MINIMAL, and i386 GENERIC kernels. Evdev is used by X and wayland to handle input devices, and this change, together with upcomming changes in ports will make us handle input devices better in graphical UIs. Reviewed by: wulf, bapt, imp Approved by: imp Notes: svn path=/stable/12/; revision=340695
* MFC r339531,r339579,r340252,r340463,r340464,340472,r340587Mateusz Guzik2018-11-201-47/+77
| | | | | | | | | | | | | amd64: tidy up memset to have rax set earlier for small sizes amd64: finish the tail in memset with an overlapping store amd64: align memset buffers to 16 bytes before using rep stos amd64: convert libc bzero to a C func to avoid future bloat amd64: sync up libc memset with the kernel version amd64: handle small memset buffers with overlapping stores Fix -DNO_CLEAN amd64 build after r340463 Notes: svn path=/stable/12/; revision=340684
* MFC r339449:Mateusz Guzik2018-11-201-3/+2
| | | | | | | | | | | | | | amd64: relax constraints in curthread and curpcb This makes the compiler less likely to reload the content from %gs. The 'P' modifier drops all synteax prefixes and 'n' constraint treats input as a known at compilation time immediate integer. Example reloading victim was spinlock_enter. Notes: svn path=/stable/12/; revision=340682
* Remove debugging options from amd64 MINIMAL [1] and riscv GENERICGlen Barber2018-11-191-9/+0
| | | | | | | | | | | | | kernel configuration files. This should have been turned off when stable/12 branched. This is a direct commit to stable/12. Submitted by: Harry Schmalzbauer [1] Sponsored by: The FreeBSD Foundation Notes: svn path=/stable/12/; revision=340630
* MFC r339895:Konstantin Belousov2018-11-191-4/+10
| | | | | | | amd64: Use ifuncs to select suitable implementation of set_pcb_flags(). Notes: svn path=/stable/12/; revision=340606
* MFC r340487:Konstantin Belousov2018-11-191-1/+2
| | | | | | | Align IA32_ARCH_CAP MSR definitions and use with SDM rev. 068. Notes: svn path=/stable/12/; revision=340605
* MFC r340384:Konstantin Belousov2018-11-191-0/+1
| | | | | | | Apply fix to un-cripple max cpu id on BSP earlier. Notes: svn path=/stable/12/; revision=340604
* MFC r339893:Konstantin Belousov2018-11-181-10/+16
| | | | | | | Style. Notes: svn path=/stable/12/; revision=340554
* MFC r339507:Konstantin Belousov2018-11-186-3/+98
| | | | | | | amd64: flush L1 data cache on syscall return with an error. Notes: svn path=/stable/12/; revision=340552
* MFC r339490:Mark Johnston2018-11-171-0/+2
| | | | | | | Add an assertion to pmap_enter(). Notes: svn path=/stable/12/; revision=340522
* MFC 340164,340168,340170: Add custom cpu_lock_delay() for x86.John Baldwin2018-11-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 340164: Add a KPI for the delay while spinning on a spin lock. Replace a call to DELAY(1) with a new cpu_lock_delay() KPI. Currently cpu_lock_delay() is defined to DELAY(1) on all platforms. However, platforms with a DELAY() implementation that uses spin locks should implement a custom cpu_lock_delay() doesn't use locks. 340168: Add a delay_tsc() static function for when DELAY() uses the TSC. This uses slightly simpler logic than the existing code by using the full 64-bit counter and thus not having to worry about counter overflow. 340170: Add a custom implementation of cpu_lock_delay() for x86. Avoid using DELAY() since it can try to use spin locks on CPUs without a P-state invariant TSC. For cpu_lock_delay(), always use the TSC if it exists (even if it is not P-state invariant) to delay for a microsecond. If the TSC does not exist, read from I/O port 0x84 to delay instead. PR: 228768 Approved by: re (gjb) Notes: svn path=/stable/12/; revision=340269
* MFC r340181, r340185:Tijl Coosemans2018-11-081-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On amd64 both Linux compat modules, linux.ko and linux64.ko, provide linux_ioctl_(un)register_handler that allows other driver modules to register ioctl handlers. The ioctl syscall implementation in each Linux compat module iterates over the list of handlers and forwards the call to the appropriate driver. Because the registration functions have the same name in each module it is not possible for a driver to support both 32 and 64 bit linux compatibility. Move the list of ioctl handlers to linux_common.ko so it is shared by both Linux modules and all drivers receive both 32 and 64 bit ioctl calls with one registration. These ioctl handlers normally forward the call to the FreeBSD ioctl handler which can handle both 32 and 64 bit. Keep the special COMPAT_LINUX32 ioctl handlers in linux.ko in a separate list for now and let the ioctl syscall iterate over that list first. Later, COMPAT_LINUX32 support can be added to the 64 bit ioctl handlers via a runtime check for ILP32 like is done for COMPAT_FREEBSD32 and then this separate list would disappear again. That is a much bigger effort however and this commit is meant to be MFCable. This enables linux64 support in x11/nvidia-driver*. PR: 206711 Reviewed by: kib Approved by: re (gjb) Notes: svn path=/stable/12/; revision=340258
* MFC r339979:Konstantin Belousov2018-11-072-0/+15
| | | | | | | | | Add pci_early function to detect Intel stolen memory. Approved by: re (rgrimes) Notes: svn path=/stable/12/; revision=340224
* MFC: r339562 (remove obsolete drivers from GENERIC)Warner Losh2018-10-251-5/+0
| | | | | | | | | Remove the drivers we'd planned on removing from 12.x from GENERIC. Approved by: re@ (rgrimes@) Notes: svn path=/stable/12/; revision=339704
* - Prune svn:mergeinfo from the new branch, as nothing has been mergedGlen Barber2018-10-192-51/+0
| | | | | | | | | | | | | | | here. - Remove debugging from GENERIC* kernel configurations - Enable MALLOC_PRODUCTION - Default dumpdev=NO - Remove UPDATING entry regarding debugging features - Switch 12.0 from -ALPHA10 to -BETA1 to prepare for builds. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Notes: svn path=/stable/12/; revision=339435
* Do not flush cache for PCIe config window.Konstantin Belousov2018-10-183-15/+36
| | | | | | | | | | | | | | | | | | | | | | | | Apparently AMD machines cannot tolerate this. This was uncovered by r339386, where cache flush started really flushing the requested range. Introduce pmap_mapdev_pciecfg(), which simply does not flush cache comparing with pmap_mapdev(). It assumes that the MCFG region was never accessed through the cacheable mapping, which is most likely true for machine to boot at all. Note that i386 does not need the change, since the architecture handles access per-page due to the KVA shortage, and page remapping already does not flush the cache. Reported and tested by: mjg, Mike Tancsa <mike@sentex.net> Reviewed by: alc Sponsored by: The FreeBSD Foundation Approved by: re (gjb) MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D17612 Notes: svn path=/head/; revision=339432
* Provide pmap_large_map() KPI on amd64.Konstantin Belousov2018-10-163-10/+577
| | | | | | | | | | | | | | | | | | | | | | | | | The KPI allows to map very large contigous physical memory regions into KVA, which are not covered by DMAP. I see both with QEMU and with some real hardware started shipping, the regions for NVDIMMs might be very far apart from the normal RAM, and we expect that at least initial users of NVDIMM could install very large amount of such memory. IMO it is not reasonable to extend DMAP to cover that far-away regions both because it could overflow existing 4T window for DMAP in KVA, and because it costs in page table pages allocations, for gap and for possibly unused NV RAM. Also, KPI provides some special functionality for fast cache flushing based on the knowledge of the NVRAM mapping use. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation Approved by: re (gjb) MFC after: 1 week Differential revision: https://reviews.freebsd.org/D17070 Notes: svn path=/head/; revision=339386
* Add clwb().Konstantin Belousov2018-10-161-0/+7
| | | | | | | | | | | Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation Approved by: re (gjb) MFC after: 3 days Differential revision: https://reviews.freebsd.org/D17070 Notes: svn path=/head/; revision=339384
* Reload the LDT selector after an AMD-v #VMEXIT.John Baldwin2018-10-151-0/+13
| | | | | | | | | | | | | | | cpu_switch() always reloads the LDT, so this can only affect the hypervisor process itself. Fix this by explicitly reloading the host LDT selector after each #VMEXIT. The stock bhyve process on FreeBSD never uses a custom LDT, so this change is cosmetic. Reviewed by: kib Tested by: Mike Tancsa <mike@sentex.net> Approved by: re (gjb) MFC after: 2 weeks Notes: svn path=/head/; revision=339364