summaryrefslogtreecommitdiff
path: root/sys/arch/i386/include
AgeCommit message (Collapse)Author
2015-01-15Define and print HV cpuid flag on i386.Stefan Fritsch
This is set by many hypervisors, including kvm, vmware, hyper-v.
2015-01-09Cleanup some macros and #defines in i386 pmap. Previously committed andMike Larkin
backed out because of libkvm breakage, recommitting now with libkvm fix. ok deraadt@
2014-12-23backout previous, because libkvm needs two pieces. will let mikeTheo de Raadt
find a different way.
2014-12-22Move PD_MASK, PT_MASK and a couple macros into pmap.c. The only otherMike Larkin
user of these was hibernate, which now gets its own PD_MASK (since the resume time PD_MASK is essentially disjoint from the runtime PD_MASK). No functional change, just moving the deck chairs around in preparation for an upcoming change. ok deraadt
2014-12-16don't include lock.h by default. poisons namespace. ok deraadtTed Unangst
2014-12-08Split the ACPI resume trampoline into code and data, move the data page toMike Larkin
.rodata (kernel copies to the RW page), protect the code page with RX permissions, protect the code page with RW permissions. ok deraadt@
2014-12-02delete all the simplelocks. ok deraadtTed Unangst
2014-11-22Previous diff changed the location of the ACPI S3/S4 trampoline, which hasMike Larkin
a common #defined location for both i386 and amd64. This diff fixes i386 to match. Also fix a tab/space issue in amd64 hibernate_var.h discussed with deraadt
2014-11-16Replace a plethora of historical protection options with justTheo de Raadt
PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis
2014-10-17reinstate i386/bus_space diff now that serial consoles are fixed inStuart Henderson
sys/arch/i386/i386/bios.c, ok deraadt
2014-10-17backout i386/bus_space diff for now, req'd by deraadt@ - problems at bootStuart Henderson
| i386/bus_space.c:1.5->1.6 | i386/machdep.c:1.551->1.552 | include/bus.h:1.61->1.62
2014-10-17bring the twisting of bus_space from amd64 over to i386. this is:David Gwynne
src/sys/arch/amd64/amd64/bus_space.c r1.22 src/sys/arch/amd64/include/bus.h r1.27 instead of using the tag 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. the kernel is smaller and the api is more cache friendly now. the porting of this code from amd64 to i386 was done by kimberley manning requested by and ok tedu@
2014-10-08Add virtio_membar_* macrosStefan Fritsch
Virtio needs the MP memory barriers even on SP kernels. OK kettenis@
2014-10-01Move some hibernate #defines to pte.h and eliminate some duplicate definesMike Larkin
from hibernate code that were already defined in pte.h (with different names). No functional change. ok sf@, deraadt@
2014-09-12Remove the code that attempts to synchronize P-state transitions between CPUs.Mark Kettenis
Spinning inside an IPI handler is generally a bad idea as it is very hard to avoid deadlocks. As far as I can tell the synchronization isn't necessary. Multi-core CPUs have hardware mechanisms to do the appropropriate coordination between cores and coordination between sockets isn't necessary either. This seems to fix the various hangs and suspend/resume failures that people have been seeing when running apmd -A or apmd -C. Tested by many. ok kspillner@, mpi@
2014-09-11mplement membar(9) API for i386.Mark Kettenis
ok matthew@, guenther@
2014-07-12Tackle the endian.h mess. Make it so that:Philip Guenther
* you can #include <sys/endian.h> instead of <machine/endian.h>, and ditto <endian.h> (fixes code that pulls in <sys/endian.h> first) * those will always export the symbols that POSIX specified for <endian.h>, including the new {be,le}{16,32,64}toh() set. c.f. http://austingroupbugs.net/view.php?id=162 if __BSD_VISIBLE then you also get the symbols that our <machine/endian.h> currently exports (ntohs, NTOHS, dlg's bemtoh*, etc) * when doing POSIX compiles (not __BSD_VISIBLE), then <netinet/in.h> and <arpa/inet.h> will *stop* exporting the extra symbols like BYTE_ORDER and betoh* ok deraadt@
2014-07-11Chuck Cranor rescinded clauses in his licenseJonathan Gray
on the 2nd of February 2011 in NetBSD. http://marc.info/?l=netbsd-source-changes&m=129658899212732&w=2 http://marc.info/?l=netbsd-source-changes&m=129659095515558&w=2 http://marc.info/?l=netbsd-source-changes&m=129659157916514&w=2 http://marc.info/?l=netbsd-source-changes&m=129665962324372&w=2 http://marc.info/?l=netbsd-source-changes&m=129666033625342&w=2 http://marc.info/?l=netbsd-source-changes&m=129666052825545&w=2 http://marc.info/?l=netbsd-source-changes&m=129666922906480&w=2 http://marc.info/?l=netbsd-source-changes&m=129667725518082&w=2
2014-07-11CPU_BUSY_CYCLE(): A new MI statement for busy loop power reductionMasao Uebayashi
The new CPU_BUSY_CYCLE() may be put in a busy loop body so that CPU can reduce power consumption, as Linux's cpu_relax() and FreeBSD's cpu_spinwait(). To start minimally, use PAUSE on i386/amd64 and empty on others. The name is chosen following the existing cpu_idle_*() functions. Naming and API may be polished later. OK kettenis@
2014-07-03Add identcpu detection for 1-GByte pagesMatthew Dempsky
ok mlarkin
2014-05-31Remove some unused code that we added at the 2013 Toronto hackathon butMike Larkin
don't need anymore.
2014-03-29It's been a quarter century: we can assume volatile is present with that name.Philip Guenther
ok dlg@ mpi@ deraadt@
2014-03-19It's safe to assumed 'signed' existsPhilip Guenther
2014-03-16DDB supports ELF symbols are all archs, and it's always the same as thePhilip Guenther
native size, so eliminate the #defines. ok miod@
2014-03-16Kill DB_*TASK_NAME* macros which were only ever on i386/amd64 and never used.Philip Guenther
2014-03-14rework mplocks to use tickets instead of spinning. this providesDavid Gwynne
fairer access to the kernel lock between logical cpus, especially in multi socket systems. i first wrote this diff in 2011. ok n2k14 for post 5.5 (deraadt@ and kettenis@ in particular)
2014-03-11lint is gone, and the 'lint' conditional was never in the implementationPhilip Guenther
namespace, so stop changing behavior when it's #defined ok beck@ krw@
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-24Disable lapic when halting CPUs. Allegedly this is necessary to makeMark Kettenis
suspend work on some machines. ok deraadt@, mlarkin@
2014-01-23unifdef -D__HAVE_VM_PAGE_MD - no functional change.Miod Vallat
2014-01-06Increase NPTECL, as cache-lines are 64-bytes nowadays.Stefan Fritsch
Also move it from pmap.h to pmap.c because it is an internal detail.
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-23Add an instruction barrier to bus_space_barrier(). From David Hill.Mark Kettenis
ok deraadt@
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-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-17Remove support for a.out and ecoff. We only do elf now.Theo de Raadt
ok miod
2013-10-09Use monitor/mwait to idle when available. Make cpu_unidle() do nothingPhilip Guenther
if it 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. just a port of the amd64 version; testing by many
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-08-07We uniformly define size_t to be unsigned long and ssize_t to be long. MakeMark Kettenis
sure that SIZE_MAX and SSIZE_MAX are defined as constants with a matching type on all are architectures. ok millert@, matthew@
2013-07-14IPL_VM is "mpsafe" now as well.Mark Kettenis
2013-07-13unify register_t to long on all platformsTheo de Raadt
ok miod kettenis
2013-07-10To 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. ok matthew@
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-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@