summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/include
AgeCommit message (Collapse)Author
2014-02-17x86_atomic_testset_i32 and x86_atomic_testset_i are not used, so removeDavid Gwynne
them to unmuddy the waters a bit. ok guenther@
2014-02-13Some Linux i915 drm "fast" path code relies on being able to "disable" pageMark Kettenis
faults to avoid sleeping. Implement this functionality for i386 and amd64 for faults in the user address space. If the ci_inatomic flag is set in struct cpu_info, copyin(9) and copyout(9) will return EFAULT when a user-space address needs to be faulted in. Use this to properly implement __copy_to_user_inatomic() and __copy_from_user_inatomic_nocache() in the inteldrm(4) code. ok krw@, guenther@
2014-01-30Move declaration of struct vm_page_md from <machine/vmparam.h> toMiod Vallat
<machine/pmap.h> where it belongs, and compensate in <uvm/uvm_extern.h> by including <uvm/uvm_pmap.h> before <uvm/uvm_page.h>. Tested on all MACHINE_ARCH but amd64 and i386 (and hppa64).
2014-01-23unifdef -D__HAVE_VM_PAGE_MD - no functional change.Miod Vallat
2014-01-21Disable lapic when halting CPUs. Allegedly this is necessary to makeMark Kettenis
suspend work on some machines. ok deraadt@
2014-01-05HIBERNATE_SELTABLE is not used anymore. Remove, and reclaim its stolenMike Larkin
page.
2014-01-05Don't use the first 64KB for anything, including tramps. Move tramps andMike Larkin
hibernate goo up after 64KB to avoid posible corruption by buggy BIOS SMM code. Diff also ensures the first 64KB doesn't get handed to UVM either. ok deraadt@, tested by many with no regressions reported
2013-12-18Provide MI symbol _STACKALIGNBYTESTheo de Raadt
2013-12-12Remove the scatter/gather dma implementation as it is no longer used.Mark Kettenis
ok krw@, deraadt@
2013-12-06Make clflush() flush the cache line specified by the address we pass itMark Kettenis
instead of the cache line containing the local variable used to specify the address. Fixes the gnome corruption and hangs people have been experiencing for the last couple of months or so. ok deraadt@, mlarkin@
2013-11-06Add support for Power Resources for Dx states and the necessary hookMartin Pieuchot
for PCI devices. This hook should be called twice, before and after changing the power state of a PCI device. Before setting the device to the new state, the ACPI layer will notify every power resources linked to the device for that state and make sure they are turned "_ON". After changing the state of the device, it will decrement the reference of every power resources linked to that device for the old state and turn them "_OFF" if they are no longer referenced. This fixes the no-USB after resume problem seen on various ThinkPad, problem initialy diagnosed with Alexander Polakov. ok kettenis@, deraadt@
2013-11-02Cleanup bios_oconsdev_t. Make sure you have a halfway recent bootloaderMark Kettenis
(at least BOOT 3.20 on amd64 and BOOT 3.18 on i386) or you'll risk losing your serial console. ok deraadt@
2013-10-17Remove a.out leftovers now that libsa loadfile() will only boot ELF binaries.Miod Vallat
2013-10-05Use monitor/mwait to idle when available. Make cpu_unidle() do nothingPhilip Guenther
if can tell the target CPU isn't actually idling and introduce cpu_kick() for the cases where we want to force a non-idle CPU into the kernel. critical review of early versions by weingart@; testing by many ok haesbaert@ krw@
2013-08-24Cleanup amd64 and i386 MTRR code -Mike Larkin
1. Makes amd64 and i386 MTRR code nearly identical 2. Removes support for per-process MTRRs (which were never implemented) 3. Treat "unknown" MTRR types as uncacheable instead of trying to preserve bogus settings made by the BIOS 4. Various KNF cleanups Should be no functional change. ok jsg@, deraadt@
2013-07-05Take II, this time without flubbing off_t: : move several internalPhilip Guenther
type definitions that are the same across all archs from <machine/_types.h> to <sys/_types.h> ok deraadt@ kettenis@ otto@
2013-07-04backout previous; off_t must be signed and there might be other C++ APIOtto Moerbeek
breakage lurking; ok kettenis@
2013-07-04To ease future changes, move several internal type definitions that arePhilip Guenther
the same across all archs from <machine/_types.h> to <sys/_types.h> ok deraadt@
2013-06-26Since interrupts at IPL_AUDIO no longer grab the kernel lock, and nobodyMark Kettenis
is supposed to establish interrupts at IPL_VM, we only need to "flatten" mutex ipls up until IPL_TTY. Add an assertion to enforce that IPL_AUDIO interrupts are establish with the IPL_MPSAFE flag set. Should improve latency of audio interrupts a tiny bit. ok matthew@
2013-06-04Remove remaining references to HIBERNATE_COPY_PAGE. It was effectivelyMike Larkin
removed at n2k13 but a few errant references still remained. No functional change. Spot tested by my on i386 and amd64 UP environments, no regressions seen. noticed by deraadt@
2013-06-04Cpu topology for AMD64.Christiano F. Haesbaert
This adds information about smt id (thread), core id and package id (socket) to amd64. ci_smt_id, ci_core_id, ci_pkg_id should be followed by other archictectures and core relying on them should be under ARCH_HAVE_CPU_TOPOLOGY. ok tedu@
2013-06-04Add RCS ids.Paul Irofti
2013-06-02fix tpyoPhilip Guenther
2013-06-02To prevent lock ordering problems with the kernel lock, we need to make sureMark Kettenis
we block all interrupts that can grab the kernel lock. The simplest way to achieve this is to make sure mutexes always raise the ipl to the highest level that has interrupts that grab the kernel lock. This will allow us to have "mpsafe" interrupt handlers at lower priority levels. No change for non-MULTIPROCESSOR kernels. discussed with many ok mpi@, tedu@
2013-06-01Introduce a new amd64 IPI, x86_ipi_halt_realmode to park CPUS into realMike Larkin
mode and halt them. Needed for hibernate. ok deraadt@ kettenis@ "there's no risk there"
2013-06-01cleanup and consolidate the spinlock_lock (what a name!) code.Ted Unangst
it's now atomic_lock to better reflect its usage, and librthread now features a new spinlock that's really a ticket lock. thrlseep can handle both types of lock via a flag in the clock arg. (temp back compat hack) remove some old stuff that's accumulated along the way and no longer used. some feedback from dlg, who is concerned with all things ticket lock. (you need to boot a new kernel before installing librthread)
2013-05-31We need to halt the APs on MP hibernate resume or else they will beMike Larkin
executing code possibly causing side effects during the image unpack operation. But before we can halt the APs, we need to complete their init (as they will be hatched but idling, possibly with interrupts off). Introduces MD function hibernate_quiesce_cpus to do this, called from the MI hibernate resume code. ok deraadt
2013-05-30Make interrupt handling in hibernate resume MI by providing MD-specificMike Larkin
functions to enable and disable interrupts, if needed. If a platform doesnt need interrupt handling in this way, the MD function can be a no-op. discussed with pirofti and deraadt
2013-05-30Even though we reserve 3 pages for the amd64 hibernate stack, we set theMike Larkin
resume time stack pointer to the first page reserved, effectively giving us only one page to work with. Found when I was debugging some unrelated stack issues in the resume code.
2013-05-21remove unused cpu_lock code (where it is truly unused). it is notTed Unangst
part of the future we have planned. middling ok from a few
2013-05-16Implement a mechanism to establish interrupt handlers that don't grab theMark Kettenis
kernel lock upon entry through a new IPL_MPSAFE flag/level. ok mikeb@, mpi@
2013-05-12Take the kernel lock and call the actual interrupt handler from aAlexandre Ratchov
single c function. This will hopefully make easier to stop taking the kernel lock when running "mp safe" interrupt handlers. help from ok kettenis
2013-05-06the use of modern intel performance counter msrs to measure the number ofDavid Gwynne
cycles per second isnt reliable, particularly inside "virtual" machines. cpuspeed can be calculated as 0, which causes a divide by zero later on which is bad. this goes to more effort to detect if the performance counters are in use by the hypervisor, or detecting if they gave us a cpuspeed of 0 so we can fall through to using rdtsc. the same change as: src/sys/arch/i386/include/specialreg.h r.45 src/sys/arch/i386/isa/clock.c 1.49 ok jsg@
2013-05-05remove never used get/set ioperm sysarch functions. ok guentherTed Unangst
2013-04-01Do not expose the trap T_* values to userland, since they invade theTheo de Raadt
namespace a bit much. These are the names for the value encoded in core.c_ucode or siginfo.si_trapno, but userland never looks directly and only cares about the abstract signal code. ok guenther
2013-03-31try to avoid pulling in pte.h and other more crazy things. Checked againstTheo de Raadt
the things that libkvm needs.
2013-03-28Add STRONG_ALIAS macros to be used from assembly code in libc andMartynas Venckus
libm. While at it, remove now unused workarounds for lint. Agreed by kettenis@, guenther@, matthew@.
2013-03-28Add __strong_alias macros for all architectures to be able to aliasMartynas Venckus
another symbol without weak attribute. To be used in libc and libm soon. Agreed by kettenis@, guenther@, matthew@.
2013-03-26PGSHIFT and PGOFSET are now contained inside the kernel namespace.Theo de Raadt
2013-03-25ALIGNBYTES/ALIGN/ALIGNED_POINTER can move to the MI file.Theo de Raadt
2013-03-23refactor sys/param.h and machine/param.h. A lot of #ifdef _KERNEL is addedTheo de Raadt
to keep definitions our of user space. The MD files now follow a consistant order -- all namespace intrusion is at the tail can be cleaned up independently. locore, bootblocks, and libkvm still see enough visibility to build. Checked on 90% of platforms...
2013-03-21move kernel after 16MB. needed for additional growth that might come in aTheo de Raadt
little while... diff from martynas who is not around now
2013-03-17Add an interface to rebind AGP DMA mappings. To be used by the upcoming KMSMark Kettenis
support to reload bindings after suspend/resume and to update cachability flags in the address translation table entries.
2013-03-17We don't do mcontext, so remove this unused header.Mark Kettenis
ok deraadt@
2013-03-12Fix kernel profiling on MP systems by using per-CPU buffers and teachMartin Pieuchot
kgmon(8) to deal with them, this time without public header changes. Previously various CPUs were iterating over the same global buffer at the same time to modify it and never ended. This diff includes some ideas submited by Thor Simon to NetBSD via miod@. ok deraadt@, mikeb@, haesbaert@
2013-02-12Back out per-CPU kernel profiling, it shouldn't modify a public headerMartin Pieuchot
at this moment.
2013-02-11Fix kernel profiling on MP systems by using per-CPU buffer. PreviouslyMartin Pieuchot
various CPUs were iterating over the same global buffer at the same time to modify it and never ended. This diff includes some ideas submited by Thor Simon to NetBSD via miod@. ok mikeb@, haesbaert@
2013-01-29the bus_space api implies that there's a bus endianness that it willDavid Gwynne
swap for you to the hosts endianness. sometimes you dont want this hand holding and just want raw access to the registers. bus_space does have stuff to do this already, but they deal with buffers which can be awkward if you just want to get or set a single register. this adds the following to i386 and amd64: bus_space_read_raw_2() bus_space_read_raw_4() bus_space_read_raw_8() bus_space_write_raw_2() bus_space_write_raw_4() bus_space_write_raw_8() sparc64 already implements this, even though it wasnt part of the official api. how handy. i'll do other archs as i can. kettenis@ and miod@ seem ok with this
2013-01-27Bump MAXTSIZ to 128 MB, some binaries are quite large.Federico G. Schwindt
Agreed with millert@ and guenther@
2013-01-18twist the amd64 bus_space implementation a bit. instead of using the tagDavid Gwynne
as an identifier for IO or memory mappings that was checked inside the api, turn it into a pointer to a structure of function pointers. the api then generally becomes a set of macros that deref the function pointers on the callers behalf. the idea is that following a pointer to very small functions is cheap compared to doing compares continuously. a notable exception to the macro wrappers is bus_space_barrier which is now a static inline function. the only argument to it that gets used is the flags, and thats usually a constant at compile time so it can be inlined to a single fence instruction. the kernel is smaller and the api is more cache friendly now. ok deraadt@