summaryrefslogtreecommitdiffstats
path: root/sys/amd64
Commit message (Collapse)AuthorAgeFilesLines
* MFC r312954:kib2017-02-051-11/+34
| | | | | Do not leave stale 4K TLB entries on pde (superpage) removal or protection change.
* MFC r289894:kib2017-02-033-14/+50
| | | | | | | | CLFLUSH does not need barriers, the instruction is ordered WRT other writes. Use CLFLUSHOPT when available. MFC r312555: Use SFENCE for ordering CLFLUSHOPT.
* MFC r312531: vmm_dev: work around a bogus error with gcc 6.3.0avg2017-01-301-1/+1
|
* MFC r312699:tijl2017-01-271-10/+5
| | | | | | | | | Apply r210555 to 64 bit linux support: The interpreter name should no longer be treated as a buffer that can be overwritten. PR: 216346
* MFC r303583:mjg2016-12-311-10/+3
| | | | | | | | | | amd64: implement pagezero using rep stos The current implementation uses non-temporal writes. This turns out to be detrimental to performance if the page is used shortly after, which is the typical case with page faults. Switch to rep stos.
* MFC 308820,308821: Fixes for fatal page faults on x86.jhb2016-12-231-2/+2
| | | | | | | | | | | | | | | | | | | 308820: Report page faults due to reserved bits in PTEs as a separate fault type. Rather than reporting a page fault due to a bad PTE as a protection violation with the "rsv" flag, treat these faults as a separate type of fault altogether. 308821: MFamd64: Various fatal page fault fixes. - If a page fault is triggered due to reserved bits in a PTE, treat it as a fatal fault and panic. - If PG_NX is in use, report whether a fatal page fault is due to an instruction fetch or a data access. - If a fatal page fault is due to reserved bits in a PTE, report that as the page fault type rather than a protection violation.
* MFC r310205:kib2016-12-211-1/+1
| | | | Fix typo.
* MFC 303753,308004: Add bounds checking on addresses used with /dev/mem.jhb2016-12-022-3/+15
| | | | | | | | | | | 303753: Don't permit mappings of invalid physical addresses on amd64 via /dev/mem. 308004: MFamd64: Add bounds checks on addresses used with /dev/mem. Reject attempts to read from or memory map offsets in /dev/mem that are beyond the maximum-supported physical address of the current CPU.
* MFC r307903,307904,308039,308050: vmm/svm: iopm_bitmap and msr_bitmapavg2016-11-081-4/+5
| | | | must be contiguous in physical memory
* MFC r305539: work around AMD erratum 793 for family 16h, models 00h-0Fhavg2016-10-271-0/+14
|
* Merge r307936:glebius2016-10-251-1/+4
| | | | | | | | | The argument validation in r296956 was not enough to close all possible overflows in sysarch(2). Submitted by: Kun Yang <kun.yang chaitin.com> Patch by: kib Security: SA-16:15
* MFC 305502: Reset PCI pass through devices via PCI-e FLR during VM start/end.jhb2016-09-301-0/+11
| | | | | | | | | | | | Add routines to trigger a function level reset (FLR) of a PCI-express device via the PCI-express device control register. This also includes support routines to wait for pending transactions to complete as well as calculating the maximum completion timeout permitted by a device. Change the ppt(4) driver to reset pass through devices before attaching to a VM during startup and before detaching from a VM during shutdown. Sponsored by: Chelsio Communications
* MFC 304858,305485: Fix various issues with PCI pass through and VT-d.jhb2016-09-304-22/+31
| | | | | | | | | | | | | | | | | | | | | | | | 304858: Enable I/O MMU when PCI pass through is first used. Rather than enabling the I/O MMU when the vmm module is loaded, defer initialization until the first attempt to pass a PCI device through to a guest. If the I/O MMU fails to initialize or is not present, than fail the attempt to pass a PCI device through to a guest. The hw.vmm.force_iommu tunable has been removed since the I/O MMU is no longer enabled during boot. However, the I/O MMU support can be disabled by setting the hw.vmm.iommu.enable tunable to 0 to prevent use of the I/O MMU on any systems where it is buggy. 305485: Leave ppt devices in the host domain when they are not attached to a VM. This allows a pass through device to be reset to a normal device driver on the host and reused on the host. ppt devices are now always active in some I/O MMU domain when the I/O MMU is active, either the host domain or the domain of a VM they are attached to.
* MFC r305939:kib2016-09-211-1/+1
| | | | Remove trailing space.
* MFC 303713: Correct assertion on vcpuid argument to vm_gpa_hold().jhb2016-09-091-1/+1
| | | | PR: 208168
* MFC 304637: Fix build for !SMP kernels after the Xen MSIX workaround.jhb2016-09-091-1/+2
| | | | | | | Move msix_disable_migration under #ifdef SMP since it doesn't make sense for !SMP kernels. PR: 212014
* MFC r303913:kib2016-08-171-2/+2
| | | | | Unconditionally perform checks that FPU region was entered, when #NM exception is caught in kernel mode.
* MFC r302835: fix-up for configuration of AMD Family 10h processorsavg2016-08-151-0/+14
| | | | borrowed from Linux
* MFC 302181,302635: Disable MSI-X migration on older Xen hypervisors.jhb2016-08-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 302181: Add a tunable to disable migration of MSI-X interrupts. The new 'machdep.disable_msix_migration' tunable can be set to 1 to disable migration of MSI-X interrupts. Xen versions prior to 4.6.0 do not properly handle updates to MSI-X table entries after the initial write. In particular, the operation to unmask a table entry after updating it during migration is not propagated to the "real" table for passthrough devices causing the interrupt to remain masked. At least some systems in EC2 are affected by this bug when using SRIOV. The tunable can be set in loader.conf as a workaround. 302635: xen: automatically disable MSI-X interrupt migration If the hypervisor version is smaller than 4.6.0. Xen commits 74fd00 and 70a3cb are required on the hypervisor side for this to be fixed, and those are only included in 4.6.0, so stay on the safe side and disable MSI-X interrupt migration on anything older than 4.6.0. It should not cause major performance degradation unless a lot of MSI-X interrupts are allocated.
* MFC r302517:dchagin2016-07-174-360/+7
| | | | | | | | | | | | | Fix a copy/paste bug introduced during X86_64 Linuxulator work. FreeBSD support NX bit on X86_64 processors out of the box, for i386 emulation use READ_IMPLIES_EXEC flag, introduced in r302515. While here move common part of mmap() and mprotect() code to the files in compat/linux to reduce code dupcliation between Linuxulator's. MFC r302518, r302626: Add linux_mmap.c to the appropriate conf/files.
* Regen for r302962 (Linux personality), record mergeinfo for r320516.dchagin2016-07-1710-14/+14
|
* MFC r302515:dchagin2016-07-172-2/+2
| | | | | | | | Implement Linux personality() system call mainly due to READ_IMPLIES_EXEC flag. In Linux if this flag is set, PROT_READ implies PROT_EXEC for mmap(). Linux/i386 set this flag automatically if the binary requires executable stack. READ_IMPLIES_EXEC flag will be used in the next Linux mmap() commit.
* MFC 301015sephe2016-06-241-1/+0
| | | | | | | | hyperv/vmbus: Rename ISR functions MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6601
* MFC 299912sephe2016-06-231-0/+38
| | | | | | | | atomic: Add testandclear on i386/amd64 Reviewed by: kib Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6381
* MFC 297931,298022sephe2016-06-213-17/+1
| | | | | | | | | | | | | | | | | | | | | 297931 Expose doreti as a global symbol on amd64 and i386. doreti provides the common code path for returning from interrupt andlers on x86. Exposing doreti as a global symbol allows kernel modules to include low-level interrupt handlers instead of requiring all low-level handlers to be statically compiled into the kernel. Submitted by: Howard Su <howard0su@gmail.com> Reviewed by: kib 298022 hyperv: Deprecate HYPERV option by moving Hyper-V IDT vector into vmbus Submitted by: Jun Su <junsu microsoft com> Reviewed by: jhb, kib, sephe Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5910
* MFC r301853:kib2016-06-201-15/+10
| | | | Do not access pv_table array for fictitious pages.
* MFC r301457:kib2016-06-121-4/+7
| | | | Avoid spurious EINVAL in amd64 pmap_change_attr().
* MFC r300415:dchagin2016-06-051-7/+1
| | | | Add macro to convert errno and use it when appropriate.
* MFC r300359, r300360:dchagin2016-06-056-24/+24
| | | | | Correct an argument param of linux_sched_* system calls as a struct l_sched_param does not defined due to it's nature.
* MFC r299249:dchagin2016-05-231-0/+32
| | | | | Add a forgotten in r283424 .eh_frame section with CFI & FDE records to allow stack unwinding through signal handler.
* MFC r300305, r300332:kib2016-05-231-2/+4
| | | | Check for overflow and return EINVAL if detected. Use unsigned index.
* MFC r298737: fix up r300036avg2016-05-171-0/+1
|
* MFC r298736: ensure that initial local apic id is sane on AMD 10h systemsavg2016-05-171-0/+13
|
* MFC r299350:kib2016-05-171-2/+6
| | | | Add locking annotations to amd64 struct md_page members.
* MFC r297857: re-enable AMD Topology extension on certain models ifavg2016-05-042-2/+2
| | | | disabled by BIOS
* MFC r297243: Polish wbwd(4) driver and add more supported chips.mav2016-05-031-1/+0
|
* MFC r298482:pfg2016-04-263-3/+3
| | | | | | Cleanup redundant parenthesis from existing howmany()/roundup() macro uses. Requested by: dchagin
* MFC r297846: [amd64] dtrace_invop handler is to be called only foravg2016-04-261-0/+2
| | | | kernel exceptions
* MFC r294526:hselasky2016-04-071-0/+1
| | | | | | | Add missing atomic wrapper macro. Reviewed by: alfred @ Sponsored by: Mellanox Technologies
* MFC r297062:dchagin2016-03-275-7/+29
| | | | Regen for r297061 (fstatfs64 Linux syscall).
* MFC r297061;dchagin2016-03-272-2/+1
| | | | | | | Implement fstatfs64 system call. PR: 181012 Submitted by: John Wehle
* Merge r296956:glebius2016-03-161-2/+2
| | | | | | | | | | Due to invalid use of a signed intermediate value in the bounds checking during argument validity verification, unbound zero'ing of the process LDT and adjacent memory can be initiated from usermode. Submitted by: CORE Security Patch by: kib Security: SA-16:15
* MFC r296908:kib2016-03-161-3/+4
| | | | Force the desired alignment of the user save area.
* MFC r295966:kib2016-03-091-0/+1
| | | | | | Return dst as the result from memcpy(9) on amd64. PR: 207422
* MFC r294311:kib2016-02-021-9/+12
| | | | | | | | | | | | | | | | Clear whole XMM register file instead of only XMM0. Also clear x87 registers. This brings amd64 on par with i386, providing consistent initial FPU state. PR: 206370 MFC r294312: Use ANSI definitions. Wrap long line. MFC r294313: Adjust i386 comment to match amd64 one after r294311. Approved by: re (gjb)
* MFC r284539, r284630, r284688, r284877, r285217, r285218,grehan2016-02-0110-313/+746
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r286837, r286838, r288470, r288522, r288524, r288826, r289001 Pull in bhyve bug fixes and changes to allow UEFI booting. This provides Windows support. Tested on Intel and AMD with: - Arch Linux i386+amd64 (kernel 4.3.3) - Ubuntu 15.10 server 64-bit - FreeBSD-CURRENT/amd64 20160127 snap - FreeBSD 10.2 i386+amd64 - OpenBSD 5.8 i386+amd64 - SmartOS latest - Windows 10 build 1511' Huge thanks to Yamagi Burmeister who submitted the patch and did the majority of the testing. r284539 - bootrom mem allocation support r284630 - Add SO_REUSEADDR when starting debug port r284688 - Fix a regression in "movs" emulation r284877 - verify_gla() non-zero segment base fix r285217 - Always assert DCD and DSR in the uart r285218 - devmem nodes moved to /dev/vmm.io/ r286837 - Add define for SATA Check-Power-Mode r286838 - Add simple (no-op) SATA cmd emulations r288470 - Increase virtio-blk indirect descs r288522 - Firmware guest query interface r288524 - Fix post-test typo r288826 - Clean up SATA unimplemented cmd msg r289001 - Add -l option to specify userboot path Submitted by: Yamagi Burmeister Approved by: re (kib)
* MFC r294900:delphij2016-01-272-2/+6
| | | | | | | | | | | | | Implement AT_SECURE properly. AT_SECURE auxv entry has been added to the Linux 2.5 kernel to pass a boolean flag indicating whether secure mode should be enabled. 1 means that the program has changes its credentials during the execution. Being exported AT_SECURE used by glibc issetugid() call. Submitted by: imp, dchagin Security: FreeBSD-SA-16:10.linux Security: CVE-2016-1883
* MFC r294620:dchagin2016-01-262-3/+2
| | | | | | | | Fix a typo. MFC r294621: Remove obsolete comment.
* MFC r293045, r293046:ian2016-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the 'env' directive described in config(5) work on all architectures, providing compiled-in static environment data that is used instead of any data passed in from a boot loader. Previously 'env' worked only on i386 and arm xscale systems, because it required the MD startup code to examine the global envmode variable and decide whether to use static_env or an environment obtained from the boot loader, and set the global kern_envp accordingly. Most startup code wasn't doing so. Making things even more complex, some mips startup code uses an alternate scheme that involves calling init_static_kenv() to pass an empty buffer and its size, then uses a series of kern_setenv() calls to populate that buffer. Now all MD startup code calls init_static_kenv(), and that routine provides a single point where envmode is checked and the decision is made whether to use the compiled-in static_kenv or the values provided by the MD code. The routine also continues to serve its original purpose for mips; if a non-zero buffer size is passed the routine installs the empty buffer ready to accept kern_setenv() values. Now if the size is zero, the provided buffer full of existing env data is installed. A NULL pointer can be passed if the boot loader provides no env data; this allows the static env to be installed if envmode is set to do so. Most of the work here is a near-mechanical change to call the init function instead of directly setting kern_envp. A notable exception is in xen/pv.c; that code was originally installing a buffer full of preformatted env data along with its non-zero size (like mips code does), which would have allowed kern_setenv() calls to wipe out the preformatted data. Now it passes a zero for the size so that the buffer of data it installs is treated as non-writeable. Also, revert accidental change that snuck into r293045.
* Regen for r294368.jhb2016-01-209-612/+612
|
OpenPOWER on IntegriCloud