summaryrefslogtreecommitdiffstats
path: root/sys/i386
Commit message (Collapse)AuthorAgeFilesLines
* Rename global cnt to vm_cnt to avoid shadowing.bdrewery2014-03-223-13/+13
| | | | | | | | | | | | | | To reduce the diff struct pcu.cnt field was not renamed, so PCPU_OP(cnt.field) is still used. pc_cnt and pcpu are also used in kvm(3) and vmstat(8). The goal was to not affect externally used KPI. Bump __FreeBSD_version_ in case some out-of-tree module/code relies on the the global cnt variable. Exp-run revealed no ports using it directly. No objection from: arch@ Sponsored by: EMC / Isilon Storage Division
* Remove vestiges of knowing the ISA bus, which we gave up on around 20imp2014-03-192-2/+2
| | | | years ago. Remove redunant copy of isaregs.h.
* Only invoke fasttrap hooks for traps from user mode, and ensure that they'remarkj2014-03-191-19/+21
| | | | | | | | | called with interrupts enabled. Calling fasttrap_pid_probe() with interrupts disabled can lead to deadlock if fasttrap writes to the process' address space. Reviewed by: rpaulo MFC after: 3 weeks
* In kernel config files, it is supposed to be 'options<space><tab>' notimp2014-03-182-4/+4
| | | | | 'options<tab><tab>', per long standing (but recently not so strictly enforced) convention.
* Align all comments in config files on same column. This consistencyimp2014-03-161-195/+195
| | | | | | helps when bits and pieces of GENERIC from i386 or amd64 are cut and pasted into other architecture's config files (which in the case of ARM had gotten rather akimbo).
* Update kernel inclusions of capability.h to use capsicum.h instead; somerwatson2014-03-165-5/+5
| | | | | | | | further refinement is required as some device drivers intended to be portable over FreeBSD versions rely on __FreeBSD_version to decide whether to include capability.h. MFC after: 3 weeks
* Remove AppleTalk support.glebius2014-03-141-1/+0
| | | | | | | | | | AppleTalk was a network transport protocol for Apple Macintosh devices in 80s and then 90s. Starting with Mac OS X in 2000 the AppleTalk was a legacy protocol and primary networking protocol is TCP/IP. The last Mac OS X release to support AppleTalk happened in 2009. The same year routing equipment vendors (namely Cisco) end their support. Thus, AppleTalk won't be supported in FreeBSD 11.0-RELEASE.
* Remove IPX support.glebius2014-03-141-1/+0
| | | | | | | | | | | IPX was a network transport protocol in Novell's NetWare network operating system from late 80s and then 90s. The NetWare itself switched to TCP/IP as default transport in 1998. Later, in this century the Novell Open Enterprise Server became successor of Novell NetWare. The last release that claimed to still support IPX was OES 2 in 2007. Routing equipment vendors (e.g. Cisco) discontinued support for IPX in 2011. Thus, IPX won't be supported in FreeBSD 11.0-RELEASE.
* Delete stray clause 3 (Advertising clause) and renumber while i'mimp2014-03-111-1/+1
| | | | | | here. Approved by: alc@
* Remove clause 3 (the advertising clause), per the regent's letter.imp2014-03-111-1/+1
|
* xen: use the same hypercall mechanism for XEN and XENHVMroyger2014-03-112-8/+9
| | | | | | | | | | | | | | | | | | | Currently XEN (PV) and XENHVM (PVHVM) ports use different ways to issue hypercalls, unify this by filling the hypercall_page under HVM also. Approved by: gibbs Sponsored by: Citrix Systems R&D amd64/include/xen/hypercall.h: - Unify Xen hypercall code by always using the PV way. i386/i386/locore.s: - Define hypercall_page on i386 XENHVM. x86/xen/hvm.c: - Fill hypercall_page on XENHVM kernels using the HVM method (only when running as an HVM guest).
* xen: implement an early timer for Xen PVHroyger2014-03-113-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running as a PVH guest, there's no emulated i8254, so we need to use the Xen PV timer as the early source for DELAY. This change allows for different implementations of the early DELAY function and implements a Xen variant for it. Approved by: gibbs Sponsored by: Citrix Systems R&D dev/xen/timer/timer.c: dev/xen/timer/timer.h: - Implement Xen early delay functions using the PV timer and declare them. x86/include/init.h: - Add hooks for early clock source initialization and early delay functions. i386/i386/machdep.c: pc98/pc98/machdep.c: amd64/amd64/machdep.c: - Set early delay hooks to use the i8254 on bare metal. - Use clock_init (that will in turn make use of init_ops) to initialize the early clock source. amd64/include/clock.h: i386/include/clock.h: - Declare i8254_delay and clock_init. i386/xen/clock.c: - Rename DELAY to i8254_delay. x86/isa/clock.c: - Introduce clock_init that will take care of initializing the early clock by making use of the init_ops hooks. - Move non ISA related delay functions to the newly introduced delay file. x86/x86/delay.c: - Add moved delay related functions. - Implement generic DELAY function that will use the init_ops hooks. x86/xen/pv.c: - Set PVH hooks for the early delay related functions in init_ops. conf/files.amd64: conf/files.i386: conf/files.pc98: - Add delay.c to the kernel build.
* howto_names: unify declarationroyger2014-03-111-18/+1
| | | | | | | | | | | | | | | | | | | | | | | Approved by: gibbs Sponsored by: Citrix Systems R&D boot/i386/efi/bootinfo.c: boot/i386/libi386/bootinfo.c: boot/ia64/common/bootinfo.c: boot/powerpc/ofw/metadata.c: boot/powerpc/ps3/metadata.c: boot/sparc64/loader/metadata.c: boot/uboot/common/metadata.c: boot/userboot/userboot/bootinfo.c: i386/xen/xen_machdep.c: - Include sys/boot.h - Remove custom definition of howto_names. sys/boot.h: - Define howto_names. x86/xen/pv.c: - Include sys/boot.h
* xen: add and enable Xen console for PVH guestsroyger2014-03-112-20/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds and enables the PV console used on XEN kernels to GENERIC/XENHVM kernels in order for it to be used on PVH. Approved by: gibbs Sponsored by: Citrix Systems R&D dev/xen/console/console.c: - Define console_page. - Move xc_printf debug function from i386 XEN code to generic console code. - Rework xc_printf. - Use xen_initial_domain instead of open-coded checks for Dom0. - Gate the attach of the PV console to PV(H) guests. dev/xen/console/xencons_ring.c: - Allow the PV Xen console to output earlier by directly signaling the event channel in start_info if the event channel is not yet initialized. - Use HYPERVISOR_start_info instead of xen_start_info. i386/include/xen/xen-os.h: - Remove prototype for xc_printf since it's now declared in global xen-os.h i386/xen/xen_machdep.c: - Remove previous version of xc_printf. - Remove definition of console_page (now it's defined in the console itself). - Fix some printf formatting errors. x86/xen/pv.c: - Add some early boot debug messages using xc_printf. - Set console_page based on the value passed in start_info. xen/xen-os.h: - Declare console_page and add prototype for xc_printf.
* xen: add PV/PVH kernel entry pointroyger2014-03-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the PV/PVH entry point and the low level functions for PVH early initialization. Approved by: gibbs Sponsored by: Citrix Systems R&D amd64/amd64/genassym.c: - Add __FreeBSD_version define to assym.s so it can be used for the Xen notes. amd64/amd64/locore.S: - Make bootstack global so it can be used from Xen kernel entry point. amd64/amd64/xen-locore.S: - Add Xen notes to the kernel. - Add the Xen PV entry point, that is going to call hammer_time_xen. amd64/include/asmacros.h: - Add ELFNOTE macros. i386/xen/xen_machdep.c: - Define HYPERVISOR_start_info for the XEN i386 PV port, which is going to be used in some shared code between PV and PVH. x86/xen/hvm.c: - Define HYPERVISOR_start_info for the PVH port. x86/xen/pv.c: - Introduce hammer_time_xen which is going to perform early setup for Xen PVH: - Setup shared Xen variables start_info, shared_info and xen_store. - Set guest type. - Create initial page tables as FreeBSD expects to find them. - Call into native init function (hammer_time). xen/xen-os.h: - Declare HYPERVISOR_start_info. conf/files.amd64: - Add amd64/amd64/locore.S and x86/xen/pv.c to the list of files.
* amd64/i386: switch IPI handlers to C code.royger2014-03-114-119/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move asm IPIs handlers to C code, so both Xen and native IPI handlers share the same code. Reviewed by: jhb Approved by: gibbs Sponsored by: Citrix Systems R&D amd64/amd64/apic_vector.S: i386/i386/apic_vector.s: - Remove asm coded IPI handlers and instead call the newly introduced C variants. amd64/amd64/mp_machdep.c: i386/i386/mp_machdep.c: - Add C coded clones to the asm IPI handlers (moved from x86/xen/hvm.c). i386/include/smp.h: amd64/include/smp.h: - Add prototypes for the C IPI handlers. x86/xen/hvm.c: - Move the C IPI handlers to mp_machdep and call those in the Xen IPI handlers. i386/xen/mp_machdep.c: - Add dummy IPI handlers to the i386 Xen PV port (this port doesn't support SMP).
* When the kernel is running in a virtual machine, it cannot rely upon thealc2014-02-221-5/+11
| | | | | | | | | | | | | | | | | | | | processor family to determine if the workaround for AMD Family 10h Erratum 383 should be enabled. To enable virtual machine migration among a heterogeneous collection of physical machines, the hypervisor may have been configured to report an older processor family with a reduced feature set. Effectively, the reported processor family and its features are like a "least common denominator" for the collection of machines. Therefore, when the kernel is running in a virtual machine, instead of relying upon the processor family, we now test for features that prove that the underlying processor is not affected by the erratum. (The features that we test for are unlikely to ever be emulated in software on an affected physical processor.) PR: 186061 Tested by: Simon Matter Discussed with: jhb, neel MFC after: 2 weeks
* After r261980, the local ptr variable in xbox_init() is no longer used,dim2014-02-161-1/+0
| | | | | | breaking the LINT build. Pointy hat to: brueffer
* Upgrade our copy of llvm/clang to 3.4 release. This version supportsdim2014-02-162-2/+2
| | | | | | | | | | | | | | | | | all of the features in the current working draft of the upcoming C++ standard, provisionally named C++1y. The code generator's performance is greatly increased, and the loop auto-vectorizer is now enabled at -Os and -O2 in addition to -O3. The PowerPC backend has made several major improvements to code generation quality and compile time, and the X86, SPARC, ARM32, Aarch64 and SystemZ backends have all seen major feature work. Release notes for llvm and clang can be found here: <http://llvm.org/releases/3.4/docs/ReleaseNotes.html> <http://llvm.org/releases/3.4/tools/clang/docs/ReleaseNotes.html> MFC after: 1 month
* Remove an nve(4)-specific workaround from the xbox port. nfe(4) doesn'tbrueffer2014-02-161-21/+0
| | | | | | need it. Reviewed by: ed
* Retire the nve(4) driver; nfe(4) has been the default driver for NVIDIAbrueffer2014-02-164-5/+1
| | | | | | | nForce MCP adapters for a long time. Yays: jhb, remko, yongari Nays: none on the current and stable lists
* provide fast versions of ffsl and flsl for i386; ffsll and flsll for amd64avg2014-02-141-0/+16
| | | | | | | Reviewed by: jhb MFC after: 10 days X-MFC note: consider thirdparty modules depending on these symbols Sponsored by: HybridCluster
* Add support for managing PCI bus numbers. As with BARs and PCI-PCI bridgejhb2014-02-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | I/O windows, the default is to preserve the firmware-assigned resources. PCI bus numbers are only managed if NEW_PCIB is enabled and the architecture defines a PCI_RES_BUS resource type. - Add a helper API to create top-level PCI bus resource managers for each PCI domain/segment. Host-PCI bridge drivers use this API to allocate bus numbers from their associated domain. - Change the PCI bus and CardBus drivers to allocate a bus resource for their bus number from the parent PCI bridge device. - Change the PCI-PCI and PCI-CardBus bridge drivers to allocate the full range of bus numbers from secbus to subbus from their parent bridge. The drivers also always program their primary bus register. The bridge drivers also support growing their bus range by extending the bus resource and updating subbus to match the larger range. - Add support for managing PCI bus resources to the Host-PCI bridge drivers used for amd64 and i386 (acpi_pcib, mptable_pcib, legacy_pcib, and qpi_pcib). - Define a PCI_RES_BUS resource type for amd64 and i386. Reviewed by: imp MFC after: 1 month
* Don't waste a page of KVA for the boot-time memory test on x86. For amd64,jhb2014-02-114-11/+9
| | | | | | | | reuse the first page of the crashdumpmap as CMAP1/CADDR1. For i386, remove CMAP1/CADDR1 entirely and reuse CMAP3/CADDR3 for the memory test. Reviewed by: alc, peter MFC after: 2 weeks
* Move <machine/apicvar.h> to <x86/apicvar.h>.jhb2014-01-236-228/+5
|
* Add VT kernel configuration to ease testing of vt(9), aka Newconsemaste2014-01-191-0/+14
|
* Add very simple virtio_random(4) driver to harvest entropy from hostbryanv2014-01-181-0/+1
| | | | Reviewed by: markm (random bits only)
* Remove spaces from boot messages when we print the CPU ID/Family/Steppinggavin2014-01-111-5/+5
| | | | | to match the rest of the CPU identification lines, and once again fit into 80 columns in the usual case.
* Nuke symbols.rawpluknet2013-12-171-73/+0
| | | | | | This file seems to be unused since the switch to the ELF binary format. Discussed with: jhb
* Move constants for indices in the local APIC's local vector table fromjhb2013-12-091-9/+0
| | | | apicvar.h to apicreg.h.
* Fix a typo.jhb2013-12-051-1/+1
|
* Enable Hyper-V support in i386 GENERIC.delphij2013-12-051-0/+3
| | | | MFC after: 2 weeks
* Support Hyper-V on i386:delphij2013-12-051-0/+2
| | | | | | | | | | - Add 'hyperv' module into build; - Allow building Hyper-V support as part of the kernel; - Hook Hyper-V build into NOTES. This is intended for MFC if re@ permits. MFC after: 3 days
* Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thiseadler2013-11-301-1/+1
| | | | | | | | | | | | | shifts into the sign bit. Instead use (1U << 31) which gets the expected result. This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD. Discussed with: -arch, rdivacky Reviewed by: cperciva
* Make process descriptors standard part of the kernel. rwhod(8) alreadypjd2013-11-301-1/+0
| | | | | | | | requires process descriptors to work and having PROCDESC in GENERIC seems not enough, especially that we hope to have more and more consumers in the base. MFC after: 3 days
* - For kernel compiled only with KDTRACE_HOOKS and not any lock debuggingattilio2013-11-254-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | option, unbreak the lock tracing release semantic by embedding calls to LOCKSTAT_PROFILE_RELEASE_LOCK() direclty in the inlined version of the releasing functions for mutex, rwlock and sxlock. Failing to do so skips the lockstat_probe_func invokation for unlocking. - As part of the LOCKSTAT support is inlined in mutex operation, for kernel compiled without lock debugging options, potentially every consumer must be compiled including opt_kdtrace.h. Fix this by moving KDTRACE_HOOKS into opt_global.h and remove the dependency by opt_kdtrace.h for all files, as now only KDTRACE_FRAMES is linked there and it is only used as a compile-time stub [0]. [0] immediately shows some new bug as DTRACE-derived support for debug in sfxge is broken and it was never really tested. As it was not including correctly opt_kdtrace.h before it was never enabled so it was kept broken for a while. Fix this by using a protection stub, leaving sfxge driver authors the responsibility for fixing it appropriately [1]. Sponsored by: EMC / Isilon storage division Discussed with: rstone [0] Reported by: rstone [1] Discussed with: philip
* Refactor i386 startup SMAP parsingemaste2013-11-221-33/+50
| | | | | | | | This is a port from amd64 of r258436, and is intended to make diffs (against amd64 and for future UEFI work) easier to review. Reviewed by: jhb@ Sponsored by: The FreeBSD Foundation
* Replace the WEAK_ALIAS() alias with the WEAK_REFERENCE() alias. Use it andandreast2013-11-211-4/+8
| | | | | | get rid of the __CONCAT and CNAME macros. Reviewed by: bde, kib
* Fix accounting for hw.realmem on the i386 and amd64 platforms.gibbs2013-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | sys/i386/i386/machdep.c: sys/amd64/amd64/machdep.c: The value reported by FreeBSD as "real memory" when booting doesn't match what is later reported by sysctl as hw.realmem. This is due to the fact that the value printed during the boot process is fetched from smbios data (when possible), and accounts for holes in physical memory. On the other hand, the value of hw.realmem is unconditionally set to be one larger than the highest page of the physical address space. Fix this by setting hw.realmem to the same value printed during boot, this makes hw.realmem honour it's name and account properly for physical memory present in the system. Submitted by: Roger Pau Monné Reviewed by: gibbs
* x86: Allow users to change PSL_RF via ptrace(PT_SETREGS...)emaste2013-11-143-56/+6
| | | | | | | | | | | | | Debuggers may need to change PSL_RF. Note that tf_eflags is already stored in the signal context during signal handling and PSL_RF previously could be modified via sigreturn, so this change should not provide any new ability to userspace. For background see the thread at: http://lists.freebsd.org/pipermail/freebsd-i386/2007-September/005910.html Reviewed by: jhb, kib Sponsored by: DARPA, AFRL
* Disable building the ctl module for the i386 XEN kernel configurationdim2013-11-111-1/+1
| | | | | | | | for now, since it causes gcc warnings about casting 64 bit bus_addr_t's to 32 bit pointers, and vice versa. Reviewed by: ken MFC after: 3 days
* Fix signal delivery for the iBCS2 binaries. The iBCS2 sysvec useskib2013-11-081-0/+2
| | | | | | | | | | | current FreeBSD signal trampoline, but does not specifies sv_sigcode_base, since shared page is not mapped. This results in the zero %eip for the signal frame. Fall back to calculating %eip as offset from the psstrings when sv_sigcode_base is not initialized. Reported by: Rich Naill <rich@enterprisesystems.net> Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Add bits for the AMD features from CPUID function 0x80000001 ECX,kib2013-11-081-6/+6
| | | | | | | | described in the rev. 3.0 of the Kabini BKDG, document 48751.pdf. Partially based on the patch submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 1 week
* As of r257209, all architectures have defined VM_KMEM_SIZE_SCALE. In otheralc2013-11-081-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | words, every architecture is now auto-sizing the kmem arena. This revision changes kmeminit() so that the definition of VM_KMEM_SIZE_SCALE becomes mandatory and the definition of VM_KMEM_SIZE becomes optional. Replace or eliminate all existing definitions of VM_KMEM_SIZE. With auto-sizing enabled, VM_KMEM_SIZE effectively became an alternate spelling for VM_KMEM_SIZE_MIN on most architectures. Use VM_KMEM_SIZE_MIN for clarity. Change kmeminit() so that the effect of defining VM_KMEM_SIZE is similar to that of setting the tunable vm.kmem_size. Whereas the macros VM_KMEM_SIZE_{MAX,MIN,SCALE} have had the same effect as the tunables vm.kmem_size_{max,min,scale}, the effects of VM_KMEM_SIZE and vm.kmem_size have been distinct. In particular, whereas VM_KMEM_SIZE was overridden by VM_KMEM_SIZE_{MAX,MIN,SCALE} and vm.kmem_size_{max,min,scale}, vm.kmem_size was not. Remedy this inconsistency. Now, VM_KMEM_SIZE can be used to set the size of the kmem arena at compile-time without that value being overridden by auto-sizing. Update the nearby comments to reflect the kmem submap being replaced by the kmem arena. Stop duplicating the auto-sizing formula in every machine- dependent vmparam.h and place it in kmeminit() where auto-sizing takes place. Reviewed by: kib (an earlier version) Sponsored by: EMC / Isilon Storage Division
* Remove references to an unused fasttrap probe hook, and remove themarkj2013-10-311-11/+3
| | | | | | | | corresponding x86 trap type. Userland DTrace probes are currently handled by the other fasttrap hooks (dtrace_pid_probe_ptr and dtrace_return_probe_ptr). Discussed with: rpaulo
* - Provide necessary includes.glebius2013-10-291-0/+1
| | | | | | | - Remove unnecessary includes. Sponsored by: Netflix Sponsored by: Nginx, Inc.
* Import the driver for VT-d DMAR hardware, as specified in the revisionkib2013-10-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1.3 of Intelб╝ Virtualization Technology for Directed I/O Architecture Specification. The Extended Context and PASIDs from the rev. 2.2 are not supported, but I am not aware of any released hardware which implements them. Code does not use queued invalidation, see comments for the reason, and does not provide interrupt remapping services. Code implements the management of the guest address space per domain and allows to establish and tear down arbitrary mappings, but not partial unmapping. The superpages are created as needed, but not promoted. Faults are recorded, fault records could be obtained programmatically, and printed on the console. Implement the busdma(9) using DMARs. This busdma backend avoids bouncing and provides security against misbehaving hardware and driver bad programming, preventing leaks and corruption of the memory by wild DMA accesses. By default, the implementation is compiled into amd64 GENERIC kernel but disabled; to enable, set hw.dmar.enable=1 loader tunable. Code is written to work on i386, but testing there was low priority, and driver is not enabled in GENERIC. Even with the DMAR turned on, individual devices could be directed to use the bounce busdma with the hw.busdma.pci<domain>:<bus>:<device>:<function>.bounce=1 tunable. If DMARs are capable of the pass-through translations, it is used, otherwise, an identity-mapping page table is constructed. The driver was tested on Xeon 5400/5500 chipset legacy machine, Haswell desktop and E5 SandyBridge dual-socket boxes, with ahci(4), ata(4), bce(4), ehci(4), mfi(4), uhci(4), xhci(4) devices. It also works with em(4) and igb(4), but there some fixes are needed for drivers, which are not committed yet. Intel GPUs do not work with DMAR (yet). Many thanks to John Baldwin, who explained me the newbus integration; Peter Holm, who did all testing and helped me to discover and understand several incredible bugs; and to Jim Harris for the access to the EDS and BWG and for listening when I have to explain my findings to somebody. Sponsored by: The FreeBSD Foundation MFC after: 1 month
* Document XENHVM and xenpci are mutually inclusive.gjb2013-10-111-3/+4
| | | | | | Submitted by: gibbs Approved by: re (delphij) Sponsored by: The FreeBSD Foundation
* Remove redundant declarations of szsigcode and sigcode indim2013-10-071-2/+0
| | | | | | | sys/i386/ibcs2/ibcs2_sysvec.c, to silence two gcc warnings. Approved by: re (gjb) MFC after: 3 days
* Remove redundant declaration of force_evtchn_callback() in thedim2013-10-071-3/+0
| | | | | | | i386-specific xen-os.h, to silence a gcc warning. Approved by: re (gjb) MFC after: 3 days
OpenPOWER on IntegriCloud