summaryrefslogtreecommitdiffstats
path: root/sys/amd64
Commit message (Collapse)AuthorAgeFilesLines
* MFC 313564:jhb2017-05-108-8/+0
| | | | | | | | | | | | | Drop the "created from" line from files generated by makesyscalls.sh. This information is less useful when the generated files are included in source control along with the source. If needed it can be reconstructed from the $FreeBSD$ tag in the generated file. Removing this information from the generated output permits committing the generated files along with the change to the system call master list without having inconsistent metadata in the generated files. Regenerate the affected files along with the MFC.
* MFC r315957:dchagin2017-04-292-2/+0
| | | | | Implement Linux mincore() system call. This is necessary for the upcoming drm-next.
* MFC r315505:dchagin2017-04-232-2/+0
| | | | | Implement getrandom() syscall. Note. GRND_RANDOM option is not supported for now.
* MFC r303261,r315059:mmel2017-04-162-2/+12
| | | | | | | | r303261: Add more UEFI/e820 memory types from latest specifications. r315059: Split overbloated machep.c to multiple files and do basic cleanup of these fragments.
* MFC r315501:dchagin2017-04-152-75/+0
| | | | To reduce code duplication move socket defines to the MI path.
* MFC r314866:dchagin2017-04-154-307/+2
| | | | | | | | | | | | | Reduce code duplication between MD Linux code by moving SYSV IPC 64-bit related struct definitions out into the MI path. Invert the native ipc structs to the Linux ipc structs convesion logic. Since 64-bit variant of ipc structs has more precision convert native ipc structs to the 64-bit Linux ipc structs and then truncate 64-bit values into the non 64-bit if needed. Unlike Linux, return EOVERFLOW if the values do not fit. Fix SYSV IPC for 64-bit Linuxulator which never sets IPC_64 bit.
* MFC 316644:avatar2017-04-152-2/+4
| | | | | | | | | | Trying to be more compatible with Linux if.h definitions: - renaming l_ifreq::ifru_metric to l_ifreq::ifru_ivalue; - adding a definition for ifr_ifindex which points to l_ifreq::ifru_ivalue. A quick search indicates that Linux already got the above changes since 2.1.14. Reviewed by: kib, marcel, dchagin
* MFC 314783:mmokhi2017-04-1110-290/+34
| | | | | | Regenerated Linuxulator syscall tables for r314782 Approved by: trasz
* MFC r314782:mmokhi2017-04-114-33/+51
| | | | | | | | Add UNIMPLEMENTED() placeholder macro for the syscalls that are not implemented in Linux kernel itself. Cleanup DUMMY() macros. Approved by: trasz
* Improvements for the brand detection and prioritization.kib2017-04-062-1/+2
| | | | | | | | | | | | | | | | | | | MFC r315701 (by ed): Set the interpreter path to /nonexistent. MFC r315749: Adjust r314851 to not require every brand to specify interpreter path. MFC r315753: Add a flag BI_BRAND_ONLY_STATIC to specify that the brand only matches static binaries. MFC r315754: Update r315753 with the proper flag name. MFC r316211: A followup to r315749, two more places where brand->interp_path was accessed unconditionally.
* Bring kernel space CloudABI code in sync with HEAD.ed2017-04-062-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MFC r312353, r312354 and r312355: Sync in the latest CloudABI generated source files. Languages like C++17 and Go provide direct support for slice types: pointer/length pairs. The CloudABI generator now has more complete for this, meaning that for the C binding, pointer/length pairs now use an automatic naming scheme of ${name} and ${name}_len. Apart from this change and some reformatting, the ABI definitions are identical. Binary compatibility is preserved entirely. MFC r315700: Make file descriptor passing work for CloudABI's sendmsg(). Reduce the potential amount of code duplication between cloudabi32 and cloudabi64 by creating a cloudabi_sock_recv() utility function. The cloudabi32 and cloudabi64 modules will then only contain code to convert the iovecs to the native pointer size. In cloudabi_sock_recv(), we can now construct an SCM_RIGHTS cmsghdr in an mbuf and pass that on to kern_sendit(). MFC r315736: Make file descriptor passing for CloudABI's recvmsg() work. Similar to the change for sendmsg(), create a pointer size independent implementation of recvmsg() and let cloudabi32 and cloudabi64 call into it. In case userspace requests one or more file descriptors, call kern_recvit() in such a way that we get the control message headers in an mbuf. Iterate over all of the headers and copy the file descriptors to userspace.
* MFC r315861:ed2017-04-062-2/+0
| | | | | | Stop providing the compat_3_brand. As of r315860, the ELF image activator works fine for CloudABI without it.
* MFC r313769:trasz2017-04-012-1/+414
| | | | | | | Fix definition of linux64 ptrace syscall. Relnotes: yes Sponsored by: DARPA, AFRL
* MFC r313770:trasz2017-04-012-6/+6
| | | | | | Regen after r313769. Sponsored by: DARPA, AFRL
* MFC r313769:trasz2017-04-011-1/+1
| | | | | | Fix definition of linux64 ptrace syscall. Sponsored by: DARPA, AFRL
* MFC r314312:dchagin2017-03-306-4/+16
| | | | | | | | | | | | Change Linux epoll_pwait syscall definition to match Linux actual one. MFC r314313: Regen for r314312 (Linux epoll_pwait). MFC r314314: Return EINVAL in case when an invalid size of signal mask specified.
* MFC r314295:dchagin2017-03-302-8/+0
| | | | Implement timerfd family syscalls.
* MFC r314292:dchagin2017-03-3010-76/+198
| | | | Regen after r314291 (timerfd definition).
* MFC r314291:dchagin2017-03-302-6/+12
| | | | Change Linuxulator timerfd syscalls definition to match actual Linux one.
* MFC r315361 and r315364: Hide MONITORX/MWAITX from guests.grehan2017-03-251-0/+3
| | | | | | | | | | | | | | r315361 Add the AMD MONITORX/MWAITX feature definition introduced in Bulldozer/Ryzen CPUs. r315364 Hide the AMD MONITORX/MWAITX capability. Otherwise, recent Linux guests will use these instructions, resulting in #UD exceptions since bhyve doesn't implement MONITOR/MWAIT exits. This fixes boot-time hangs in recent Linux guests on Ryzen CPUs (and probably Bulldozer aka AMD FX as well).
* MFC r312986:trasz2017-03-191-4/+1
| | | | | | Replace sys_ftruncate() with kern_ftruncate() in various compats. Sponsored by: DARPA, AFRL
* MFC r313993:trasz2017-03-191-14/+21
| | | | | Reimplement linux_arch_prctl() as a wrapper around sysarch(2). This also adds support for LINUX_ARCH_SET_GS.
* MFC r314282:trasz2017-03-191-1/+3
| | | | | Fix linux_fstatfs() to return proper value for f_frsize. Without it, linux df(1) binary from Xenial shows garbage.
* MFC r311169,r311898,r312925,r312973,r312975,r313007,r313040,r313080,mjg2017-03-161-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r313254,r313341 amd64: add atomic_fcmpset == sparc64: add atomic_fcmpset == Implement atomic_fcmpset_* for arm and arm64. == Add atomic_fcmpset_*() inlines for powerpc Summary: atomic_fcmpset_*() is analogous to atomic_cmpset(), but saves off the read value from the target memory location into the 'old' pointer in the case of failure. == i386: add atomic_fcmpset == Don't retry a lost reservation in atomic_fcmpset() The desired behavior of atomic_fcmpset_() is to always exit on error. Instead of retrying on lost reservation, leave the retry to the caller, and return == Add atomic_fcmpset_*() inlines for MIPS atomic_fcmpset_*() is analogous to atomic_cmpset(), but saves off the read value from the target memory location into the 'old' pointer. == i386: fixup fcmpset An incorrect output specifier was used which worked with clang by accident, but breaks with the in-tree gcc version. While here plug a whitespace nit. == Implement atomic_fcmpset_*() for RISC-V. == Use 64bit store instruction in atomic_fcmpset_64.
* MFC r313940:dchagin2017-03-152-2/+0
| | | | Implement rt_tgsigqueueinfo system call used by glibc for pthread_sigqueue(3).
* MFC r313982, r314068:pfg2017-03-142-7/+7
| | | | | | sys: Replace zero with NULL for pointers. Found with: devel/coccinelle
* MFC r303464 (by brooks@):dchagin2017-03-112-10/+0
| | | | | | | | Don't create pointless backups of generated files in "make sysent". Any sensible workflow will include a revision control system from which to restore the old files if required. In normal usage, developers just have to clean up the mess.
* MFC r314219mmokhi2017-03-084-7/+4
| | | | | | Add linux_preadv() and linux_pwritev() syscalls to Linuxulator. Approved by: dchagin
* MFC r314429:kib2017-03-071-0/+1
| | | | Initialize pcb_save for thread0.
* MFC r313898, r313902, r313903, r313934, r314087, r314252:kib2017-03-031-759/+0
| | | | Merge i386 and amd64 mtrr drivers.
* MFC r313960alc2017-02-261-8/+6
| | | | | In pmap_enter(), set the PG_MANAGED flag on the new PTE in one place, rather two places, and do so before the pmap lock is acquired.
* MFC r313933, r313939, r313966:kib2017-02-261-3/+3
| | | | | Microoptimize pmap_protect_pde() on amd64, i386 and pmap_protect_pte1() on armv6.
* MFC r313871royger2017-02-241-1/+6
| | | | | | x86: fix MTRR initialization if EARLY_AP_STARTUP is used Sponsored by: Citrix Systems R&D
* MFC r313284:dchagin2017-02-2214-134/+3080
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update syscall.master to 4.10-rc6. Also fix comments, a typo, and wrong numbering for a few unimplemented syscalls. For 32-bit Linuxulator, socketcall() syscall was historically the entry point for the sockets API. Starting in Linux 4.3, direct syscalls are provided for the sockets API. Enable it. The initial version of patch was provided by trasz@ and extended by me. MFC r313285: Regen after r313284. MFC r313684: Fix r313284. Members of the syscall argument structures are padded to a word size. So, for COMPAT_LINUX32 we should convert user supplied system call arguments which is 32-bit in that case to the array of register_t. MFC r313912: Finish r313684. Convert linux_recv(), linux_send() and linux_accept() system call arguments to the register_t type too.
* MFC r312954:kib2017-02-051-11/+34
| | | | | Do not leave stale 4K TLB entries on pde (superpage) removal or protection change.
* MFC r312555:kib2017-02-032-5/+16
| | | | Use SFENCE for ordering CLFLUSHOPT.
* MFC r311902:markj2017-02-031-8/+18
| | | | Coalesce TLB shootdowns of global PTEs in pmap_advise() on x86.
* 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 307332,312086: Drop support for using mmap() with /dev/kmem.jhb2017-01-181-4/+3
| | | | | | | | | | | | | | | | | | | 307332: Drop support for using mmap() with /dev/kmem. Using the device pager with /dev/kmem is not stable since KVA mappings are transient, but the device pager caches the PA associated with a given offset forever. Interestingly, mips' implementation of memmap() already refused requests for /dev/kmem. Note that kvm_read/kvm_write do not use mmap, but use read and write on /dev/kmem, so this should not affect libkvm users. 312086: Trim a few comments on platforms that did not implement mmap of /dev/kmem. After r307332, no platforms implement mmap for /dev/kmem, so the lack of it for these platforms is no longer unique.
* MFC r305994: Catch up to sys/capability.h rename to sys/capsicum.h in r263232emaste2016-12-301-1/+1
| | | | Also include r305995, reverting an unintended change from r305994.
* MFC r304957, r304958, r306310 (by bde):kib2016-12-281-8/+40
| | | | | | | Fix vm86 initialization. MFC r310050: Improve very early trap handling on amd64.
* 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-2/+1
| | | | Fix typo. Remove spurious blank line.
* MFC 303753,308004: Add bounds checking on addresses used with /dev/mem.jhb2016-12-021-3/+5
| | | | | | | | | | | 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 308142: Move declarations of invpcid_works and pmap_pcid_enabled to pmap.h.jhb2016-11-222-3/+2
| | | | | | Previously these were only declared under #ifdef SMP in <machine/smp.h>. However, these variables are defind in pmap.c unconditionally, and efirt.c references them unconditionally. This fixes non-SMP kernel builds.
* MFC r307866:kib2016-11-081-39/+3
| | | | | | | | | | Handle broadcast NMIs. MFC r307880: Follow-up to r307866. MFC r308030: Use correct cpu id in the banner.
* MFC r307903,307904,308039,308050: vmm/svm: iopm_bitmap and msr_bitmapavg2016-11-081-4/+5
| | | | must be contiguous in physical memory
* MFC 305836: Remove 'cpu' and 'cpu_class' on amd64.jhb2016-11-082-45/+2
| | | | | | | | The 'cpu' and 'cpu_class' variables were always set to the same value on amd64 and are legacy holdovers from i386. Remove them entirely on amd64. Requested by: kib (MFC)
* Merge bde improvements for ddb on x86, mostly for single-stepping andkib2016-11-072-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vm86 mode. MFC r304085 (by bde): Fix the variables $esp, $ds, $es, $fs, $gs and $ss in vm86 mode. Fix PC_REGS() so that printing of instructions works in some useful cases. MFC r304962 (by bde): Expand error messages: print symbol names, parentheses and shift tokens, and negative shift counts. Fix error messages. MFC r305612 (by bde): Fix single-stepping of instructions emulated by vm86. MFC r305661 (by bde): Give the full syntax of the 'count' arg for all commmands that support it. Give the full syntax of the 'addr' arg for these commands and some others. Rename it from 'address' for the generic command. Fix description of how 'count' is supposed to work for the 'break' command. Don't (mis)describe the syntax of the comma for the 'step' command. Expand the description for the generic command. Give the full syntax for the 'examine' command. It was also missing the possible values for the modifier. MFC r305663 (by bde): Fix stopping when the specified breakpoint count is reached. MFC r305665 (by bde): Pass the trap type and code down from db_trap() to db_stop_at_pc() so that the latter can easily determine what the trap type actually is after callers are fixed to encode the type unambigously. MFC r305807 (by bde): Use the MI macro TRAPF_USERMODE() instead of open-coded checks for SEL_UPL and sometimes PSL_VM. Fix logic errors in treating vm86 bioscall mode as kernel mode. The main place checked all the necessary flags, but put the necessary parentheses for the PSL_VM and PCB_VM86CALL checks in the wrong place. MFC r305811 (by bz): Try to fix LINT builds after r305807. MFC r305840 (by bde): Abort single stepping in ddb if the trap is not for single-stepping. MFC r305862 (by bde): Ifdef the new dr6 variable for KDB. MFC r305864 (by bde): Statically initialize the run mode to the one that will become current on first entry. Don't reset to the run mode to STEP_NONE when stopping, and remove STEP_NONE. MFC r305865 (by bde): Fix decoding of tf_rsp on amd64, and move TF_HAS_STACKREGS() to the i386-only section, and fix a comment about the amd64 kernel trapframe not having stackregs. MFC r305897 (by bde): Silently ignore unexpected single-step traps. MFC r306311 (by bde): Determine the operand/address size of %cs in a new function db_segsize(). Use db_segsize() to set the default operand/address size for disassembling. Fix db_print_loc_and_inst() to ask for the normal format and not the alternate in normal operation. Use db_segsize() to avoid trying to print a garbage stack trace if %cs is 16 bits.
OpenPOWER on IntegriCloud