aboutsummaryrefslogtreecommitdiff
path: root/sys/i386
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove the old kernel RPC implementation and the NFS_LEGACYRPC option.Doug Rabson2009-06-301-1/+0
| | | | | | | Approved by: re Notes: svn path=/head/; revision=195202
* Replace AUDIT_ARG() with variable argument macros with a set more moreRobert Watson2009-06-271-1/+1
| | | | | | | | | | | | | | | | | specific macros for each audit argument type. This makes it easier to follow call-graphs, especially for automated analysis tools (such as fxr). In MFC, we should leave the existing AUDIT_ARG() macros as they may be used by third-party kernel modules. Suggested by: brooks Approved by: re (kib) Obtained from: TrustedBSD Project MFC after: 1 week Notes: svn path=/head/; revision=195104
* Return ENOSYS instead of EINVAL for invalid function codes to match theJohn Baldwin2009-06-261-4/+1
| | | | | | | | | | behavior of Linux. Reported by: Alexander Best alexbestms of math.uni-muenster.de Approved by: re (kib) Notes: svn path=/head/; revision=195074
* Correct the #endif comment.Alan Cox2009-06-261-1/+1
| | | | | | | | Noticed by: jmallett Approved by: re (kib) Notes: svn path=/head/; revision=195060
* This change is the next step in implementing the cache control functionalityAlan Cox2009-06-261-0/+45
| | | | | | | | | | | | | | required by video card drivers. Specifically, this change introduces vm_cache_mode_t with an appropriate VM_CACHE_DEFAULT definition on all architectures. In addition, this changes adds a vm_cache_mode_t parameter to kmem_alloc_contig() and vm_phys_alloc_contig(). These will be the interfaces for allocating mapped kernel memory and physical memory, respectively, with non-default cache modes. In collaboration with: jhb Notes: svn path=/head/; revision=195033
* Fix kernels compiled without SMP support. Make intr_next_cpu() availableJohn Baldwin2009-06-252-2/+10
| | | | | | | | | | for UP kernels but as a stub that always returns the single CPU's local APIC ID. Reported by: kib Notes: svn path=/head/; revision=195002
* - Restore the behavior of pre-allocating IDT vectors for MSI interrupts.John Baldwin2009-06-254-55/+77
| | | | | | | | | | | | | | | | | | | | | This is mostly important for the multiple MSI message case where the IDT vectors for the entire group need to be allocated together. This also restores the assumptions made by the PCI bus code that it could invoke PCIB_MAP_MSI() once MSI vectors were allocated. - To avoid whiplash with CPU assignments, change the way that CPUs are assigned to interrupt sources on activation. Instead of assigning the CPU via pic_assign_cpu() before calling enable_intr(), allow the different interrupt source drivers to ask the MD interrupt code which CPU to use when they allocate an IDT vector. I/O APIC interrupt pins do this in their pic_enable_intr() routines giving the same behavior as before. MSI sources do it when the IDT vectors are allocated during msi_alloc() and msix_alloc(). - Change the intr_table_lock from an sx lock to a mutex. Tested by: rnoland Notes: svn path=/head/; revision=194985
* Fix ibcs2_ipc.c build by adding missing limits.h include.Robert Watson2009-06-251-0/+1
| | | | | | | Submitted by: keramida Notes: svn path=/head/; revision=194942
* Change the ABI of some of the structures used by the SYSV IPC API:John Baldwin2009-06-241-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The uid/cuid members of struct ipc_perm are now uid_t instead of unsigned short. - The gid/cgid members of struct ipc_perm are now gid_t instead of unsigned short. - The mode member of struct ipc_perm is now mode_t instead of unsigned short (this is merely a style bug). - The rather dubious padding fields for ABI compat with SV/I386 have been removed from struct msqid_ds and struct semid_ds. - The shm_segsz member of struct shmid_ds is now a size_t instead of an int. This removes the need for the shm_bsegsz member in struct shmid_kernel and should allow for complete support of SYSV SHM regions >= 2GB. - The shm_nattch member of struct shmid_ds is now an int instead of a short. - The shm_internal member of struct shmid_ds is now gone. The internal VM object pointer for SHM regions has been moved into struct shmid_kernel. - The existing __semctl(), msgctl(), and shmctl() system call entries are now marked COMPAT7 and new versions of those system calls which support the new ABI are now present. - The new system calls are assigned to the FBSD-1.1 version in libc. The FBSD-1.0 symbols in libc now refer to the old COMPAT7 system calls. - A simplistic framework for tagging system calls with compatibility symbol versions has been added to libc. Version tags are added to system calls by adding an appropriate __sym_compat() entry to src/lib/libc/incldue/compat.h. [1] PR: kern/16195 kern/113218 bin/129855 Reviewed by: arch@, rwatson Discussed with: kan, kib [1] Notes: svn path=/head/; revision=194910
* Whitespace fix.John Baldwin2009-06-241-0/+1
| | | | Notes: svn path=/head/; revision=194889
* Make algorithm a bit more bulletproof.Alexander Motin2009-06-231-2/+2
| | | | Notes: svn path=/head/; revision=194790
* Implement a facility for dynamic per-cpu variables.Jeff Roberson2009-06-234-5/+18
| | | | | | | | | | | | | | | | | | - Modules and kernel code alike may use DPCPU_DEFINE(), DPCPU_GET(), DPCPU_SET(), etc. akin to the statically defined PCPU_*. Requires only one extra instruction more than PCPU_* and is virtually the same as __thread for builtin and much faster for shared objects. DPCPU variables can be initialized when defined. - Modules are supported by relocating the module's per-cpu linker set over space reserved in the kernel. Modules may fail to load if there is insufficient space available. - Track space available for modules with a one-off extent allocator. Free may block for memory to allocate space for an extent. Reviewed by: jhb, rwatson, kan, sam, grehan, marius, marcel, stas Notes: svn path=/head/; revision=194784
* Rework r193814:Alexander Motin2009-06-231-36/+32
| | | | | | | | | | | | | | While general idea of patch was good, it was not working properly due the way it was implemented. When we are using same timer interrupt for several of hard/prof/stat purposes we should not send several IPIs same time to other CPUs. Sending several IPIs same time leads to terrible accounting/profiling results due to strong synchronization effect, when the second interrupt handler accounts processing of the first one. Interlink timer events in a such way, that no more then one IPI is sent for any original timer interrupt. Notes: svn path=/head/; revision=194772
* * Driver for ACPI WMI (Windows Management Instrumentation)Rui Paulo2009-06-231-0/+6
| | | | | | | | | | | | * Driver for ACPI HP extra functionations, which required ACPI WMI driver. Submitted by: Michael <freebsdusb at bindone.de> Approved by: re MFC after: 2 weeks Notes: svn path=/head/; revision=194701
* Eliminate dead code. These definitions should have been deleted with theAlan Cox2009-06-221-10/+0
| | | | | | | | | introduction of i686_mem.c in r45405. Merge adjacent #ifdef _KERNEL/#endif blocks. Notes: svn path=/head/; revision=194611
* Use NGROUPS instead of NGROUPS_MAX as the limits on setgroups andBrooks Davis2009-06-201-2/+2
| | | | | | | | | getgroups for ibcs emulation. It seems vanishingly likely any programs will actually be affected since they probably assume a much lower value and use a static array size. Notes: svn path=/head/; revision=194552
* Rework the credential code to support larger values of NGROUPS andBrooks Davis2009-06-191-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NGROUPS_MAX, eliminate ABI dependencies on them, and raise the to 1024 and 1023 respectively. (Previously they were equal, but under a close reading of POSIX, NGROUPS_MAX was defined to be too large by 1 since it is the number of supplemental groups, not total number of groups.) The bulk of the change consists of converting the struct ucred member cr_groups from a static array to a pointer. Do the equivalent in kinfo_proc. Introduce new interfaces crcopysafe() and crsetgroups() for duplicating a process credential before modifying it and for setting group lists respectively. Both interfaces take care for the details of allocating groups array. crsetgroups() takes care of truncating the group list to the current maximum (NGROUPS) if necessary. In the future, crsetgroups() may be responsible for insuring invariants such as sorting the supplemental groups to allow groupmember() to be implemented as a binary search. Because we can not change struct xucred without breaking application ABIs, we leave it alone and introduce a new XU_NGROUPS value which is always 16 and is to be used or NGRPS as appropriate for things such as NFS which need to use no more than 16 groups. When feasible, truncate the group list rather than generating an error. Minor changes: - Reduce the number of hand rolled versions of groupmember(). - Do not assign to both cr_gid and cr_groups[0]. - Modify ipfw to cache ucreds instead of part of their contents since they are immutable once referenced by more than one entity. Submitted by: Isilon Systems (initial implementation) X-MFC after: never PR: bin/113398 kern/133867 Notes: svn path=/head/; revision=194498
* Regen for added flags field.John Baldwin2009-06-172-78/+78
| | | | Notes: svn path=/head/; revision=194391
* Move (read|write)_cyrix_reg() inlines from specialreg.h to cpufunc.h.John Baldwin2009-06-162-16/+16
| | | | | | | specialreg.h now consists solely of register-related macros. Notes: svn path=/head/; revision=194295
* Forbid multi-vector MSI interrupt vectors migration to another CPU onceAlexander Motin2009-06-151-0/+2
| | | | | | | | | | | allocated. MSI have strict vectors allocation requirements, which are not satisfied now during reallocation. This is not the best possible solution, but better then just broken, as it was. No objections: current@, arch@, jhb@ Notes: svn path=/head/; revision=194237
* Long, long ago in r27464 special case code for mapping device-backedAlan Cox2009-06-141-41/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | memory with 4MB pages was added to pmap_object_init_pt(). This code assumes that the pages of a OBJT_DEVICE object are always physically contiguous. Unfortunately, this is not always the case. For example, jhb@ informs me that the recently introduced /dev/ksyms driver creates a OBJT_DEVICE object that violates this assumption. Thus, this revision modifies pmap_object_init_pt() to abort the mapping if the OBJT_DEVICE object's pages are not physically contiguous. This revision also changes some inconsistent if not buggy behavior. For example, the i386 version aborts if the first 4MB virtual page that would be mapped is already valid. However, it incorrectly replaces any subsequent 4MB virtual page mappings that it encounters, potentially leaking a page table page. The amd64 version has a bug of my own creation. It potentially busies the wrong page and always an insufficent number of pages if it blocks allocating a page table page. To my knowledge, there have been no reports of these bugs, hence, their persistance. I suspect that the existing restrictions that pmap_object_init_pt() placed on the OBJT_DEVICE objects that it would choose to map, for example, that the first page must be aligned on a 2 or 4MB physical boundary and that the size of the mapping must be a multiple of the large page size, were enough to avoid triggering the bug for drivers like ksyms. However, one side effect of testing the OBJT_DEVICE object's pages for physical contiguity is that a dubious difference between pmap_object_init_pt() and the standard path for mapping devices pages, i.e., vm_fault(), has been eliminated. Previously, pmap_object_init_pt() would only instantiate the first PG_FICTITOUS page being mapped because it never examined the rest. Now, however, pmap_object_init_pt() uses the new function vm_object_populate() to instantiate them all (in order to support testing their physical contiguity). These pages need to be instantiated for the mechanism that I have prototyped for automatically maintaining the consistency of the PAT settings across multiple mappings, particularly, amd64's direct mapping, to work. (Translation: This change is also being made to support jhb@'s work on the Nvidia feature requests.) Discussed with: jhb@ Notes: svn path=/head/; revision=194209
* Enable PRINTF_BUFR_SIZE on i386 and amd64 by default.Ed Schouten2009-06-141-0/+1
| | | | | | | | | | | In the past there have been some reports of PRINTF_BUFR_SIZE not functioning correctly. Instead of having garbled console messages, we should just see whether the issues are still there and analyze them. Approved by: re Notes: svn path=/head/; revision=194204
* Clobber "cc" instead of using volatile.Ed Schouten2009-06-131-2/+2
| | | | | | | Submitted by: Christoph Mallon Notes: svn path=/head/; revision=194115
* Clobber "cc" instead of using volatile; remove obsolete register keyword.Ed Schouten2009-06-131-7/+8
| | | | | | | Submitted by: Christoph Mallon Notes: svn path=/head/; revision=194111
* Simplify the inline assembler (and correct potential error) of pte_load_store().Ed Schouten2009-06-131-9/+2
| | | | | | | Submitted by: Christoph Mallon Notes: svn path=/head/; revision=194110
* strict kobj signatures: fix legacy i386 pcib_write_config implAndriy Gapon2009-06-112-8/+8
| | | | | | | | Reviewed by: imp, current@ Approved by: jhb (mentor) Notes: svn path=/head/; revision=194018
* Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. UseKonstantin Belousov2009-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | vnode interlock to protect the knote fields [1]. The locking assumes that shared vnode lock is held, thus we get exclusive access to knote either by exclusive vnode lock protection, or by shared vnode lock + vnode interlock. Do not use kl_locked() method to assert either lock ownership or the fact that curthread does not own the lock. For shared locks, ownership is not recorded, e.g. VOP_ISLOCKED can return LK_SHARED for the shared lock not owned by curthread, causing false positives in kqueue subsystem assertions about knlist lock. Remove kl_locked method from knlist lock vector, and add two separate assertion methods kl_assert_locked and kl_assert_unlocked, that are supposed to use proper asserts. Change knlist_init accordingly. Add convenience function knlist_init_mtx to reduce number of arguments for typical knlist initialization. Submitted by: jhb [1] Noted by: jhb [2] Reviewed by: jhb Tested by: rnoland Notes: svn path=/head/; revision=193951
* Add alc(4), a driver for Atheros AR8131/AR8132 PCIe ethernetPyun YongHyeon2009-06-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | controller. These controllers are also known as L1C(AR8131) and L2C(AR8132) respectively. These controllers resembles the first generation controller L1 but usage of different descriptor format and new register mappings over L1 register space requires a new driver. There are a couple of registers I still don't understand but the driver seems to have no critical issues for performance and stability. Currently alc(4) supports the following hardware features. o MSI o TCP Segmentation offload o Hardware VLAN tag insertion/stripping o Tx/Rx interrupt moderation o Hardware statistics counters(dev.alc.%d.stats) o Jumbo frame o WOL AR8131/AR8132 also supports Tx checksum offloading but I disabled it due to stability issues. I'm not sure this comes from broken sample boards or hardware bugs. If you know your controller works without problems you can still enable it. The controller has a silicon bug for Rx checksum offloading, so the feature was not implemented. I'd like to say big thanks to Atheros. Atheros kindly sent sample boards to me and answered several questions I had. HW donated by: Atheros Communications, Inc. Notes: svn path=/head/; revision=193880
* opt in to flowtable on i386/amd64Kip Macy2009-06-091-0/+1
| | | | Notes: svn path=/head/; revision=193864
* remove flowtable from DEFAULTSKip Macy2009-06-091-2/+0
| | | | Notes: svn path=/head/; revision=193855
* When using i8254 as the only kernel timer source:Ariff Abdullah2009-06-091-7/+31
| | | | | | | | | | | | - Interpolate stat/prof clock using clkintr() in a similar fashion to local APIC timer, since statclock usually run slower. - Liberate hardclockintr() from taking the burden of handling both stat and prof clock interrupt. Instead, send IPIs within clkintr() to handle those. Notes: svn path=/head/; revision=193814
* Move C1E workaround into its own idle function. Previous workaround worksAriff Abdullah2009-06-092-23/+77
| | | | | | | | | | | | | | | | | only during initial booting process, while there are laptops/BIOSes that tend to act 'smarter' by force enabling C1E if the main power adapter being pulled out, rendering previous workaround ineffective. Given the fact that we still rely on local APIC to drive timer interrupt, this workaround should keep all Turion (probably Phenom too) X\d+ alive whether its on battery power or not. URL: http://lists.freebsd.org/pipermail/freebsd-acpi/2008-April/004858.html http://lists.freebsd.org/pipermail/freebsd-acpi/2008-May/004888.html Tested by: Peter Jeremy <peterjeremy at optushome d com d au> Notes: svn path=/head/; revision=193804
* Add line width calculations for 15/16 and 24/32 bit modes in caseXin LI2009-06-091-0/+8
| | | | | | | | | | | | | the "Get Scan Line Length" function fails, as it does in Parallels (in Version 2.2, Build 2112 at least). PR: i386/127367 Obtained from: DragonFly Submitted by: Pedro Giffuni MFC after: 1 month Notes: svn path=/head/; revision=193790
* Rewrite OsdSynch.c to reflect the latest ACPICA more closely:Jung-uk Kim2009-06-081-3/+0
| | | | | | | | | - Implement ACPI semaphore (ACPI_SEMAPHORE) with condvar(9) and mutex(9). - Implement ACPI mutex (ACPI_MUTEX) with mutex(9). - Implement ACPI lock (ACPI_SPINLOCK) with spin mutex(9). Notes: svn path=/head/; revision=193750
* Revert my change; reintroduce __gnu89_inline.Ed Schouten2009-06-082-2/+2
| | | | | | | | | | | | It turns out our compiler in stable/7 can't build this code anymore. Even though my opinion is that those people should just run `make kernel-toolchain' before building a kernel, I am willing to wait and commit this after we've branched stable/8. Requested by: rwatson Notes: svn path=/head/; revision=193734
* Remove __gnu89_inline.Ed Schouten2009-06-082-2/+2
| | | | | | | | | | | | Now that we use C99 almost everywhere, just use C99-style in the pmap code. Since the pmap code is the only consumer of __gnu89_inline, remove it from cdefs.h as well. Because the flag was only introduced 17 months ago, I don't expect any problems. Reviewed by: alc Notes: svn path=/head/; revision=193732
* Decouple the i386 native and i386 Xen APIC definitions a little further.Adrian Chadd2009-06-071-4/+22
| | | | | | | | | I'm experimenting locally with xen APIC emulation a bit and this makes it easier to migrate APIC entries between being bitmapped and not being bitmapped. Notes: svn path=/head/; revision=193662
* Import ACPICA 20090521.Jung-uk Kim2009-06-057-10/+17
| | | | Notes: svn path=/head/; revision=193530
* Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERICRobert Watson2009-06-052-3/+0
| | | | | | | | | | | and used in a large number of files, but also because an increasing number of incorrect uses of MAC calls were sneaking in due to copy-and-paste of MAC-aware code without the associated opt_mac.h include. Discussed with: pjd Notes: svn path=/head/; revision=193511
* Remove MAC kernel config files and add "options MAC" to GENERIC, with theRobert Watson2009-06-022-28/+1
| | | | | | | | | | | | | | | | | | goal of shipping 8.0 with MAC support in the default kernel. No policies will be compiled in or enabled by default, but it will now be possible to load them at boot or runtime without a kernel recompile. While the framework is not believed to impose measurable overhead when no policies are loaded (a result of optimization over the past few months in HEAD), we'll continue to benchmark and optimize as the release approaches. Please keep an eye out for performance or functionality regressions that could be a result of this change. Approved by: re (kensmith) Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=193334
* Implement accept4 syscall.Dmitry Chagin2009-06-011-0/+1
| | | | | | | | Approved by: kib (mentor) MFC after: 1 month Notes: svn path=/head/; revision=193264
* Regenerate generated syscall files following changes to struct sysent inRobert Watson2009-06-012-445/+445
| | | | | | | r193234. Notes: svn path=/head/; revision=193235
* Fix the MP IPI code to differentiate between bitmapped IPIs and function IPIs.Adrian Chadd2009-05-312-19/+14
| | | | | | | | | | | | | | | | | | | This attempts to fix the IPI handling code to correctly differentiate between bitmapped IPIs and function IPIs. The Xen IPIs were on low numbers which clashed with the bitmapped IPIs. This commit bumps those IPI numbers up to 240 and above (just like in the i386 code) and fiddles with the ipi_vectors[] logic to call the correct function. This still isn't "right". Specifically, the IPI code may work fine for TLB shootdown events but the rendezvous/lazypmap IPIs are thrown by calling ipi_*() routines which don't set the call_func stuff (function id, addr1, addr2) that the TLB shootdown events are. So the Xen SMP support is still broken. PR: 135069 Notes: svn path=/head/; revision=193154
* Remove some unused code in ipi_selected() .Adrian Chadd2009-05-311-5/+0
| | | | | | | | | The code path this was copied from (sys/i386/i386/mp_machdep.c:ipi_selected()) handles bitmap'ed IPIs and normal IPIs via separate notification paths. Xen SMP handles them the same way. Notes: svn path=/head/; revision=193153
* Even though I'm not quite sure that the call_func stuff will work properlyAdrian Chadd2009-05-301-2/+3
| | | | | | | | | | | | in all the places/cases IPI messages will be generated, at least be consistent with how the call_data pointer is assigned and cleared (ie, all done inside the spinlock. Ensure that its NULL before continuing, just to try and identify situations where things are going horribly wrong. Notes: svn path=/head/; revision=193098
* Don't schedule a CALL_FUNCTION_VECTOR software IPI if the IPI was signaledAdrian Chadd2009-05-301-3/+3
| | | | | | | via the bitmap (and thus sent via RESCHEDULE_VECTOR.) Notes: svn path=/head/; revision=193094
* Correctly report the IPI IRQs being created; make it clear what vectors they ↵Adrian Chadd2009-05-301-4/+4
| | | | | | | are for. Notes: svn path=/head/; revision=193082
* Place hostnames and similar information fully under the prison system.Jamie Gritton2009-05-293-13/+5
| | | | | | | | | | | | | | | | | | | | The system hostname is now stored in prison0, and the global variable "hostname" has been removed, as has the hostname_mtx mutex. Jails may have their own host information, or they may inherit it from the parent/system. The proper way to read the hostname is via getcredhostname(), which will copy either the hostname associated with the passed cred, or the system hostname if you pass NULL. The system hostname can still be accessed directly (and without locking) at prison0.pr_host, but that should be avoided where possible. The "similar information" referred to is domainname, hostid, and hostuuid, which have also become prison parameters and had their associated global variables removed. Approved by: bz (mentor) Notes: svn path=/head/; revision=193066
* Revert to 2-clause.Adrian Chadd2009-05-291-2/+0
| | | | Notes: svn path=/head/; revision=193034
* Fix the Xen TOD update when the hypervisor wall clock is nudged.Adrian Chadd2009-05-291-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | The "wall clock" in the current code is actually the hypervisor start time. The time of day is the "start time" plus the hypervisor "uptime". Large enough bumps in the dom0 clock lead to a hypervisor "bump" which is implemented as a bump in the start time, not the uptime. The clock.c routines were reading in the hypervisor start time and then using this as the TOD. This meant that any hypervisor time bump would cause the FreeBSD DomU to set its TOD to the hypervisor start time, rather than the actual TOD. This fix is a bit hacky and some reshuffling should be done later on to clarify what is going on. I've left the wall clock code alone. (The code which updates shadow_tv and shadow_tv_version.) A new routine adds the uptime to the shadow_tv, which is then used to update the TOD. I've included some debugging so it is obvious when the clock is nudged. PR: 135008 Notes: svn path=/head/; revision=193033