summaryrefslogtreecommitdiffstats
path: root/sys/i386
Commit message (Collapse)AuthorAgeFilesLines
* Rename definition of HYPERVISOR_VIRT_START to avoid conflict withgibbs2013-08-222-3/+2
| | | | | | | | upstream Xen definition found in xen/interface/arch-x86/xen-x86_32.h. Submitted by: Roger Pau Monné Reviewed by: gibbs MFC after: 2 weeks
* Revert r254501. Instead, reuse the type stability of the struct pmapkib2013-08-222-6/+0
| | | | | | | | | | | which is the part of struct vmspace, allocated from UMA_ZONE_NOFREE zone. Initialize the pmap lock in the vmspace zone init function, and remove pmap lock initialization and destruction from pmap_pinit() and pmap_release(). Suggested and reviewed by: alc (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation
* The PADLOCK_RNG and RDRAND_RNG kernel options are now devices.obrien2013-08-212-2/+4
| | | | | | | | | Thus "device padlock_rng" and "device rdrand_rng" should be used instead of "options PADLOCK_RNG" & "options RDRAND_RNG". Requested by: so@ (des) Submitted by: obrien, arthurmesh@gmail.com Obtained from: Juniper Networks
* Reimplement atomic operations on PDEs and PTEs in pmap.h. This changejkim2013-08-211-84/+13
| | | | | | significantly reduces duplicate code and make it easier to read. Reviewed by: alc, bde
* Implement atomic_cmpset_64() and atomic_swap_64() for i386.jkim2013-08-211-0/+113
|
* Reimplement atomic_load_acq_64() and atomic_store_rel_64() for i386. Thesejkim2013-08-212-99/+110
| | | | | | | functions are now real functions rather than function pointers. Supposedly, it is faster for modern processors. Suggested by: bde
* Remove empty lines before return statements for style consistency.jkim2013-08-211-6/+0
|
* Implement atomic_swap() and atomic_testandset().jkim2013-08-211-19/+43
| | | | Reviewed by: arch, bde, jilles, kib
* - Remove the "a" constraint from main output operand for atomic_cmpset().jkim2013-08-211-5/+5
| | | | - Use "+" modifier for the "expect" because it is also an output (unused).
* Use '+' modifier for a memory operand that is both an input and an output.jkim2013-08-211-29/+21
| | | | | | It was actually done in r86301 but reverted in r150182 because GCC 3.x was not able to handle it for a memory operand. Apparently, this problem was fixed in GCC 4.1+ and several contrib sources already rely on this feature.
* Remove bogus labels. No functional change.jkim2013-08-211-1/+0
|
* Use consistent style. No functional change.jkim2013-08-211-10/+10
|
* Add process descriptors support to the GENERIC kernel. It is already beingpjd2013-08-181-0/+1
| | | | | | | | | used by the tools in base systems and with sandboxing more and more tools the usage should only increase. Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org> Sponsored by: Google Summer of Code 2013 MFC after: 1 month
* libc: Access _logname_valid more efficiently.jilles2013-08-171-1/+2
| | | | | | | | | | | The variable _logname_valid is not exported via the version script; therefore, change C and i386/amd64 assembler code to remove indirection (which allowed interposition). This makes the code slightly smaller and faster. Also, remove #define PIC_GOT from i386/amd64 in !PIC mode. Without PIC, there is no place containing the address of each variable, so there is no possible definition for PIC_GOT.
* Simplify check for CMPXCHG8B instruction. Note CMPXCHG8B instruction isjkim2013-08-152-2/+17
| | | | always available for Rise mP6 processors although it is not set by CPUID.
* Merge acpica_machdep.h for amd64 and i386 and move to x86. In fact, thesejkim2013-08-131-97/+3
| | | | two files were functionally identical.
* Tidy up global locks for ACPICA. There is no functional change.jkim2013-08-131-3/+3
|
* Different consumers of the struct vm_page abuse pageq member to keepkib2013-08-101-43/+46
| | | | | | | | | | | | | | | | | additional information, when the page is guaranteed to not belong to a paging queue. Usually, this results in a lot of type casts which make reasoning about the code correctness harder. Sometimes m->object is used instead of pageq, which could cause real and confusing bugs if non-NULL m->object is leaked. See r141955 and r253140 for examples. Change the pageq member into a union containing explicitly-typed members. Use them instead of type-punning or abusing m->object in x86 pmaps, uma and vm_page_alloc_contig(). Requested and reviewed by: alc Sponsored by: The FreeBSD Foundation
* On all the architectures, avoid to preallocate the physical memoryattilio2013-08-091-4/+10
| | | | | | | | | | | | | | | | | | | | | for nodes used in vm_radix. On architectures supporting direct mapping, also avoid to pre-allocate the KVA for such nodes. In order to do so make the operations derived from vm_radix_insert() to fail and handle all the deriving failure of those. vm_radix-wise introduce a new function called vm_radix_replace(), which can replace a leaf node, already present, with a new one, and take into account the possibility, during vm_radix_insert() allocation, that the operations on the radix trie can recurse. This means that if operations in vm_radix_insert() recursed vm_radix_insert() will start from scratch again. Sponsored by: EMC / Isilon storage division Reviewed by: alc (older version) Reviewed by: jeff Tested by: pho, scottl
* The soft and hard busy mechanism rely on the vm object lock to work.attilio2013-08-092-24/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify the 2 concept into a real, minimal, sxlock where the shared acquisition represent the soft busy and the exclusive acquisition represent the hard busy. The old VPO_WANTED mechanism becames the hard-path for this new lock and it becomes per-page rather than per-object. The vm_object lock becames an interlock for this functionality: it can be held in both read or write mode. However, if the vm_object lock is held in read mode while acquiring or releasing the busy state, the thread owner cannot make any assumption on the busy state unless it is also busying it. Also: - Add a new flag to directly shared busy pages while vm_page_alloc and vm_page_grab are being executed. This will be very helpful once these functions happen under a read object lock. - Move the swapping sleep into its own per-object flag The KPI is heavilly changed this is why the version is bumped. It is very likely that some VM ports users will need to change their own code. Sponsored by: EMC / Isilon storage division Discussed with: alc Reviewed by: jeff, kib Tested by: gavin, bapt (older version) Tested by: pho, scottl
* follow up to r254051avg2013-08-091-2/+1
| | | | | | | | - update powerpc/GENERIC64 as well, suggested by mdf - update comments so that they make sense after the change, suggested by jhb X-MFC after: never (change specific to head)
* enable KDB_TRACE in GENERICsavg2013-08-071-1/+1
| | | | | | | KDB_TRACE is not an alternative to DDB/etc, they are complementary. So I do not see any reason to not enable KDB_TRACE by default. X-MFC after: never (change specific to head)
* Replace kernel virtual address space allocation with vmem. This providesjeff2013-08-079-40/+38
| | | | | | | | | | | | | transparent layering and better fragmentation. - Normalize functions that allocate memory to use kmem_* - Those that allocate address space are named kva_* - Those that operate on maps are named kmap_* - Implement recursive allocation handling for kmem_arena in vmem. Reviewed by: alc Tested by: pho Sponsored by: EMC / Isilon Storage Division
* - Introduce a specific function, pmap_remove_kernel_pde, for removingjeff2013-08-051-2/+39
| | | | | | | | | | huge pages in the kernel's address space. This works around several asserts from pmap_demote_pde_locked that did not apply and gave false warnings. Discovered by: pho Reviewed by: alc Sponsored by: EMC / Isilon Storage Division
* Back out r253779 & r253786.obrien2013-07-313-3/+1
|
* Decouple yarrow from random(4) device.obrien2013-07-293-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make Yarrow an optional kernel component -- enabled by "YARROW_RNG" option. The files sha2.c, hash.c, randomdev_soft.c and yarrow.c comprise yarrow. * random(4) device doesn't really depend on rijndael-*. Yarrow, however, does. * Add random_adaptors.[ch] which is basically a store of random_adaptor's. random_adaptor is basically an adapter that plugs in to random(4). random_adaptor can only be plugged in to random(4) very early in bootup. Unplugging random_adaptor from random(4) is not supported, and is probably a bad idea anyway, due to potential loss of entropy pools. We currently have 3 random_adaptors: + yarrow + rdrand (ivy.c) + nehemeiah * Remove platform dependent logic from probe.c, and move it into corresponding registration routines of each random_adaptor provider. probe.c doesn't do anything other than picking a specific random_adaptor from a list of registered ones. * If the kernel doesn't have any random_adaptor adapters present then the creation of /dev/random is postponed until next random_adaptor is kldload'ed. * Fix randomdev_soft.c to refer to its own random_adaptor, instead of a system wide one. Submitted by: arthurmesh@gmail.com, obrien Obtained from: Juniper Networks Reviewed by: obrien
* Revert r253748,253749avg2013-07-281-2/+1
| | | | | | This WIP should not have been committed yet. Pointyhat to: avg
* put contents of cpu.h under _KERNELavg2013-07-281-1/+2
| | | | | | no userland-serviceable parts inside MFC after: 20 days
* x86: detect mwait capabilities and extensions, when presentavg2013-07-283-0/+13
| | | | | Reviewed by: kib (earlier amd64-only version) MFC after: 2 weeks
* - Use kmem_malloc rather than kmem_alloc() for GDT/LDT/tss allocations etc.jeff2013-07-261-7/+9
| | | | | | | | | This eliminates some unusual uses of that API in favor of more typical uses of kmem_malloc(). Discussed with: kib/alc Tested by: pho Sponsored by: EMC / Isilon Storage Division
* Include sys/systm.h after sys/param.h.ae2013-07-151-1/+1
| | | | Suggested by: pluknet
* Nuke mbstat. It wasn't used for mbuf statistics since FreeBSD 5.glebius2013-07-151-1/+0
| | | | | | Now that r253351 moved sendfile() stats to a separate struct, the last field used in mbstat is m_mcfail, which is updated, but never read or obtained from userland.
* Introduce new structure sfstat for collecting sendfile's statisticsae2013-07-151-1/+1
| | | | | | | and remove corresponding fields from struct mbstat. Use PCPU counters and SFSTAT_INC() macro for update these statistics. Discussed with: glebius
* Create a proper stack frame for i386 version of bcopy(), despite thekib2013-07-131-5/+9
| | | | | | | | | | | function is leaf. The frame allows ddb to not loose the direct caller of bcopy() in backtrace. Other functions from support.s would benefit from the same change as well, but for now bcopy() is the most frequent offender. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Explicitely panic instead of possibly doing undefined things whenkib2013-07-111-1/+1
| | | | | | | | ptelist KVA is exhausted. Currently this cannot happen, the added panic serves as assert. Discussed with: alc Sponsored by: The FreeBSD Foundation
* MFamd64 r253140:kib2013-07-111-0/+1
| | | | | | | Clear m->object for the page taken from the delayed free list in pmap_pv_reclaim(). Noted by: alc
* Import HighPoint DC Series Data Center HBA (DC7280 and R750) driver.delphij2013-07-064-1/+7
| | | | | | | | This driver works for FreeBSD/i386 and FreeBSD/amd64 platforms. Many thanks to HighPoint for providing this driver. MFC after: 1 day
* Fix issues with zeroing and fetching the counters, on x86 and ppc64.kib2013-07-011-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issues were noted by Bruce Evans and are present on all architectures. On i386, a counter fetch should use atomic read of 64bit value, otherwise carry from the increment on other CPU could be lost for the given fetch, making error of 2^32. If 64bit read (cmpxchg8b) is not available on the machine, it cannot be SMP and it is enough to disable preemption around read to avoid the split read. On x86 the counter increment is not atomic on purpose, which makes it possible for the store of the incremented result to override just zeroed per-cpu slot. The effect would be a counter going off by arbitrary value after zeroing. Perform the counter zeroing on the same processor which does the increments, making the operations mutually exclusive. On i386, same as for the fetching, if the cmpxchg8b is not available, machine is not SMP and we disable preemption for zeroing. PowerPC64 is treated the same as amd64. For other architectures, the changes made to allow the compilation to succeed, without fixing the issues with zeroing or fetching. It should be possible to handle them by using the 64bit loads and stores atomic WRT preemption (assuming the architectures also converted from using critical sections to proper asm). If architecture does not provide the facility, using global (spin) mutex would be non-optimal but working solution. Noted by: bde Sponsored by: The FreeBSD Foundation
* Move definitions required by userland applications out of acpica_machdep.h.jkim2013-06-271-6/+2
|
* Some clarifications and updates for the comments, mostly retrievedkib2013-06-191-30/+34
| | | | | | from Bruce Evans. Trim the trailing spaces. MFC after: 1 week
* Adjust i386 Xen PV support for updated Xen interface files.gibbs2013-06-172-4/+4
| | | | | | | | | | | sys/i386/include/xen/xenvar.h: sys/i386/xen/xen_machdep.c: sys/xen/interface/foreign/structs.py: sys/xen/evtchn/evtchn.c: MAX_VIRT_CPUS => XEN_LEGACY_MAX_VCPUS Submitted by: Roger Pau Monné Reviewed by: gibbs
* Upgrade Xen interface headers to Xen 4.2.1.gibbs2013-06-141-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move FreeBSD from interface version 0x00030204 to 0x00030208. Updates are required to our grant table implementation before we can bump this further. sys/xen/hvm.h: Replace the implementation of hvm_get_parameter(), formerly located in sys/xen/interface/hvm/params.h. Linux has a similar file which primarily stores this function. sys/xen/xenstore/xenstore.c: Include new xen/hvm.h header file to get hvm_get_parameter(). sys/amd64/include/xen/xen-os.h: sys/i386/include/xen/xen-os.h: Correctly protect function definition and variables from being included into assembly files in xen-os.h Xen memory barriers are now prefixed with "xen_" to avoid conflicts with OS native primatives. Define Xen memory barriers in terms of the native FreeBSD primatives. Sponsored by: Spectra Logic Corporation Reviewed by: Roger Pau Monné Tested by: Roger Pau Monné Obtained from: Roger Pau Monné (bug fixes)
* - Add a BIT_FFS() macro and use it to replace cpusetffs_obj()jeff2013-06-134-6/+6
| | | | | Discussed with: attilio Sponsored by: EMC / Isilon Storage Division
* Assert that interrupts are enabled in the trap handlers on x86 beforekib2013-06-031-0/+1
| | | | | | | | calling generic code to deliver signals. Discussed with: bde Tested by: pho MFC after: 1 week
* MFamd64: when printing the trap information, show the %esp value.kib2013-06-031-2/+2
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Use slightly more idiomatic expression to get the address of array.kib2013-05-271-1/+1
| | | | | | Tested by: dim, pgj Sponsored by: The FreeBSD Foundation MFC after: 1 week
* When handling an exception from the attempt from loading the faultingkib2013-05-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | context on return from the trap handler, re-enable the interrupts on i386 and amd64. The trap return path have to disable interrupts since the sequence of loading the machine state is not atomic. The trap() function which transfers the control to the special handler would enable the interrupt, but an iret loads the previous eflags with PSL_I clear. Then, the special handler calls trap() on its own, which now sees the original eflags with PSL_I set and does not enable interrupts. The end result is that signal delivery and process exiting code could be executed with interrupts disabled, which is generally wrong and triggers several assertions. For amd64, the interrupts are enabled conditionally based on PSL_I in the eflags of the outer frame, as it is already done for doreti_iret_fault. For i386, the interrupts are enabled unconditionally, the ast loop could have opened a window with interrupts enabled just before the iret anyway. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week
* Driver 'aacraid' added. Supports Adaptec by PMC RAID controller families ↵achim2013-05-242-0/+5
| | | | | | Series 6, 7, 8 and upcoming products. Older Adaptec RAID controller families are supported by the 'aac' driver. Approved by: scottl (mentor)
* o Relax locking assertions for vm_page_find_least()attilio2013-05-212-2/+4
| | | | | | | | | | | | o Relax locking assertions for pmap_enter_object() and add them also to architectures that currently don't have any o Introduce VM_OBJECT_LOCK_DOWNGRADE() which is basically a downgrade operation on the per-object rwlock o Use all the mechanisms above to make vm_map_pmap_enter() to work mostl of the times only with readlocks. Sponsored by: EMC / Isilon storage division Reviewed by: alc
* Add basic support for FDT to i386 & amd64. This change includes:marcel2013-05-214-0/+21
| | | | | | | | | | | | | | | | | | | | | | 1. Common headers for fdt.h and ofw_machdep.h under x86/include with indirections under i386/include and amd64/include. 2. New modinfo for loader provided FDT blob. 3. Common x86_init_fdt() called from hammer_time() on amd64 and init386() on i386. 4. Split-off FDT specific low-level console functions from FDT bus methods for the uart(4) driver. The low-level console logic has been moved to uart_cpu_fdt.c and is used for arm, mips & powerpc only. The FDT bus methods are shared across all architectures. 5. Add dev/fdt/fdt_x86.c to hold the fdt_fixup_table[] and the fdt_pic_table[] arrays. Both are empty right now. FDT addresses are I/O ports on x86. Since the core FDT code does not handle different address spaces, adding support for both I/O ports and memory addresses requires some thought and discussion. It may be better to use a compile-time option that controls this. Obtained from: Juniper Networks, Inc.
OpenPOWER on IntegriCloud