summaryrefslogtreecommitdiffstats
path: root/sys/amd64
Commit message (Collapse)AuthorAgeFilesLines
* - Make pcib_devclass private to sys/dev/pci/pci_pci.c and change all thejhb2006-01-062-22/+9
| | | | | | | various pcib drivers to use their own private devclass_t variables for their modules. - Use the DEFINE_CLASS_0() macro to declare drivers for the various pcib drivers while I'm here.
* Fix various places that were testing td_critnest to see if interruptsjhb2006-01-061-3/+3
| | | | | should remain disabled during a trap or not to check td_md.md_spinlock_count instead.
* - Explicitly validate an empty filter to match bpf_filter() comment[1].jkim2006-01-031-0/+4
| | | | | | - Do not use BPF JIT compiler for an empty filter. [1] Pointed out by: darrenr
* Define __HAVE_ACPI and/or __PCI_REROUTE_INTERRUPT, as appropriate forimp2006-01-011-0/+2
| | | | | each platform. These will be used in the pci code in preference to the complicated #ifdefs we have there now.
* Unbreak kernel build.netchild2006-01-011-3/+3
| | | | | | | | A happy new year to all. Submitted by: Goran Gajic <ggajic@afrodita.rcub.bg.ac.yu>, bz Pointy hat to: netchild Appologies to: all
* MI changes:netchild2005-12-311-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | - provide an interface (macros) to the page coloring part of the VM system, this allows to try different coloring algorithms without the need to touch every file [1] - make the page queue tuning values readable: sysctl vm.stats.pagequeue - autotuning of the page coloring values based upon the cache size instead of options in the kernel config (disabling of the page coloring as a kernel option is still possible) MD changes: - detection of the cache size: only IA32 and AMD64 (untested) contains cache size detection code, every other arch just comes with a dummy function (this results in the use of default values like it was the case without the autotuning of the page coloring) - print some more info on Intel CPU's (like we do on AMD and Transmeta CPU's) Note to AMD owners (IA32 and AMD64): please run "sysctl vm.stats.pagequeue" and report if the cache* values are zero (= bug in the cache detection code) or not. Based upon work by: Chad David <davidc@acns.ab.ca> [1] Reviewed by: alc, arch (in 2004) Discussed with: alc, Chad David, arch (in 2004)
* Fix watch address truncation. The address was truncated when it was passed topjd2005-12-271-3/+3
| | | | | | | amd64_set_watch() as 'unsigned int' and 'unsigned int' is 32bit long on amd64. Even with that fix hardware watchpoint don't work for me on amd64, ie. when I set the watchpoint and write a byte there, nothing happens.
* Remove kern.elf32.can_exec_dyn sysctl. Instead extend Brandinfo structuresobomax2005-12-262-0/+4
| | | | | | | | | | with flags bitfield and set BI_CAN_EXEC_DYN flag for all brands that usually allow executing elf dynamic binaries (aka shared libraries). When it is requested to execute ET_DYN elf image check if this flag is on after we know the elf brand allowing execution if so. PR: kern/87615 Submitted by: Marcin Koziej <creep@desk.pl>
* - Improve the INKERNEL macro such that it can no longer give false positives.jeff2005-12-231-1/+5
| | | | | | This fixes the stack(9) functionality. Submitted by: Antoine Brodin <antoine.brodin@laposte.net>
* Tweak how the MD code calls the fooclock() methods some. Instead ofjhb2005-12-228-49/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | passing a pointer to an opaque clockframe structure and requiring the MD code to supply CLKF_FOO() macros to extract needed values out of the opaque structure, just pass the needed values directly. In practice this means passing the pair (usermode, pc) to hardclock() and profclock() and passing the boolean (usermode) to hardclock_cpu() and hardclock_process(). Other details: - Axe clockframe and CLKF_FOO() macros on all architectures. Basically, all the archs were taking a trapframe and converting it into a clockframe one way or another. Now they can just extract the PC and usermode values directly out of the trapframe and pass it to fooclock(). - Renamed hardclock_process() to hardclock_cpu() as the latter is more accurate. - On Alpha, we now run profclock() at hz (profhz == hz) rather than at the slower stathz. - On Alpha, for the TurboLaser machines that don't have an 8254 timecounter, call hardclock() directly. This removes an extra conditional check from every clock interrupt on Alpha on the BSP. There is probably room for even further pruning here by changing Alpha to use the simplified timecounter we use on x86 with the lapic timer since we don't get interrupts from the 8254 on Alpha anyway. - On x86, clkintr() shouldn't ever be called now unless using_lapic_timer is false, so add a KASSERT() to that affect and remove a condition to slightly optimize the non-lapic case. - Change prototypeof arm_handler_execute() so that it's first arg is a trapframe pointer rather than a void pointer for clarity. - Use KCOUNT macro in profclock() to lookup the kernel profiling bucket. Tested on: alpha, amd64, arm, i386, ia64, sparc64 Reviewed by: bde (mostly)
* Move the hostb driver out of the i386 and amd64 PCI code (where it wasjhb2005-12-201-58/+0
| | | | | | | duplicated anyways) and into a single MI driver. Extend the driver a bit to implement the bus and PCI kobj interfaces such that other drivers can attach to it and transparently act as if their parent device is the PCI bus (for the most part).
* Make our ELF64 type definitions match standards. In particular thismarcel2005-12-181-1/+1
| | | | | | | | | | | | | means: o Remove Elf64_Quarter, o Redefine Elf64_Half to be 16-bit, o Redefine Elf64_Word to be 32-bit, o Add Elf64_Xword and Elf64_Sxword for 64-bit entities, o Use Elf_Size in MI code to abstract the difference between Elf32_Word and Elf64_Word. o Add Elf_Ssize as the signed counterpart of Elf_Size. MFC after: 2 weeks
* Don peril sensitive sunglasses and jack up the MAX_BPAGES limit to 8192scottl2005-12-161-1/+1
| | | | | on amd64. If you're going to stuff >4GB into your box, reserving 32MB for bonce pages amounts to a rounding error in the overall scheme of things.
* Remove linux_mib_destroy() (which I actually added in between 5.0 and 5.1)jhb2005-12-151-1/+0
| | | | | | | | | which existed to cleanup the linux_osname mutex. Now that MTX_SYSINIT() has grown a SYSUNINIT to destroy mutexes on unload, the extra destroy here was redundant and resulted in panics in debug kernels. MFC after: 1 week Reported by: Goran Gajic ggajic at afrodita dot rcub dot bg dot ac dot yu
* Fix stale comment.jhb2005-12-141-2/+1
|
* Revert previous commit. The BIOS braindamage is even worse than Ijhb2005-12-131-0/+4
| | | | | | | | originally thought. The BIOS that cleared CPUID_APIC actually managed to disable the local APIC entirely and even Windows 64 doesn't boot on it. Reported by: bz
* Don't check the CPUID_APIC bit in the cpu_features flags field to determinejhb2005-12-131-4/+0
| | | | | | | | | | | | | | if the boot CPU has a local APIC because some BIOS vendors are not competent enough to set this bit. Instead, just assume that we always have a local APIC on amd64. For i386 the check is a bit more subtle. FreeBSD requires either an MP Table or an ACPI MADT table to enumerate APICs. The only systems that have one of those tables that don't have local APICs are some presumably rare (and old) SMP 486 systems using external APICs. Thus, instead of checking the CPUID_APIC flag, check the CPU class and abort if we are running on a 486. MFC after: 1 week Reported by: bz
* For the amd64 platform, we can depend on the TSC being present. This patchpeter2005-12-121-0/+15
| | | | | | | changes DELAY to use the TSC once it has been calibrated. This does NOT use the TSC for long-term timekeeping. It only uses it to bound the DELAY() spinloop. This should not be affected by the Athlon64 X2 TSC quirks because the cpu is not halted while we use DELAY().
* Sync with i386, fix compiling for non-SMP.davidxu2005-12-091-0/+2
|
* MFi386:jhb2005-12-0813-186/+101
| | | | | | | | | | | | | | | | | | | | | - Move PUSH_FRAME and POP_FRAME to asmacros.h and use PUSH_FRAME in atpic entry points. - Move PCPU_* asm macros out of the middle of the asm profiling macros. - Pass IRQ vector argument as an int rather than void * to reduce diffs with i386. - EOI the lapic in C for the lapic timer handler. - GC unused Xcpuast function. - Split IPI_STOP handling code of ipi_nmi_handler() out into a cpustop_handler() function and call it from Xcpustop rather than duplicating all the logic in assembly. - Fixup the list of symbols with interrupt frames in ddb traces. Xatpic_fastintr* have never existed on amd64, and the lapic timer handler and various IPI handlers were missing. - Use trapframe instead of intrframe for interrupt entry points (on amd64 the interrupt vector was already a separate argument, so the two frames were already identical) and GC intrframe. Submitted by: peter (3)
* Catch up to the system siginfo changes. Use a union for the ia32 layoutpeter2005-12-061-1/+3
| | | | | of siginfo just like the system one. There are now two fields to copy instead of one.
* - Cleanup whitespace and extra ()s in vtophys() macros.jhb2005-12-061-5/+4
| | | | | | | | | | | - Move vtophys() macros next to vtopte() where vtopte() exists to match comments above vtopte(). - Remove references to the alternate address space in the comment above vtopte(). amd64 never had the alternate address space, and i386 lost it prior to PAE support being added. - s/entires/entries/ in comments. Reviewed by: alc
* Fix ZERO_EDX() macro from the previous commit. It was emittingjkim2005-12-061-1/+1
| | | | `xor %ecx, %ecx', not `xor %edx, %edx'.
* Drop _MACHINE_ARCH and _MACHINE defines (not to be confused withru2005-12-061-7/+0
| | | | | | | MACHINE_ARCH and MACHINE). Their purpose was to be able to test in cpp(1), but cpp(1) only understands integer type expressions. Using such unsupported expressions introduced a number of subtle bugs, which were discovered by compiling with -Wundef.
* s/M_WAITOK/M_NOWAIT/ while mutex is held.jkim2005-12-061-2/+2
| | | | Pointed out by: csjp
* - Micro-optimize `mov $0, %edx' -> `xor %edx, %edx'.jkim2005-12-062-21/+27
| | | | - Correct amd64 macro style (no functional change).
* Add experimental BPF Just-In-Time compiler for amd64 and i386.jkim2005-12-062-0/+921
| | | | | | | | | | | | | | | | | Use the following kernel configuration option to enable: options BPF_JITTER If you want to use bpf_filter() instead (e. g., debugging), do: sysctl net.bpf.jitter.enable=0 to turn it off. Currently BIOCSETWF and bpf_mtap2() are unsupported, and bpf_mtap() is partially supported because 1) no need, 2) avoid expensive m_copydata(9). Obtained from: WinPcap 3.1 (for i386)
* Really slam the door on mixed mode now that we don't depend on it for ajhb2005-12-051-0/+15
| | | | | | | | | | | | | working IRQ0 with APIC anymore. Previously, it was possible to have some other ATPIC IRQS "leak" through in a few edge cases. For example, on my x86 test machine, ACPI re-routes the SCI (IRQ 9) to intpin 13 on the first I/O APIC. This leaves a hole for IRQ 13 (since the APIC doesn't provide a source for IRQ 13 in that case) with the result that the ATPIC IRQ13 source was registered instead. This changes the 8259A drivers to only register their interrupt sources if none of the 16 ISA IRQs have an interrupt source already installed. MFC after: 1 week
* Merge DRM CVS as of 2005-12-02, adding i915 DRM support thanks to Alexey Popov,anholt2005-12-031-0/+1
| | | | and a new r300 PCI ID.
* Update DRM to CVS snapshot as of 2005-11-28. Notable changes:anholt2005-11-281-0/+1
| | | | | | | | | | | | | - S3 Savage driver ported. - Added support for ATI_fragment_shader registers for r200. - Improved r300 support, needed for latest r300 DRI driver. - (possibly) r300 PCIE support, needs X.Org server from CVS. - Added support for PCI Matrox cards. - Software fallbacks fixed for Rage 128, which used to render badly or hang. - Some issues reported by WITNESS are fixed. - i915 module Makefile added, as the driver may now be working, but is untested. - Added scripts for copying and preprocessing DRM CVS for inclusion in the kernel. Thanks to Daniel Stone for getting me started on that.
* If we get a stray interrupt, return after logging it. In the extremelyjhb2005-11-281-0/+1
| | | | | | | | | | rare case of a stray interrupt to an unregistered source (such as a stray interrupt from the 8259As when using APIC), this could result in a page fault when it tried to walk the list of interrupt handlers to execute INTR_FAST handlers. This bug was introduced with the intr_event changes, so it's not present in 5.x or 6.x. Submitted by: Mark Tinguely tinguely at casselton dot net
* - Allow duplicate "machine" directives with the same arguments.ru2005-11-273-9/+1
| | | | - Move existing "machine" directives to DEFAULTS.
* Fix typo.le2005-11-241-1/+1
|
* Add missing "struct" in i386/i386/machdep.c,v 1.497 by deischen@.ru2005-11-241-1/+1
|
* Don't enable PUC_FASTINTR by default in the source. Instead, enable itjhb2005-11-211-0/+2
| | | | | | | | | | | via the DEFAULTS kernel configs. This allows folks to turn it that option off in the kernel configs if desired without having to hack the source. This is especially useful since PUC_FASTINTR hangs the kernel boot on my ultra60 which has two uart(4) devices hung off of a puc(4) device. I did not enable PUC_FASTINTR by default on powerpc since powerpc does not currently allow sharing of INTR_FAST with non-INTR_FAST like the other archs.
* Expand the hack to mask the atpics if 'device atpic' is not in the kerneljhb2005-11-211-8/+28
| | | | | | | | | | | | | | during boot up. Now we do a full reset of the 8259As and setup a simple interrupt handler (we actually borrow the apic one that just does an immediate iret) to handle any spurious interrupts triggered by either chip. This should fix some folks that were getting a Trap 30 during bootup of certain SMP AMD systems. This might get pushed into the 6.0 branch as an errata. For now a suitable workaround is to add 'device atpic' to your kernel config. Tested by: scottl Helpful info from: dillon MFC after: 1 week
* Eliminate pmap_init2(). It's no longer used.alc2005-11-201-5/+0
|
* - Always print the trap number so that we have something to start with forjhb2005-11-181-4/+9
| | | | | | | | mystery traps. If we don't have a message for a given trap, just use UNKNOWN for the message. - Add trap messages for T_XMMFLT and T_RESERVED. MFC after: 1 week
* Fix spelling mistake.obrien2005-11-171-1/+1
| | | | Submitted by: kris
* Revert a part of the previous commits to these files that made the NMIjhb2005-11-161-5/+4
| | | | | | | | | IPI_STOP handling code use atomic_readandclear() to execute the restart function on the first CPU to resume and restore the behavior of always executing the restart function on the BSP since this is in fact what the non-NMI IPI_STOP handler does. I did add back in a statement to clear the restart function pointer after it is executed to match the behavior of the non-NMI IPI_STOP handler.
* Revert previous commit to these files. There isn't a race necessitatingjhb2005-11-161-3/+2
| | | | | an xchg instruction as we only try to execute the startup function if the CPU ID is 0 (i.e. the BSP). I missed this earlier.
* Fix a typo in the check for an invalid APIC. If we are told about anjhb2005-11-161-1/+1
| | | | | | | | | I/O APIC that doesn't exist, then a read of the version register is going to return -1 which is 0xffffffff not 0xffffff. Tested on: i386 Tested by: Nikos Ntarmos ntarmos at ceid dot upatras dot gr MFC after: 1 week
* In get_pv_entry() use PMAP_LOCK() instead of PMAP_TRYLOCK() when deadlockalc2005-11-131-1/+4
| | | | cannot possibly occur.
* Add /dev/speaker support to amd64.ru2005-11-111-0/+3
| | | | | | | | The following repo-copies were made (by Mark Murray): sys/i386/isa/spkr.c -> sys/dev/speaker/spkr.c sys/i386/include/speaker.h -> sys/dev/speaker/speaker.h share/man/man4/man4.i386/spkr.4 -> share/man/man4/spkr.4
* Reimplement the reclamation of PV entries. Specifically, performalc2005-11-091-33/+42
| | | | | | | | | | | | | | | | | | reclamation synchronously from get_pv_entry() instead of asynchronously as part of the page daemon. Additionally, limit the reclamation to inactive pages unless allocation from the PV entry zone or reclamation from the inactive queue fails. Previously, reclamation destroyed mappings to both inactive and active pages. get_pv_entry() still, however, wakes up the page daemon when reclamation occurs. The reason being that the page daemon may move some pages from the active queue to the inactive queue, making some new pages available to future reclamations. Print the "reclaiming PV entries" message at most once per minute, but don't stop printing it after the fifth time. This way, we do not give the impression that the problem has gone away. Reviewed by: tegge
* Add uart(4). When both sio(4) and uart(4) can handle a serial port,marcel2005-11-051-1/+2
| | | | | | | | sio(4) will claim it. This change therefore only affects how ports are handled when they are not claimed by sio(4), and in principle will improve hardware support. MFC after: 2 months
* Define M_IOAPIC the same as i386peter2005-11-041-1/+1
|
* Catch up with the recent <sys/signal.h> change and make this compile.ru2005-11-041-1/+1
|
* Begin and end the initialization of pvzone in pmap_init().alc2005-11-041-19/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, pvzone's initialization was split between pmap_init() and pmap_init2(). This split initialization was the underlying cause of some UMA panics during initialization. Specifically, if the UMA boot pages was exhausted before the pvzone was fully initialized, then UMA, through no fault of its own, would use an inappropriate back-end allocator leading to a panic. (Previously, as a workaround, we have increased the UMA boot pages.) Fortunately, there is no longer any reason that pvzone's initialization cannot be completed in pmap_init(). Eliminate a check for whether pv_entry_high_water has been initialized or not from get_pv_entry(). Since pvzone's initialization is completed in pmap_init(), this check is no longer needed. Use cnt.v_page_count, the actual count of available physical pages, instead of vm_page_array_size to compute the maximum number of pv entries. Introduce the vm.pmap.pv_entries tunable on alpha and ia64. Eliminate some unnecessary white space. Discussed with: tegge (item #1) Tested by: marcel (ia64)
* Calling setrlimit from 32bit apps could potentially increase certainps2005-11-021-3/+2
| | | | | | | limits beyond what should be capiable in a 32bit process, so we must fixup the limits. Reviewed by: jhb
OpenPOWER on IntegriCloud