summaryrefslogtreecommitdiffstats
path: root/sys/i386
Commit message (Collapse)AuthorAgeFilesLines
* MFC 310177: Enable EARLY_AP_STARTUP on amd64 and i386 kernels by default.jhb2017-05-241-0/+1
| | | | | | PR: 199321, 203682 Discussed with: re (kib) Relnotes: yes
* MFC r308474, r308691, r309203, r309365, r309703, r309898, r310720,markj2017-05-231-30/+12
| | | | | r308489, r308706: Add PQ_LAUNDRY and remove PG_CACHED pages.
* MFC efivar(8) (by imp):kib2017-05-201-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | List of revisions merged: r307070 r307071 r307072 r307074 r307189 r307224 r307339 r307390 r307391 r309776 r314231 r314232 r314615 r314616 r314617 r314618 r314619 r314620 r314621 r314623 r314890 r314925 r314926 r314927 r314928 r315770 r315771 Discussed with: gjb (re), imp Sponsored by: The FreeBSD Foundation
* MFC 313564:jhb2017-05-107-7/+8
| | | | | | | | | | | | | 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-291-1/+0
| | | | | Implement Linux mincore() system call. This is necessary for the upcoming drm-next.
* MFC r315505:dchagin2017-04-231-1/+0
| | | | | Implement getrandom() syscall. Note. GRND_RANDOM option is not supported for now.
* MFC r303261,r315059:mmel2017-04-161-0/+3
| | | | | | | | 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-151-31/+0
| | | | To reduce code duplication move socket defines to the MI path.
* MFC r314866:dchagin2017-04-152-155/+0
| | | | | | | | | | | | | 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-151-1/+2
| | | | | | | | | | 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-115-72/+8
| | | | | | Regenerated Linuxulator syscall tables for r314782 Approved by: trasz
* MFC r314782:mmokhi2017-04-112-8/+22
| | | | | | | | 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-061-0/+1
| | | | | | | | | | | | | | | | | | | 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-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-061-1/+0
| | | | | | Stop providing the compat_3_brand. As of r315860, the ELF image activator works fine for CloudABI without it.
* MFC r314312:dchagin2017-03-303-2/+8
| | | | | | | | | | | | 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-301-4/+0
| | | | Implement timerfd family syscalls.
* MFC r314292:dchagin2017-03-305-36/+97
| | | | Regen after r314291 (timerfd definition).
* MFC r314291:dchagin2017-03-301-3/+6
| | | | Change Linuxulator timerfd syscalls definition to match actual Linux one.
* MFC r312986:trasz2017-03-191-4/+1
| | | | | | Replace sys_ftruncate() with kern_ftruncate() in various compats. Sponsored by: DARPA, AFRL
* 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/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-151-1/+0
| | | | Implement rt_tgsigqueueinfo system call used by glibc for pthread_sigqueue(3).
* MFC r303464 (by brooks@):dchagin2017-03-112-13/+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-081-3/+0
| | | | | | 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-725/+0
| | | | Merge i386 and amd64 mtrr drivers.
* MFC r313933, r313939, r313966:kib2017-02-261-3/+3
| | | | | Microoptimize pmap_protect_pde() on amd64, i386 and pmap_protect_pte1() on armv6.
* MFC r313154:kib2017-02-2417-252/+3
| | | | | For i386, remove config options CPU_DISABLE_CMPXCHG, CPU_DISABLE_SSE and device npx.
* 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-227-44/+1805
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 r312952:jah2017-02-172-6/+16
| | | | | | | | Implement get_pcpu() for i386 and use it to replace pcpu_find(curcpu) in the i386 pmap. The curcpu macro loads the per-cpu data pointer as its first step, so the remaining steps of pcpu_find(curcpu) are circular.
* MFC r313109:kib2017-02-093-13/+6
| | | | Use ANSI definitions for some i386 functions.
* MFC r312954:kib2017-02-051-9/+41
| | | | | Do not leave stale 4K TLB entries on pde (superpage) removal or protection change.
* MFC r312555:kib2017-02-032-6/+17
| | | | Use SFENCE for ordering CLFLUSHOPT.
* MFC r311902:markj2017-02-031-8/+17
| | | | Coalesce TLB shootdowns of global PTEs in pmap_advise() on x86.
* MFC r312153, r312191jah2017-01-211-5/+11
| | | | | | | | | | | | | | | | | r312153: For i386 temporary mappings, unpin the thread before releasing the cmap lock. Releasing the lock first may result in the thread being immediately rescheduled and bound to the same CPU, only to unpin itself upon resuming execution. Noted by: skra (in review for armv6 equivalent) r312191: Add comment explaining relative order of sched_unpin() and mtx_unlock(). Suggested by: alc
* 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 r311452:kib2017-01-121-10/+15
| | | | Do not allocate struct statfs on kernel stack.
* MFC r310481:jah2017-01-072-82/+110
| | | | | | | | | | | | | | | | Move the objects used to create temporary mappings for i386 pmap zero and copy operations to the MD PCPU region. Change sysmap initialization to only allocate KVA pages for CPUs that are actually present. As a minor optimization, this also prevents false sharing between adjacent sysmap objects since the pcpu struct is already cacheline-aligned. While here, move pc_qmap_addr initialization for the BSP into pmap_bootstrap(), which allows use of pmap_quick* functions during early boot. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D8833
* MFC r304957, r304958, r306310 (by bde):kib2016-12-281-28/+55
| | | | | | | 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-1/+15
| | | | | | | | | | | | | | | | | | | 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 303753,308004: Add bounds checking on addresses used with /dev/mem.jhb2016-12-021-4/+9
| | | | | | | | | | | 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 307975: Enable EFER_NXE properly on APs.jhb2016-11-231-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | EFER_NXE is set in the EFER MSR by initializecpu() and must be set on all CPUs in the system. When PG_NX support was added to PAE on i386, the block to enable EFER_NXE was placed in a section of initializecpu() that only runs if 'cpu == CPU_686'. During early boot, locore does an initial pass to set cpu that sets it to CPU_686 on all CPUs later than a Pentium. Later, printcpuinfo() adjusts the 'cpu' variable on PII and later CPUs to one of CPU_PII, CPU_PIII, or CPU_P4. However, printcpuinfo() is called after initializecpu() on the BSP, so the BSP would enable EFER_NXE and pg_nx. The APs execute initializecpu() much later after printcpuinfo() has run. The end result on a modern CPU was that cpu was set to CPU_PIII when the APs invoked initializecpu(), so they did not enable EFER_NXE. As a result, the APs would fault when trying to access any pages marked with PG_NX set. When booting a 2 CPU PAE kernel in bhyve this manifested as a hang before single user mode. The attempt to execute /bin/init tried to copy out the exec strings (argv, etc.) to a non-executable mapping while running on the AP. The instruction kept faulting due to invalid bits in the PTE in an infinite loop. Fix this by moving the code to enable EFER_NXE out of the switch statement on 'cpu' and always doing it if 'amd_feature' supports AMDID_NX.
* MFC r308029:kib2016-11-111-10/+22
| | | | Handle pmap_enter() over an existing 4/2M page in KVA on i386.
* 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 305836: Remove 'cpu' and 'cpu_class' on amd64.jhb2016-11-082-0/+6
| | | | | | | | 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-076-30/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* MFC r306680:kib2016-10-241-1/+2
| | | | Reduce the cost of TLB invalidation on x86 by using per-CPU completion flags.
* MFC r303818, r303833, r303941, r304478, r304481, r304483, r304484, r304554,ed2016-10-122-0/+207
| | | | | | | | | | | | | | | | | | r304555, r304556, r304557, r304558, r304559, r304561, r304563, r304564, r304565, r304615, r304742, r304743, r304744, r304745, r304748, r304886, r304991, r305928, r305938, r305987, r306185: Bring CloudABI support back in sync with HEAD. - Add support for running 32-bit executables on amd64, armv6 and i386. - As these new architectures require the use of the vDSO, merge back vDSO support for 64-bit executables running on amd64 and arm64 as well. This has the advantage that support for vDSO-less execution can be phased out when 11.0 becomes unsupported, as opposed to 11.x. This change has been tested by running the cloudlibc unit tests on all supported architectures, which seems to work fine.
OpenPOWER on IntegriCloud