summaryrefslogtreecommitdiffstats
path: root/sys/amd64
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary giant acquisition around panic in #ifdef DIAGNOSTICkris2007-03-261-2/+0
| | | | | | | | | | code. # There is some question about whether this code is even relevant any # longer (it dates back to prehistoric times, i.e. present in r1.1), # especially on amd64. Reviewed by: jhb
* Add an interface for drivers to be notified of changes to CPU frequency.njl2007-03-263-5/+149
| | | | | | | | | | | | | | | | | | cpufreq_pre_change is called before the change, giving each driver a chance to revoke the change. cpufreq_post_change provides the results of the change (success or failure). cpufreq_levels_changed gives the unit number of the cpufreq device whose number of available levels has changed. Hook in all the drivers I could find that needed it. * TSC: update TSC frequency value. When the available levels change, take the highest possible level and notify the timecounter set_cputicker() of that freq. This gets rid of the "calcru: runtime went backwards" messages. * identcpu: updates the sysctl hw.clockrate value * Profiling: if profiling is active when the clock changes, let the user know the results may be inaccurate. Reviewed by: bde, phk MFC after: 1 month
* Catch up with ACPI-CA 20070320 import.jkim2007-03-224-167/+156
|
* Change the amd64, i386, and ia64 nexus drivers to setup bus space tags andjhb2007-03-211-8/+6
| | | | | | | | | | | handles when activating a resource via bus_activate_resource() rather than doing some of the work in bus_alloc_resource() and some of it in bus_activate_resource(). One note is that when using isa_alloc_resourcev() on PC-98, drivers now need to just use bus_release_resource() without explicitly calling bus_deactivate_resource() first. nyan@ has already fixed all of the PC-98 drivers.
* Add a new apic0 psuedo-device to claim memory resources for the memoryjhb2007-03-203-0/+77
| | | | | | | address ranges used by local and I/O APICs in the system. Some systems also reserve these ranges as system resources via either PnPBIOS or ACPI, so this device currently attaches after acpi0 and legacy0 so that the system resources are given precedence.
* Add a new ram0 pseudo-device that claims memory resouces for physicaljhb2007-03-201-0/+76
| | | | | | | addresses corresponding to system RAM. On amd64 ram0 uses the SMAP and claims all the type 1 SMAP regions. On i386 ram0 uses the dump_avail[] array. Note that on i386 we have to ignore regions above 4G in PAE kernels since bus resources use longs.
* - Add macros for newly added CPUID bits in the corresponding header files.jkim2007-03-202-2/+4
| | | | | - Use correct capticalization in xTPR as Intel uses in their documents. - Use proper description instead of vendor code name in comment.
* Tweak the probe/attach order of devices on the x86 nexus devices.jhb2007-03-201-3/+3
| | | | | Various BIOS-related psuedo-devices are added at an order of 5. acpi0 is added at an order of 10, and legacy0 is added at an order of 11.
* MFi386 1.173: Display two new Intel feature bits.jhb2007-03-201-2/+2
|
* Add another CPUID for AMD CPUs and fix style(9) while I am here.jkim2007-03-122-83/+84
|
* Push down the implementation of PCPU_LAZY_INC() into the machine-dependentalc2007-03-111-0/+30
| | | | | | | header file. Reimplement PCPU_LAZY_INC() on amd64 and i386 making it atomic with respect to interrupts. Reviewed by: bde, jhb
* Completely eliminate "avail_start". It serves no useful purpose.alc2007-03-101-18/+14
|
* Defer calling lapic_init() until we've completed the 'MPTable: <...>'jhb2007-03-091-2/+4
| | | | | printf. Otherwise, printfs inside of lapic_init() (such as during a verbose boot) can uglify the output.
* Over NFS, an open() call could result in multiple over-the-wiremohans2007-03-091-0/+2
| | | | | | | | | | | | GETATTRs being generated - one from lookup()/namei() and the other from nfs_open() (for cto consistency). This change eliminates the GETATTR in nfs_open() if an otw GETATTR was done from the namei() path. Instead of extending the vop interface, we timestamp each attr load, and use this to detect whether a GETATTR was done from namei() for this syscall. Introduces a thread-local variable that counts the syscalls made by the thread and uses <pid, tid, thread syscalls> as the attrload timestamp. Thanks to jhb@ and peter@ for a discussion on thread state that could be used as the timestamp with minimal overhead.
* Don't increment total_bounced when doing no-op dmamap_sync ops.scottl2007-03-061-1/+2
|
* Change the x86 interrupt code to use FreeBSD CPU IDs (i.e. PCPU_GET(cpuid))jhb2007-03-065-21/+26
| | | | | rather than local APIC IDs to keep track of CPUs which can handle interrupts.
* Acquiring smp_ipi_mtx on every call to pmap_invalidate_*() is wasteful.alc2007-03-052-66/+16
| | | | | | | | | | | | For example, during a buildworld more than half of the calls do not generate an IPI because the only TLB entry invalidated is on the calling processor. This revision pushes down the acquisition and release of smp_ipi_mtx into smp_tlb_shootdown() and smp_targeted_tlb_shootdown() and instead uses sched_pin() and sched_unpin() in pmap_invalidate_*() so that thread migration doesn't lead to a missed TLB invalidation. Reviewed by: jhb MFC after: 3 weeks
* Use vm_paddr_t rather than uintptr_t when passing the physical address ofjhb2007-03-055-11/+10
| | | | APICs to lapic_init() and ioapic_create().
* Add a simple device driver to "eat" any I/O APICs that show up as PCIjhb2007-03-051-1/+48
| | | | | | devices. MFC after: 1 week
* MFP4: 115220, 115222jkim2007-03-022-175/+182
| | | | | - Fix style(9) and reduce diff between amd64 and i386. - Prefix Linuxulator macros with LINUX_ to prevent future collision.
* MFP4: 115094jkim2007-02-271-3/+4
| | | | | | | | Linux does not check file descriptor when MAP_ANONYMOUS is set. This should fix recent LTP test regressions. Reported by: Scot Hetzel (swhetzel at gmail dot com) netchild
* Partial MFp4 of 114977:netchild2007-02-242-5/+5
| | | | | | Whitespace commit: Fix grammar, spelling and punctuation. Submitted by: "Scot Hetzel" <swhetzel@gmail.com>
* Use ih_filter instead of ih_handler in a couple of places. This fixesjhb2007-02-231-1/+1
| | | | | | most INTR_FAST handlers on i386. Reviewed by: piso
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-235-20/+28
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* MFi386 rev. 1.544 of i386/i386/pmap.c:kib2007-02-191-0/+14
| | | | | | | | | | Rounding addr upwards to next 2M boundary in pmap_growkernel() could cause addr to become 0, resulting in an early return without populating the last PDE. Reported and tested by: kris Suggested by: alc MFC after: 1 week
* Eliminate some acquisitions and releases of the page queues lock that arealc2007-02-182-4/+0
| | | | no longer necessary.
* Add bootverbose printfs to indicate which IDT vectors are assigned to MSIjhb2007-02-151-0/+6
| | | | interrupts.
* Fix accidental removal of an empty line from the previous commit.jkim2007-02-151-0/+1
|
* Regen.jkim2007-02-153-4/+10
|
* MFP4: 113033jkim2007-02-152-2/+20
| | | | Port iopl(2) from i386. This fixes LTP iopl01 and iopl02 on amd64.
* MFP4: 113025, 113146, 113177, 113203, 113500, 113546, 113570jkim2007-02-152-60/+51
| | | | | | | | - PROT_READ, PROT_WRITE, or PROT_EXEC implies PROT_READ and PROT_EXEC. Linux/ia64's i386 emulation layer does this and it complies with Linux header files. This fixes mmap05 LTP test case on amd64. - Do not adjust stack size when failure has occurred. - Synchronize i386 mmap/mprotect with amd64.
* Include GEOM_LABEL in GENERIC. It's very useful and not well publicizedbrooks2007-02-091-0/+1
| | | | | | enough. Approved by: pjd
* Don't send interrupts to CPUs disabled via lapic hints.jhb2007-02-081-0/+2
| | | | | | Reported by: Ludger Bolmerg <lbolmerg ! web.de> MFC after: 3 days Pointy hat to: jhb
* Evolve the ctlreq interface added to geom_gpt into a genericmarcel2007-02-071-1/+1
| | | | | | | | | | | partitioning class that supports multiple schemes. Current schemes supported are APM (Apple Partition Map) and GPT. Change all GEOM_APPLE anf GEOM_GPT options into GEOM_PART_APM and GEOM_PART_GPT (resp). The ctlreq interface supports verbs to create and destroy partitioning schemes on a disk; to add, delete and modify partitions; and to commit or undo changes made.
* Fixed some style bugs. Routine except:bde2007-02-061-31/+32
| | | | | - don't use __GNUCLIKE___OFFSETOF, since __offsetof() is a standard FreeBSD implementaion detail which has nothing to do with GNUC.
* Simplified PCPU_GET() and PCPU_SET(). We must copy through a temporarybde2007-02-061-48/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | variable to avoid invalid constraints in dead code. Use an array of u_char's (inside a struct) instead of a char/short/int/long variable so that the variable and its accesses can be spelled in the same way in all cases and code doesn't need to be cloned just to hold the spelling differences. Fixed strict-aliasing errors in PCPU_SET() and in the amd64 PCPU_GET(). Cast to (void *) as in rev.1.37 of the i386 version where the errors were fixed for the i386 PCPU_GET() only. It would be more correct to copy to and from the temp. variable using memcpy(), but then an ifdef tangle would be required to ensure using the builtin memcpy(). We depend on fairly aggressive optimization to put the temp. variable only in a register despite it being copied using *(type *)(void *)&anothertype and could depend on this when using memcpy() too. This seems to work right even for -O0, but the -O0 case has not been completely tested. This change gives identical object code for all object files in LINT on amd64 (except for one file with a __TIME__ stamp). For LINT on i386 it gives unimportant differences in instruction order and padding in a few object files. This was only tested for -O. This change (actually a previous version of it) gives the following reductions in the number of object files in LINT that fail to compile with -O2 but without the -fno-strict-aliasing kludge: - amd64: 29 (down from 211) - i386: 36 (down from 47) gcc-3.4.6 actually allows the invalid constraints that result from not using the temp. variable, at least with -O[1-2], but gcc-3.3.3 crashes on them and I don't want to depend on compiler bugs.
* Change GDB_BUFSZ to be large enough to hold a register dump where eachjhb2007-02-051-1/+1
| | | | | | | | | | | register takes 16 characters (64-bit register in hex). In practice this is a slight bit of overkill as 7 of the 56 registers are only 32-bit, but having the buffer too small results in remote kgdb trashing kernel memory when it connects. PR: amd64/108673 Submitted by: Ravi Murty, Nikhil Rao @ Intel MFC after: 3 days
* Introduce some more SO_ option equivalents from Linux to FreeBSD.kib2007-02-011-0/+7
| | | | | | | The msg variable in linux_recvmsg() was not initialized. Copy it from userspace. Submitted by: rdivacky
* Fix LOR that occurs because proctree_lock was acquired while holdingkib2007-02-011-8/+8
| | | | | | emuldata lock by moving the code upwards outside the emul_lock coverage. Submitted by: rdivacky
* MFi386: Use LINUX_SIG_VALID macro.kib2007-02-011-1/+1
| | | | Submitted by: rdivacky
* Use a known good stack at the time of servicing an NMI --- reusejkoshy2007-01-271-1/+1
| | | | | | | | | | | the space allocated for the double fault handler since this space is otherwise unused till the time a double fault occurs. This change should have been committed alongside r1.127 of "exception.S", but I somehow missed doing so. Problem reported by: jeff Pointy hat to: jkoshy
* - Remove setrunqueue and replace it with direct calls to sched_add().jeff2007-01-231-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | setrunqueue() was mostly empty. The few asserts and thread state setting were moved to the individual schedulers. sched_add() was chosen to displace it for naming consistency reasons. - Remove adjustrunqueue, it was 4 lines of code that was ifdef'd to be different on all three schedulers where it was only called in one place each. - Remove the long ifdef'd out remrunqueue code. - Remove the now redundant ts_state. Inspect the thread state directly. - Don't set TSF_* flags from kern_switch.c, we were only doing this to support a feature in one scheduler. - Change sched_choose() to return a thread rather than a td_sched. Also, rely on the schedulers to return the idlethread. This simplifies the logic in choosethread(). Aside from the run queue links kern_switch.c mostly does not care about the contents of td_sched. Discussed with: julian - Move the idle thread loop into the per scheduler area. ULE wants to do something different from the other schedulers. Suggested by: jhb Tested on: x86/amd64 sched_{4BSD, ULE, CORE}.
* - Allow the schedulers to IPI_PREEMPT idlethread. This puts the decisionjeff2007-01-231-8/+5
| | | | for this behavior on the initiator side.
* Cleaned up declaration and initialization of clock_lock. It is onlybde2007-01-233-15/+18
| | | | | | | | | | | | | | | | | | | | used by clock code, so don't export it to the world for machdep.c to initialize. There is a minor problem initializing it before it is used, since although clock initialization is split up so that parts of it can be done early, the first part was never done early enough to actually work. Split it up a bit more and do the first part as late as possible to document the necessary order. The functions that implement the split are still bogusly exported. Cleaned up initialization of the i8254 clock hardware using the new split. Actually initialize it early enough, and don't work around it not being initialized in DELAY() when DELAY() is called early for initialization of some console drivers. This unfortunately moves a little more code before the early debugger breakpoint so that it is harder to debug. The ordering of console and related initialization is delicate because we want to do as little as possible before the breakpoint, but must initialize a console.
* Expand the MSI/MSI-X API to address some deficiencies in the MSI-X support.jhb2007-01-225-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - First off, device drivers really do need to know if they are allocating MSI or MSI-X messages. MSI requires allocating powerof2() messages for example where MSI-X does not. To address this, split out the MSI-X support from pci_msi_count() and pci_alloc_msi() into new driver-visible functions pci_msix_count() and pci_alloc_msix(). As a result, pci_msi_count() now just returns a count of the max supported MSI messages for the device, and pci_alloc_msi() only tries to allocate MSI messages. To get a count of the max supported MSI-X messages, use pci_msix_count(). To allocate MSI-X messages, use pci_alloc_msix(). pci_release_msi() still handles both MSI and MSI-X messages, however. As a result of this change, drivers using the existing API will only use MSI messages and will no longer try to use MSI-X messages. - Because MSI-X allows for each message to have its own data and address values (and thus does not require all of the messages to have their MD vectors allocated as a group), some devices allow for "sparse" use of MSI-X message slots. For example, if a device supports 8 messages but the OS is only able to allocate 2 messages, the device may make the best use of 2 IRQs if it enables the messages at slots 1 and 4 rather than default of using the first N slots (or indicies) at 1 and 2. To support this, add a new pci_remap_msix() function that a driver may call after a successful pci_alloc_msix() (but before allocating any of the SYS_RES_IRQ resources) to allow the allocated IRQ resources to be assigned to different message indices. For example, from the earlier example, after pci_alloc_msix() returned a value of 2, the driver would call pci_remap_msix() passing in array of integers { 1, 4 } as the new message indices to use. The rid's for the SYS_RES_IRQ resources will always match the message indices. Thus, after the call to pci_remap_msix() the driver would be able to access the first message in slot 1 at SYS_RES_IRQ rid 1, and the second message at slot 4 at SYS_RES_IRQ rid 4. Note that the message slots/indices are 1-based rather than 0-based so that they will always correspond to the rid values (SYS_RES_IRQ rid 0 is reserved for the legacy INTx interrupt). To support this API, a new PCIB_REMAP_MSIX() method was added to the pcib interface to change the message index for a single IRQ. Tested by: scottl
* MFp4 (113077, 113083, 113103, 113124, 113097):netchild2007-01-201-4/+37
| | | | | | | | | | | | | | | | | | | | | | | | | Dont expose em->shared to the outside world before its properly initialized. Might not affect anything but its at least a better coding style. Dont expose em via p->p_emuldata until its properly initialized. This also enables us to get rid of some locking and simplify the code because we are workin on a local copy. In linux_fork and linux_vfork create the process in stopped state to be sure that the new process runs with fully initialized emuldata structure [1]. Also fix the vfork (both in linux_clone and linux_vfork) race that could result in never woken up process [2]. Reported by: Scot Hetzel [1] Suggested by: jhb [2] Reviewed by: jhb (at least some important parts) Submitted by: rdivacky Tested by: Scot Hetzel (on amd64) Change 2 comments (in the new code) to comply to style(9). Suggested by: jhb
* Revert previous change.rodrigc2007-01-181-1/+1
| | | | Requested by: kan
* Forward declare __pcpu as a pointer type instead of an array type torodrigc2007-01-181-1/+1
| | | | eliminate GCC 4.1 error: "array type has incomplete element type".
* MFp4 (112893):netchild2007-01-141-0/+1
| | | | | | | Make linux_vfork() actually work. This enables make to work again with 2.6. It also fixes the LTP vfork tests. Submitted by: rdivacky
* Remove 3rd clause, renumber, ok per emailimp2007-01-121-4/+1
|
OpenPOWER on IntegriCloud