summaryrefslogtreecommitdiffstats
path: root/sys/amd64/include
Commit message (Collapse)AuthorAgeFilesLines
* MFi386: whitespace, copyright header, etc updatespeter2005-01-212-2/+1
|
* Introduce bus_dmamap_load_mbuf_sg(). Instead of taking a callback arg, thisscottl2005-01-071-0/+5
| | | | | | | cuts to the chase and fills in a provided s/g list. This is meant to optimize out the cost of the callback since the callback doesn't serve much purpose for mbufs since mbuf loads will never be deferred. This is just for amd64 and i386 at the moment, other arches will be coming shortly.
* Begin all license/copyright comments with /*-imp2005-01-0524-24/+24
|
* PC98 will never be defined for amd64imp2005-01-051-5/+0
|
* Change gdb_cpu_setreg() to not take the value to which to set themarcel2004-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | specified register, but a pointer to the in-memory representation of that value. The reason for this is twofold: 1. Not all registers can be represented by a register_t. In particular FP registers fall in that category. Passing the new register value by reference instead of by value makes this point moot. 2. When we receive a G or P packet, both are for writing a register, the packet will have the register value in target-byte order and in the memory representation (modulo the fact that bytes are sent as 2 printable hexadecimal numbers of course). We only need to decode the packet to have a pointer to the register value. This change fixes the bug of extracting the register value of the P packet as a hexadecimal number instead of as a bit array. The quick (and dirty) fix to bswap the register value in gdb_cpu_setreg() as it has been added on i386 and amd64 can therefore be removed and has in fact been that. Tested on: alpha, amd64, i386, ia64, sparc64
* Remove UAREA_PAGES.das2004-11-201-1/+0
| | | | Reviewed by: arch@
* Raise MAXDSIZ from 8G to 32G. The old limit was just an arbitary choicepeter2004-10-271-1/+1
| | | | | | | | that was greater than 4G. I originally used the same values as i386 in order to save opening a new PML4 page slot, but in the day of gigabytes of memory, worrying about a 4K page seems futile. Moving from 8 to 32G moves the page to a different index, it doesn't increase the number of pages used.
* Move the code for halting the CPU (acpi_cpu_c1) into machdep files.njl2004-10-111-1/+2
| | | | | | This removes the last MD portion of acpi_cpu.c. MFC after: 2 weeks
* Make pte_load_store() an atomic operation in all cases, not just i386 PAE.alc2004-10-081-4/+14
| | | | | | | | | Restructure pmap_enter() to prevent the loss of a page modified (PG_M) bit in a race between processors. (This restructuring assumes the newly atomic pte_load_store() for correct operation.) Reviewed by: tegge@ PR: i386/61852
* Prevent the unexpected deallocation of a page table page while performingalc2004-09-291-1/+1
| | | | | | | | | | | | | pmap_copy(). This entails additional locking in pmap_copy() and the addition of a "flags" parameter to the page table page allocator for specifying whether it may sleep when memory is unavailable. (Already, pmap_copy() checks the availability of memory, aborting if it is scarce. In theory, another CPU could, however, allocate memory between pmap_copy()'s check and the call to the page table page allocator, causing the current thread to release its locks and sleep. This change makes this scenario impossible.) Reviewed by: tegge@
* Severely strip down the repocopied i386/bios.c and bios.h files. It turnspeter2004-09-241-233/+0
| | | | out that bios_sigsearch() etc is useful for finding tables in roms.
* MFi386: adapt rev 1.19 (debugger fixes)peter2004-09-221-2/+10
|
* Double the number of kernel page tables for amd64 and for i386/PAE. The oldscottl2004-09-111-1/+2
| | | | | | | | value was only enough for 8GB of RAM, the new value can do 16GB. This still isn't optimal since it doesn't scale. Fixing this for amd64 looks to be fairly easy, but for i386 will be quite difficult. Reviewed by: peter
* Turn PREEMPTION into a kernel option. Make sure that it's defined ifscottl2004-09-021-5/+0
| | | | | | FULL_PREEMPTION is defined. Add a runtime warning to ULE if PREEMPTION is enabled (code inspired by the PREEMPTION warning in kern_switch.c). This is a possible MT5 candidate.
* Move the kernel-specific logic to adjust frompc from MI to MD. Formarcel2004-08-271-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | these two reasons: 1. On ia64 a function pointer does not hold the address of the first instruction of a functions implementation. It holds the address of a function descriptor. Hence the user(), btrap(), eintr() and bintr() prototypes are wrong for getting the actual code address. 2. The logic forces interrupt, trap and exception entry points to be layed-out contiguously. This can not be achieved on ia64 and is generally just bad programming. The MCOUNT_FROMPC_USER macro is used to set the frompc argument to some kernel address which represents any frompc that falls outside the kernel text range. The macro can expand to ~0U to bail out in that case. The MCOUNT_FROMPC_INTR macro is used to set the frompc argument to some kernel address to represent a call to a trap or interrupt handler. This to avoid that the trap or interrupt handler appear to be called from everywhere in the call graph. The macro can expand to ~0U to prevent adjusting frompc. Note that the argument is selfpc, not frompc. This commit defines the macros on all architectures equivalently to the original code in sys/libkern/mcount.c. People can take it from here... Compile-tested on: alpha, amd64, i386, ia64 and sparc64 Boot-tested on: i386
* Sync with i386 - Optimize intr_execute_handlers a bit etc.peter2004-08-161-1/+7
|
* Add an "options MP_WATCHDOG" to i386. This option allows one of therwatson2004-08-151-0/+34
| | | | | | | | | | | | | | | | | | | | | | | logical CPUs on a system to be used as a dedicated watchdog to cause a drop to the debugger and/or generate an NMI to the boot processor if the kernel ceases to respond. A sysctl enables the watchdog running out of the processor's idle thread; a callout is launched to reset a timer in the watchdog. If the callout fails to reset the timer for ten seconds, the watchdog will fire. The sysctl allows you to select which CPU will run the watchdog. A sample "debug.leak_schedlock" is included, which causes a sysctl to spin holding sched_lock in order to trigger the watchdog. On my Xeons, the watchdog is able to detect this failure mode and break into the debugger, which cannot otherwise be done without an NMI button. This option does not currently work with sched_ule due to ule's push notion of scheduling, similar to machdep.hlt_logical_cpus failing to work with that scheduler. On face value, this might seem somewhat inefficient, but there are a lot of dual-processor Xeons with HTT around, so using one as a watchdog for testing is not as inefficient as one might fear.
* Instead of calling ia32_pause() conditionally on __i386__ or __amd64__mux2004-08-031-2/+3
| | | | | | | | | being defined, define and use a new MD macro, cpu_spinwait(). It only expands to something on i386 and amd64, so the compiled code should be identical. Name of the macro found by: jhb Reviewed by: jhb
* Add style(9) foolishness.dfr2004-08-031-8/+8
|
* Add definitions for TLS relocations.dfr2004-08-021-2/+10
|
* Turn off PREEMPTION by default while it gets debugged. It's been causingscottl2004-08-011-0/+3
| | | | | 4 weeks of problems including deadlocks and instant panics. Note that the real bugs are likely in the scheduler.
* Break out the MI part of the /dev/[k]mem and /dev/io drivers intomarkm2004-08-012-0/+71
| | | | | | | | their own directory and module, leaving the MD parts in the MD area (the MD parts _are_ part of the modules). /dev/mem and /dev/io are now loadable modules, thus taking us one step further towards a kernel created entirely out of modules. Of course, there is nothing preventing the kernel from having these statically compiled.
* MFia64:ps2004-07-301-17/+1
| | | | | Fix -O builds with gcc 3.4 by defining ffs as __builtin_ffs instead of creating an inline function that just calls __builtin_ffs.
* Use newly added __used attribute to keep static function symbol fromkan2004-07-291-1/+1
| | | | being eliminated.
* Pass a thread argument into cpu_critical_{enter,exit}() rather thanrwatson2004-07-271-6/+7
| | | | | | | | | dereference curthread. It is called only from critical_{enter,exit}(), which already dereferences curthread. This doesn't seem to affect SMP performance in my benchmarks, but improves MySQL transaction throughput by about 1% on UP on my Xeon. Head nodding: jhb, bmilekic
* Remove the allpmaps list. It's unused.alc2004-07-201-1/+0
| | | | Reviewed by: peter@
* Make FLT_ROUNDS correctly reflect the dynamic rounding mode.das2004-07-191-1/+5
|
* Like on i386, eliminate pv_ptem (which was suggested by alc). Thispeter2004-07-141-1/+0
| | | | | | | | | | | | | | | | | reduces the size of the pv_entry structure a small but significant amount. This is implemented a little differently because it isn't so cheap to get the physical address of the page tabke page on amd64.. instead of it being directly accessible from the top level page directory, it is now two additional tree levels down. However.. In almost all cases, we recently had the physical address if the page table page a short while before we needed it, but it slipped through our fingers. This patch saves it for when we do need it. Also, for the one case where we do not have the ptp paddr, we are always running in curproc context and so we can do a vtopte-like trick. I've implemented vtopde() for this purpose. There is still a CYA entry in pmap_unuse_pt() that needs to be removed. I think it can be removed now but I forgot to test with it gone.
* Mega update for the KDB framework: turn DDB into a KDB backend.marcel2004-07-101-12/+5
| | | | | | | | | | | | | | | | Most of the changes are a direct result of adding thread awareness. Typically, DDB_REGS is gone. All registers are taken from the trapframe and backtraces use the PCB based contexts. DDB_REGS was defined to be a trapframe on all platforms anyway. Thread awareness introduces the following new commands: thread X switch to thread X (where X is the TID), show threads list all threads. The backtrace code has been made more flexible so that one can create backtraces for any thread by giving the thread ID as an argument to trace. With this change, ia64 has support for breakpoints.
* Remove obsolete prototype of kdb_trap().marcel2004-07-101-2/+0
|
* Implement makectx(). The makectx() function is used by KDB to createmarcel2004-07-101-0/+3
| | | | | | | | | a PCB from a trapframe for purposes of unwinding the stack. The PCB is used as the thread context and all but the thread that entered the debugger has a valid PCB. This function can also be used to create a context for the threads running on the CPUs that have been stopped when the debugger got entered. This however is not done at the time of this commit.
* Introduce the KDB debugger frontend. The frontend provides a frameworkmarcel2004-07-101-0/+52
| | | | | | | | | | | | | | | in which multiple (presumably different) debugger backends can be configured and which provides basic services to those backends. Besides providing services to backends, it also serves as the single point of contact for any and all code that wants to make use of the debugger functions, such as entering the debugger or handling of the alternate break sequence. For this purpose, the frontend has been made non-optional. All debugger requests are forwarded or handed over to the current backend, if applicable. Selection of the current backend is done by the debug.kdb.current sysctl. A list of configured backends can be obtained with the debug.kdb.available sysctl. One can enter the debugger by writing to the debug.kdb.enter sysctl.
* Introduce the GDB debugger backend for the new KDB framework. Themarcel2004-07-101-0/+57
| | | | | | | | | backend improves over the old GDB support in the following ways: o Unified implementation with minimal MD code. o A simple interface for devices to register themselves as debug ports, ala consoles. o Compression by using run-length encoding. o Implements GDB threading support.
* MFi386: various io apic cleanupspeter2004-07-081-0/+7
|
* MFi386: whitespace nit fix (spare blank line)peter2004-07-081-1/+0
|
* Implement preemption of kernel threads natively in the scheduler ratherjhb2004-07-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | than as one-off hacks in various other parts of the kernel: - Add a function maybe_preempt() that is called from sched_add() to determine if a thread about to be added to a run queue should be preempted to directly. If it is not safe to preempt or if the new thread does not have a high enough priority, then the function returns false and sched_add() adds the thread to the run queue. If the thread should be preempted to but the current thread is in a nested critical section, then the flag TDF_OWEPREEMPT is set and the thread is added to the run queue. Otherwise, mi_switch() is called immediately and the thread is never added to the run queue since it is switch to directly. When exiting an outermost critical section, if TDF_OWEPREEMPT is set, then clear it and call mi_switch() to perform the deferred preemption. - Remove explicit preemption from ithread_schedule() as calling setrunqueue() now does all the correct work. This also removes the do_switch argument from ithread_schedule(). - Do not use the manual preemption code in mtx_unlock if the architecture supports native preemption. - Don't call mi_switch() in a loop during shutdown to give ithreads a chance to run if the architecture supports native preemption since the ithreads will just preempt DELAY(). - Don't call mi_switch() from the page zeroing idle thread for architectures that support native preemption as it is unnecessary. - Native preemption is enabled on the same archs that supported ithread preemption, namely alpha, i386, and amd64. This change should largely be a NOP for the default case as committed except that we will do fewer context switches in a few cases and will avoid the run queues completely when preempting. Approved by: scottl (with his re@ hat)
* Backed out previous commit. Blind substitution of dev_t by `struct cdev *'bde2004-06-201-1/+1
| | | | was just wrong here because the dev_t's are user dev_t's.
* Include <sys/_lock.h>'s prerequisite <sys/queue.h> before including thebde2004-06-191-1/+1
| | | | | | former, not after. Don't hide this bug by including <sys/queue.h> in <sys/_lock.h>.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-1/+1
| | | | Bump __FreeBSD_version accordingly.
* Introduce pmap locking to many of the pmap functions. There is more toalc2004-06-141-0/+14
| | | | come later.
* - Remove an unused declaration.alc2004-06-131-3/+2
| | | | - Move a definition inside the scope of a #ifdef _KERNEL.
* Argh. Add the mini-stack-frame back in for mcount's benefit for syscallpeter2004-06-101-0/+4
| | | | stubs.
* Make profiling work for varargs functions.. %al is an additional argumentpeter2004-06-101-0/+2
| | | | | which indicates the number of xmm registers used in the varargs. This stops the explosion that happened when profiling printf() etc.
* - Use the correct devclass name ("acpi" vs "ACPI") to detect if acpi0 isjhb2004-06-101-1/+0
| | | | | | | present and thus that the PnPBIOS probe should be skipped instead of having ACPI zero out the PnPBIOStable pointer. - Make the PnPBIOStable pointer static to i386/i386/bios.c now that that is the only place it is used.
* Remove atdevbase and replace it's remaining uses with direct references tojhb2004-06-102-3/+2
| | | | KERNBASE instead.
* Initial PG_NX support (no-execute page bit)peter2004-06-083-1/+22
| | | | | | | | - export the rest of the cpu features (and amd's features). - turn on EFER_NXE, depending on the NX amd feature bit - reorg the identcpu stuff a bit in order to stop treating the amd features as second class features (since it is now a primary feature bit set) and make it easier to export.
* Mask pte's with PG_FRAME before passing it to PHYS_TO_VM_PAGE().. PG_NXpeter2004-06-081-1/+1
| | | | | | lives in the top 12 'available' bits. atop() in the PHYS_TO_VM_PAGE() macro only masks off the lower bits (by accident) and the upper bits in the 64 bit ptes turn into "interesting" index values.
* Be a little more consistent in the naming of the PML4 defines.peter2004-06-071-3/+3
|
* Add new bios_string() which will hunt for a string inside a given rangephk2004-06-031-0/+8
| | | | | of the BIOS. This can be used for finding arbitrary magic in the BIOS in order to recognize particular platforms.
* MFi386: move cpu_nameclass struct next to its only consumerpeter2004-06-031-5/+0
|
OpenPOWER on IntegriCloud