History log of /freebsd-10.0-release/sys/x86/include/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259128 09-Dec-2013 gjb

Remove svn:mergeinfo from the releng/10.0 branch.

After branch creation from stable/10, the stable/10 branch mergeinfo
was moved to the root of the branch.

Since there have not been any merges from stable/10 to releng/10.0
yet, we do not need to track any of the existing mergeinfo here.

Merges to releng/10.0 should now be done to the root of the branch.

For future branches during the release cycle, unless otherwise noted,
this change will be done as part of the stable/ and releng/ branch
creation.

Discussed with: peter
Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-10.0-release/MAINTAINERS
/freebsd-10.0-release/Makefile.inc1
/freebsd-10.0-release/ObsoleteFiles.inc
/freebsd-10.0-release/UPDATING
/freebsd-10.0-release/bin/df
/freebsd-10.0-release/bin/freebsd-version
/freebsd-10.0-release/cddl
/freebsd-10.0-release/cddl/contrib/opensolaris
/freebsd-10.0-release/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-10.0-release/cddl/contrib/opensolaris/cmd/zfs
/freebsd-10.0-release/cddl/contrib/opensolaris/lib/libzfs
/freebsd-10.0-release/contrib/apr
/freebsd-10.0-release/contrib/apr-util
/freebsd-10.0-release/contrib/atf
/freebsd-10.0-release/contrib/binutils
/freebsd-10.0-release/contrib/bmake
/freebsd-10.0-release/contrib/byacc
/freebsd-10.0-release/contrib/bzip2
/freebsd-10.0-release/contrib/com_err
/freebsd-10.0-release/contrib/compiler-rt
/freebsd-10.0-release/contrib/dialog
/freebsd-10.0-release/contrib/dtc
/freebsd-10.0-release/contrib/ee
/freebsd-10.0-release/contrib/expat
/freebsd-10.0-release/contrib/file
/freebsd-10.0-release/contrib/gcc
/freebsd-10.0-release/contrib/gdb
/freebsd-10.0-release/contrib/gdtoa
/freebsd-10.0-release/contrib/groff
/freebsd-10.0-release/contrib/ipfilter
/freebsd-10.0-release/contrib/ipfilter/ml_ipl.c
/freebsd-10.0-release/contrib/ipfilter/mlfk_ipl.c
/freebsd-10.0-release/contrib/ipfilter/mlh_rule.c
/freebsd-10.0-release/contrib/ipfilter/mli_ipl.c
/freebsd-10.0-release/contrib/ipfilter/mln_ipl.c
/freebsd-10.0-release/contrib/ipfilter/mls_ipl.c
/freebsd-10.0-release/contrib/ldns
/freebsd-10.0-release/contrib/less
/freebsd-10.0-release/contrib/libarchive
/freebsd-10.0-release/contrib/libarchive/cpio
/freebsd-10.0-release/contrib/libarchive/libarchive
/freebsd-10.0-release/contrib/libarchive/libarchive_fe
/freebsd-10.0-release/contrib/libarchive/tar
/freebsd-10.0-release/contrib/libc++
/freebsd-10.0-release/contrib/libc-vis
/freebsd-10.0-release/contrib/libcxxrt
/freebsd-10.0-release/contrib/libexecinfo
/freebsd-10.0-release/contrib/libpcap
/freebsd-10.0-release/contrib/libstdc++
/freebsd-10.0-release/contrib/llvm
/freebsd-10.0-release/contrib/llvm/tools/clang
/freebsd-10.0-release/contrib/mtree
/freebsd-10.0-release/contrib/ncurses
/freebsd-10.0-release/contrib/netcat
/freebsd-10.0-release/contrib/ntp
/freebsd-10.0-release/contrib/nvi
/freebsd-10.0-release/contrib/one-true-awk
/freebsd-10.0-release/contrib/openbsm
/freebsd-10.0-release/contrib/openpam
/freebsd-10.0-release/contrib/openresolv
/freebsd-10.0-release/contrib/pf
/freebsd-10.0-release/contrib/sendmail
/freebsd-10.0-release/contrib/serf
/freebsd-10.0-release/contrib/smbfs
/freebsd-10.0-release/contrib/subversion
/freebsd-10.0-release/contrib/tcpdump
/freebsd-10.0-release/contrib/tcsh
/freebsd-10.0-release/contrib/tnftp
/freebsd-10.0-release/contrib/top
/freebsd-10.0-release/contrib/top/install-sh
/freebsd-10.0-release/contrib/tzcode/stdtime
/freebsd-10.0-release/contrib/tzcode/zic
/freebsd-10.0-release/contrib/tzdata
/freebsd-10.0-release/contrib/unbound
/freebsd-10.0-release/contrib/wpa
/freebsd-10.0-release/contrib/xz
/freebsd-10.0-release/crypto/heimdal
/freebsd-10.0-release/crypto/openssh
/freebsd-10.0-release/crypto/openssl
/freebsd-10.0-release/etc
/freebsd-10.0-release/etc/rc.d
/freebsd-10.0-release/gnu/lib
/freebsd-10.0-release/gnu/usr.bin/binutils
/freebsd-10.0-release/gnu/usr.bin/cc/cc_tools
/freebsd-10.0-release/gnu/usr.bin/gdb
/freebsd-10.0-release/include
/freebsd-10.0-release/lib
/freebsd-10.0-release/lib/libc
/freebsd-10.0-release/lib/libc/stdtime
/freebsd-10.0-release/lib/libc_nonshared
/freebsd-10.0-release/lib/libfetch
/freebsd-10.0-release/lib/libiconv_modules
/freebsd-10.0-release/lib/libsmb
/freebsd-10.0-release/lib/libthr
/freebsd-10.0-release/lib/libutil
/freebsd-10.0-release/lib/libvmmapi
/freebsd-10.0-release/lib/libyaml
/freebsd-10.0-release/lib/libz
/freebsd-10.0-release/release
/freebsd-10.0-release/release/doc
/freebsd-10.0-release/sbin
/freebsd-10.0-release/sbin/camcontrol
/freebsd-10.0-release/sbin/dumpon
/freebsd-10.0-release/sbin/hastd
/freebsd-10.0-release/sbin/ifconfig
/freebsd-10.0-release/sbin/ipfw
/freebsd-10.0-release/sbin/nvmecontrol
/freebsd-10.0-release/share
/freebsd-10.0-release/share/examples/bhyve
/freebsd-10.0-release/share/i18n/csmapper/JIS
/freebsd-10.0-release/share/i18n/esdb/EUC
/freebsd-10.0-release/share/man
/freebsd-10.0-release/share/man/man4
/freebsd-10.0-release/share/man/man4/bhyve.4
/freebsd-10.0-release/share/man/man5
/freebsd-10.0-release/share/man/man7
/freebsd-10.0-release/share/man/man8
/freebsd-10.0-release/share/misc
/freebsd-10.0-release/share/mk
/freebsd-10.0-release/share/mk/bsd.arch.inc.mk
/freebsd-10.0-release/share/syscons
/freebsd-10.0-release/share/zoneinfo
/freebsd-10.0-release/sys
/freebsd-10.0-release/sys/amd64/include/vmm.h
/freebsd-10.0-release/sys/amd64/include/vmm_dev.h
/freebsd-10.0-release/sys/amd64/include/vmm_instruction_emul.h
/freebsd-10.0-release/sys/amd64/include/xen
/freebsd-10.0-release/sys/amd64/vmm
/freebsd-10.0-release/sys/boot
/freebsd-10.0-release/sys/boot/i386/efi
/freebsd-10.0-release/sys/boot/ia64/efi
/freebsd-10.0-release/sys/boot/ia64/ski
/freebsd-10.0-release/sys/boot/powerpc/boot1.chrp
/freebsd-10.0-release/sys/boot/powerpc/ofw
/freebsd-10.0-release/sys/cddl/contrib/opensolaris
/freebsd-10.0-release/sys/conf
/freebsd-10.0-release/sys/contrib/dev/acpica
/freebsd-10.0-release/sys/contrib/dev/acpica/changes.txt
/freebsd-10.0-release/sys/contrib/dev/acpica/common
/freebsd-10.0-release/sys/contrib/dev/acpica/compiler
/freebsd-10.0-release/sys/contrib/dev/acpica/components/debugger
/freebsd-10.0-release/sys/contrib/dev/acpica/components/disassembler
/freebsd-10.0-release/sys/contrib/dev/acpica/components/dispatcher
/freebsd-10.0-release/sys/contrib/dev/acpica/components/events
/freebsd-10.0-release/sys/contrib/dev/acpica/components/executer
/freebsd-10.0-release/sys/contrib/dev/acpica/components/hardware
/freebsd-10.0-release/sys/contrib/dev/acpica/components/namespace
/freebsd-10.0-release/sys/contrib/dev/acpica/components/parser
/freebsd-10.0-release/sys/contrib/dev/acpica/components/resources
/freebsd-10.0-release/sys/contrib/dev/acpica/components/tables
/freebsd-10.0-release/sys/contrib/dev/acpica/components/utilities
/freebsd-10.0-release/sys/contrib/dev/acpica/include
/freebsd-10.0-release/sys/contrib/dev/acpica/os_specific
/freebsd-10.0-release/sys/contrib/ipfilter
/freebsd-10.0-release/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
/freebsd-10.0-release/sys/contrib/ipfilter/netinet/ip_raudio_pxy.c
/freebsd-10.0-release/sys/contrib/libfdt
/freebsd-10.0-release/sys/contrib/octeon-sdk
/freebsd-10.0-release/sys/contrib/x86emu
/freebsd-10.0-release/sys/dev/bvm
/freebsd-10.0-release/sys/dev/fdt/fdt_ic_if.m
/freebsd-10.0-release/sys/dev/hyperv
/freebsd-10.0-release/sys/modules/hyperv
/freebsd-10.0-release/sys/modules/vmm
acpica_machdep.h
/freebsd-10.0-release/tools
/freebsd-10.0-release/tools/build
/freebsd-10.0-release/tools/build/options
/freebsd-10.0-release/tools/tools/atsectl
/freebsd-10.0-release/usr.bin/calendar
/freebsd-10.0-release/usr.bin/csup
/freebsd-10.0-release/usr.bin/iscsictl
/freebsd-10.0-release/usr.bin/procstat
/freebsd-10.0-release/usr.sbin
/freebsd-10.0-release/usr.sbin/bhyve
/freebsd-10.0-release/usr.sbin/bhyvectl
/freebsd-10.0-release/usr.sbin/bhyveload
/freebsd-10.0-release/usr.sbin/bsdconfig
/freebsd-10.0-release/usr.sbin/bsdinstall
/freebsd-10.0-release/usr.sbin/ctladm
/freebsd-10.0-release/usr.sbin/ctld
/freebsd-10.0-release/usr.sbin/freebsd-update
/freebsd-10.0-release/usr.sbin/jail
/freebsd-10.0-release/usr.sbin/mergemaster
/freebsd-10.0-release/usr.sbin/mount_smbfs
/freebsd-10.0-release/usr.sbin/ndiscvt
/freebsd-10.0-release/usr.sbin/pkg
/freebsd-10.0-release/usr.sbin/rtadvctl
/freebsd-10.0-release/usr.sbin/rtadvd
/freebsd-10.0-release/usr.sbin/rtsold
/freebsd-10.0-release/usr.sbin/zic
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

258559 25-Nov-2013 emaste

MFC r258135: x86: Allow users to change PSL_RF via ptrace(PT_SETREGS...)

Debuggers may need to change PSL_RF. Note that tf_eflags is already stored
in the signal context during signal handling and PSL_RF previously could
be modified via sigreturn, so this change should not provide any new
ability to userspace.

For background see the thread at:
http://lists.freebsd.org/pipermail/freebsd-i386/2007-September/005910.html

Reviewed by: jhb, kib

Sponsored by: DARPA, AFRL
Approved by: re (gjb)


258159 15-Nov-2013 kib

MFC r257856:
Add bits for the AMD features from CPUID function 0x80000001 ECX,
described in the rev. 3.0 of the Kabini BKDG, document 48751.pdf.

Approved by: re (gjb)


256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


256105 07-Oct-2013 phk

Add a va_copy() to our fall-back stdarg implementation for use with lint(1)

Approved by: re@ (glebius@)


255040 29-Aug-2013 gibbs

Implement vector callback for PVHVM and unify event channel implementations

Re-structure Xen HVM support so that:
- Xen is detected and hypercalls can be performed very
early in system startup.
- Xen interrupt services are implemented using FreeBSD's native
interrupt delivery infrastructure.
- the Xen interrupt service implementation is shared between PV
and HVM guests.
- Xen interrupt handlers can optionally use a filter handler
in order to avoid the overhead of dispatch to an interrupt
thread.
- interrupt load can be distributed among all available CPUs.
- the overhead of accessing the emulated local and I/O apics
on HVM is removed for event channel port events.
- a similar optimization can eventually, and fairly easily,
be used to optimize MSI.

Early Xen detection, HVM refactoring, PVHVM interrupt infrastructure,
and misc Xen cleanups:

Sponsored by: Spectra Logic Corporation

Unification of PV & HVM interrupt infrastructure, bug fixes,
and misc Xen cleanups:

Submitted by: Roger Pau Monné
Sponsored by: Citrix Systems R&D

sys/x86/x86/local_apic.c:
sys/amd64/include/apicvar.h:
sys/i386/include/apicvar.h:
sys/amd64/amd64/apic_vector.S:
sys/i386/i386/apic_vector.s:
sys/amd64/amd64/machdep.c:
sys/i386/i386/machdep.c:
sys/i386/xen/exception.s:
sys/x86/include/segments.h:
Reserve IDT vector 0x93 for the Xen event channel upcall
interrupt handler. On Hypervisors that support the direct
vector callback feature, we can request that this vector be
called directly by an injected HVM interrupt event, instead
of a simulated PCI interrupt on the Xen platform PCI device.
This avoids all of the overhead of dealing with the emulated
I/O APIC and local APIC. It also means that the Hypervisor
can inject these events on any CPU, allowing upcalls for
different ports to be handled in parallel.

sys/amd64/amd64/mp_machdep.c:
sys/i386/i386/mp_machdep.c:
Map Xen per-vcpu area during AP startup.

sys/amd64/include/intr_machdep.h:
sys/i386/include/intr_machdep.h:
Increase the FreeBSD IRQ vector table to include space
for event channel interrupt sources.

sys/amd64/include/pcpu.h:
sys/i386/include/pcpu.h:
Remove Xen HVM per-cpu variable data. These fields are now
allocated via the dynamic per-cpu scheme. See xen_intr.c
for details.

sys/amd64/include/xen/hypercall.h:
sys/dev/xen/blkback/blkback.c:
sys/i386/include/xen/xenvar.h:
sys/i386/xen/clock.c:
sys/i386/xen/xen_machdep.c:
sys/xen/gnttab.c:
Prefer FreeBSD primatives to Linux ones in Xen support code.

sys/amd64/include/xen/xen-os.h:
sys/i386/include/xen/xen-os.h:
sys/xen/xen-os.h:
sys/dev/xen/balloon/balloon.c:
sys/dev/xen/blkback/blkback.c:
sys/dev/xen/blkfront/blkfront.c:
sys/dev/xen/console/xencons_ring.c:
sys/dev/xen/control/control.c:
sys/dev/xen/netback/netback.c:
sys/dev/xen/netfront/netfront.c:
sys/dev/xen/xenpci/xenpci.c:
sys/i386/i386/machdep.c:
sys/i386/include/pmap.h:
sys/i386/include/xen/xenfunc.h:
sys/i386/isa/npx.c:
sys/i386/xen/clock.c:
sys/i386/xen/mp_machdep.c:
sys/i386/xen/mptable.c:
sys/i386/xen/xen_clock_util.c:
sys/i386/xen/xen_machdep.c:
sys/i386/xen/xen_rtc.c:
sys/xen/evtchn/evtchn_dev.c:
sys/xen/features.c:
sys/xen/gnttab.c:
sys/xen/gnttab.h:
sys/xen/hvm.h:
sys/xen/xenbus/xenbus.c:
sys/xen/xenbus/xenbus_if.m:
sys/xen/xenbus/xenbusb_front.c:
sys/xen/xenbus/xenbusvar.h:
sys/xen/xenstore/xenstore.c:
sys/xen/xenstore/xenstore_dev.c:
sys/xen/xenstore/xenstorevar.h:
Pull common Xen OS support functions/settings into xen/xen-os.h.

sys/amd64/include/xen/xen-os.h:
sys/i386/include/xen/xen-os.h:
sys/xen/xen-os.h:
Remove constants, macros, and functions unused in FreeBSD's Xen
support.

sys/xen/xen-os.h:
sys/i386/xen/xen_machdep.c:
sys/x86/xen/hvm.c:
Introduce new functions xen_domain(), xen_pv_domain(), and
xen_hvm_domain(). These are used in favor of #ifdefs so that
FreeBSD can dynamically detect and adapt to the presence of
a hypervisor. The goal is to have an HVM optimized GENERIC,
but more is necessary before this is possible.

sys/amd64/amd64/machdep.c:
sys/dev/xen/xenpci/xenpcivar.h:
sys/dev/xen/xenpci/xenpci.c:
sys/x86/xen/hvm.c:
sys/sys/kernel.h:
Refactor magic ioport, Hypercall table and Hypervisor shared
information page setup, and move it to a dedicated HVM support
module.

HVM mode initialization is now triggered during the
SI_SUB_HYPERVISOR phase of system startup. This currently
occurs just after the kernel VM is fully setup which is
just enough infrastructure to allow the hypercall table
and shared info page to be properly mapped.

sys/xen/hvm.h:
sys/x86/xen/hvm.c:
Add definitions and a method for configuring Hypervisor event
delievery via a direct vector callback.

sys/amd64/include/xen/xen-os.h:
sys/x86/xen/hvm.c:

sys/conf/files:
sys/conf/files.amd64:
sys/conf/files.i386:
Adjust kernel build to reflect the refactoring of early
Xen startup code and Xen interrupt services.

sys/dev/xen/blkback/blkback.c:
sys/dev/xen/blkfront/blkfront.c:
sys/dev/xen/blkfront/block.h:
sys/dev/xen/control/control.c:
sys/dev/xen/evtchn/evtchn_dev.c:
sys/dev/xen/netback/netback.c:
sys/dev/xen/netfront/netfront.c:
sys/xen/xenstore/xenstore.c:
sys/xen/evtchn/evtchn_dev.c:
sys/dev/xen/console/console.c:
sys/dev/xen/console/xencons_ring.c
Adjust drivers to use new xen_intr_*() API.

sys/dev/xen/blkback/blkback.c:
Since blkback defers all event handling to a taskqueue,
convert this task queue to a "fast" taskqueue, and schedule
it via an interrupt filter. This avoids an unnecessary
ithread context switch.

sys/xen/xenstore/xenstore.c:
The xenstore driver is MPSAFE. Indicate as much when
registering its interrupt handler.

sys/xen/xenbus/xenbus.c:
sys/xen/xenbus/xenbusvar.h:
Remove unused event channel APIs.

sys/xen/evtchn.h:
Remove all kernel Xen interrupt service API definitions
from this file. It is now only used for structure and
ioctl definitions related to the event channel userland
device driver.

Update the definitions in this file to match those from
NetBSD. Implementing this interface will be necessary for
Dom0 support.

sys/xen/evtchn/evtchnvar.h:
Add a header file for implemenation internal APIs related
to managing event channels event delivery. This is used
to allow, for example, the event channel userland device
driver to access low-level routines that typical kernel
consumers of event channel services should never access.

sys/xen/interface/event_channel.h:
sys/xen/xen_intr.h:
Standardize on the evtchn_port_t type for referring to
an event channel port id. In order to prevent low-level
event channel APIs from leaking to kernel consumers who
should not have access to this data, the type is defined
twice: Once in the Xen provided event_channel.h, and again
in xen/xen_intr.h. The double declaration is protected by
__XEN_EVTCHN_PORT_DEFINED__ to ensure it is never declared
twice within a given compilation unit.

sys/xen/xen_intr.h:
sys/xen/evtchn/evtchn.c:
sys/x86/xen/xen_intr.c:
sys/dev/xen/xenpci/evtchn.c:
sys/dev/xen/xenpci/xenpcivar.h:
New implementation of Xen interrupt services. This is
similar in many respects to the i386 PV implementation with
the exception that events for bound to event channel ports
(i.e. not IPI, virtual IRQ, or physical IRQ) are further
optimized to avoid mask/unmask operations that aren't
necessary for these edge triggered events.

Stubs exist for supporting physical IRQ binding, but will
need additional work before this implementation can be
fully shared between PV and HVM.

sys/amd64/amd64/mp_machdep.c:
sys/i386/i386/mp_machdep.c:
sys/i386/xen/mp_machdep.c
sys/x86/xen/hvm.c:
Add support for placing vcpu_info into an arbritary memory
page instead of using HYPERVISOR_shared_info->vcpu_info.
This allows the creation of domains with more than 32 vcpus.

sys/i386/i386/machdep.c:
sys/i386/xen/clock.c:
sys/i386/xen/xen_machdep.c:
sys/i386/xen/exception.s:
Add support for new event channle implementation.


254305 13-Aug-2013 jkim

Merge acpica_machdep.h for amd64 and i386 and move to x86. In fact, these
two files were functionally identical.


253747 28-Jul-2013 avg

x86: detect mwait capabilities and extensions, when present

Reviewed by: kib (earlier amd64-only version)
MFC after: 2 weeks


250840 21-May-2013 marcel

Add basic support for FDT to i386 & amd64. This change includes:
1. Common headers for fdt.h and ofw_machdep.h under x86/include
with indirections under i386/include and amd64/include.
2. New modinfo for loader provided FDT blob.
3. Common x86_init_fdt() called from hammer_time() on amd64 and
init386() on i386.
4. Split-off FDT specific low-level console functions from FDT
bus methods for the uart(4) driver. The low-level console
logic has been moved to uart_cpu_fdt.c and is used for arm,
mips & powerpc only. The FDT bus methods are shared across
all architectures.
5. Add dev/fdt/fdt_x86.c to hold the fdt_fixup_table[] and the
fdt_pic_table[] arrays. Both are empty right now.

FDT addresses are I/O ports on x86. Since the core FDT code does
not handle different address spaces, adding support for both I/O
ports and memory addresses requires some thought and discussion.
It may be better to use a compile-time option that controls this.

Obtained from: Juniper Networks, Inc.


249608 18-Apr-2013 rpaulo

Move the previously added CPUID7 macros to CPUID_STDEXT.


249602 18-Apr-2013 rpaulo

Add the most current CPUID7_* definitions.


249351 11-Apr-2013 neel

Make the code to check if VMX is enabled more readable by using macros
instead of magic numbers.

Discussed with: Chris Torek


247047 20-Feb-2013 kib

Convert machine/elf.h, machine/frame.h, machine/sigframe.h,
machine/signal.h and machine/ucontext.h into common x86 includes,
copying from amd64 and merging with i386.

Kernel-only compat definitions are kept in the i386/include/sigframe.h
and i386/include/signal.h, to reduce amd64 kernel namespace pollution.
The amd64 compat uses its own definitions so far.

The _MACHINE_ELF_WANT_32BIT definition is to allow the
sys/boot/userboot/userboot/elf32_freebsd.c to use i386 ELF definitions
on the amd64 compile host. The same hack could be usefully abused by
other code too.


245055 05-Jan-2013 neel

Add macros required to enable VMX operation on Intel processors.

Obtained from: NetApp


244193 13-Dec-2012 jimharris

Add bus_space_read_8 and bus_space_write_8 for amd64.

Rather than trying to KASSERT for callers that invoke this on
IO tags, either do nothing (for write_8) or return ~0 (for read_8).
Using KASSERT here just makes bus.h too messy from both
polluting bus.h with systm.h (for any number of drivers that include
bus.h without first including systm.h) or ports that use bus.h
directly (i.e. libpciaccess) as reported by zeising@.

Also don't try to implement all of the other bus_space functions for
8 byte access since realistically only these two are needed for some
devices that expose 64-bit memory-mapped registers.

Put the amd64-specific functions here rather than sys/amd64/include/bus.h
so that we can keep this header unified for x86, as requested by mdf@
and tijl@.

Submitted by: Carl Delsey <carl.r.delsey@intel.com>
MFC after: 3 days


244191 13-Dec-2012 jimharris

Revert r243960 based on feedback regarding keeping x86 headers unified
(mdf@, tijl@) and use of KASSERT/systm.h in bus.h (zeising@, bde@).

Alternate implementation will be made in a separate commit.


243960 06-Dec-2012 jimharris

Add amd64 implementations for 8-byte bus_space routines.

Submitted by: Carl Delsey <carl.r.delsey@intel.com>
Discussed with: jhb, rwatson
Reviewed by: jimharris
MFC after: 1 week


242432 01-Nov-2012 kib

Provide the reading and display of the Standard Extended Features,
introduced with the IvyBridge CPUs. Provide the definitions for new
bits in CR3 and CR4 registers.

Tested by: avg, Michael Moll <kvedulv@kvedulv.de>
MFC after: 2 weeks


241374 09-Oct-2012 attilio

Add an unified macro to deny ability from the compiler to reorder
instruction loads/stores at its will.
The macro __compiler_membar() is currently supported for both gcc and
clang, but kernel compilation will fail otherwise.

Reviewed by: bde, kib
Discussed with: dim, theraven
MFC after: 2 weeks


238450 14-Jul-2012 kib

Add support for the XSAVEOPT instruction use. Our XSAVE/XRSTOR usage
mostly meets the guidelines set by the Intel SDM:
1. We use XRSTOR and XSAVE from the same CPL using the same linear
address for the store area
2. Contrary to the recommendations, we cannot zero the FPU save area
for a new thread, since fork semantic requires the copy of the
previous state. This advice seemingly contradicts to the advice
from the item 6.
3. We do use XSAVEOPT in the context switch code only, and the area
for XSAVEOPT already always contains the data saved by XSAVE.
4. We do not modify the save area between XRSTOR, when the area is
loaded into FPU context, and XSAVE. We always spit the fpu context
into save area and start emulation when directly writing into FPU
context.
5. We do not use segmented addressing to access save area, or rather,
always address it using %ds basing.
6. XSAVEOPT can be only executed in the area which was previously
loaded with XRSTOR, since context switch code checks for FPU use by
outgoing thread before saving, and thread which stopped emulation
forcibly get context loaded with XRSTOR.
7. The PCB cannot be paged out while FPU emulation is turned off, since
stack of the executing thread is never swapped out.

The context switch code is patched to issue XSAVEOPT instead of XSAVE
if supported. This approach eliminates one conditional in the context
switch code, which would be needed otherwise.

For user-visible machine context to have proper data, fpugetregs()
checks for unsaved extension blocks and manually copies pristine FPU
state into them, according to the description provided by CPUID leaf
0xd.

MFC after: 1 month


237517 24-Jun-2012 andrew

Make the wchar_t type machine dependent.

This is required for ARM EABI. Section 7.1.1 of the Procedure Call for the
ARM Architecture (AAPCS) defines wchar_t as either an unsigned int or an
unsigned short with the former preferred.

Because of this requirement we need to move the definition of __wchar_t to
a machine dependent header. It also cleans up the macros defining the limits
of wchar_t by defining __WCHAR_MIN and __WCHAR_MAX in the same machine
dependent header then using them to define WCHAR_MIN and WCHAR_MAX
respectively.

Discussed with: bde


237433 22-Jun-2012 kib

Implement mechanism to export some kernel timekeeping data to
usermode, using shared page. The structures and functions have vdso
prefix, to indicate the intended location of the code in some future.

The versioned per-algorithm data is exported in the format of struct
vdso_timehands, which mostly repeats the content of in-kernel struct
timehands. Usermode reading of the structure can be lockless.
Compatibility export for 32bit processes on 64bit host is also
provided. Kernel also provides usermode with indication about
currently used timecounter, so that libc can fall back to syscall if
configured timecounter is unknown to usermode code.

The shared data updates are initiated both from the tc_windup(), where
a fast task is queued to do the update, and from sysctl handlers which
change timecounter. A manual override switch
kern.timecounter.fast_gettime allows to turn off the mechanism.

Only x86 architectures export the real algorithm data, and there, only
for tsc timecounter. HPET counters page could be exported as well, but
I prefer to not further glue the kernel and libc ABI there until
proper vdso-based solution is developed.

Minimal stubs neccessary for non-x86 architectures to still compile
are provided.

Discussed with: bde
Reviewed by: jhb
Tested by: flo
MFC after: 1 month


235939 24-May-2012 obrien

Consitently use "__LP64__".
[there are 33 __LP64__'s in the kernel (minus cddl/ and contrib/),
and 11 _LP64's]


235563 17-May-2012 jhb

Don't expose i386-only ptrace constants on amd64. This broke gdb with
libthread_db on amd64.

Reported by: avg


234364 17-Apr-2012 grehan

Add x2apic MSR definitions

Reviewed by: jhb
Obtained from: bhyve via Neel via NetApp


234059 09-Apr-2012 jhb

Recognize the RDRAND instruction feature.

Submitted by: Michael Fuckner michael fuckner net
MFC after: 3 days


233781 02-Apr-2012 jhb

Make machine check exception logging more readable. On newer Intel systems,
an uncorrected ECC error tends to fire on all CPUs in a package
simultaneously and the current printf hacks are not sufficient to make
the messages legible. Instead, use the existing mca_lock spinlock to
serialize calls to mca_log() and change the machine check code to panic
directly when an unrecoverable error is encoutered rather than falling
back to a trap_fatal() call in trap() (which adds nearly a screen-full of
logging messages that aren't useful for machine checks).

MFC after: 2 weeks


233707 30-Mar-2012 jhb

Move the legacy(4) driver to x86.


233684 29-Mar-2012 dim

Fix an issue introduced in sys/x86/include/endian.h with r232721. In
that revision, the bswapXX_const() macros were renamed to bswapXX_gen().

Also, bswap64_gen() was implemented as two calls to bswap32(), and
similarly, bswap32_gen() as two calls to bswap16(). This mainly helps
our base gcc to produce more efficient assembly.

However, the arguments are not properly masked, which results in the
wrong value being calculated in some instances. For example,
bswap32(0x12345678) returns 0x7c563412, and bswap64(0x123456789abcdef0)
returns 0xfcdefc9a7c563412.

Fix this by appropriately masking the arguments to bswap16() in
bswap32_gen(), and to bswap32() in bswap64_gen(). This should also
silence warnings from clang.

Submitted by: jh


233683 29-Mar-2012 dim

Revert sys/x86/include/endian.h to what it was before r233419, as that
revision has two problems:
- It can produce worse code with both clang and gcc.
- It doesn't fix the actual issue introduced in r232721, which will be
fixed in the next commit.

Submitted by: bde, tijl and jh
Pointy hat to: dim


233613 28-Mar-2012 jhb

Move the DTrace return IDT vector back up from 0x20 to 0x92. The 0x20
vector is currently dedicated to servicing IRQ 0 from the 8259A's, so
it shouldn't be overloaded for DTrace.

Tested by: rstone
MFC after: 1 week


233419 24-Mar-2012 dim

Fix the following clang warning in sys/dev/dcons/dcons.c, caused by the
recent changes in sys/x86/include/endian.h:

sys/dev/dcons/dcons.c:190:15: error: implicit conversion from '__uint32_t' (aka 'unsigned int') to '__uint16_t' (aka 'unsigned short') changes value from 1684238190 to 28526 [-Werror,-Wconstant-conversion]
buf->magic = ntohl(DCONS_MAGIC);
^~~~~~~~~~~~~~~~~~
sys/sys/param.h:306:18: note: expanded from:
#define ntohl(x) __ntohl(x)
^
./x86/endian.h:128:20: note: expanded from:
#define __ntohl(x) __bswap32(x)
^
./x86/endian.h:78:20: note: expanded from:
__bswap32_gen((__uint32_t)(x)) : __bswap32_var(x))
^
./x86/endian.h:68:26: note: expanded from:
(((__uint32_t)__bswap16(x) << 16) | __bswap16((x) >> 16))
^
./x86/endian.h:75:53: note: expanded from:
__bswap16_gen((__uint16_t)(x)) : __bswap16_var(x)))
~~~~~~~~~~~~~ ^

This is because the __bswapXX_gen() macros (for x86) call the regular
__bswapXX() macros. Since the __bswapXX_gen() variants are only called
when their arguments are constant, there is no need to do that constancy
check recursively. Also, it causes the above error with clang.

Fix it by calling __bswap16_gen() from __bswap32_gen(), and similarly,
__bswap32_gen() from __bswap64_gen().

While here, add extra parentheses around the __bswap16_gen() macro
expansion, to prevent unexpected side effects.


233209 19-Mar-2012 tijl

Copy amd64 sysarch.h to x86 and merge with i386 sysarch.h. Replace
amd64/i386/pc98 sysarch.h with stubs.


233207 19-Mar-2012 tijl

Copy i386 specialreg.h to x86 and merge with amd64 specialreg.h. Replace
amd64/i386/pc98 specialreg.h with stubs.


233204 19-Mar-2012 tijl

Copy i386 psl.h to x86 and replace amd64/i386/pc98 psl.h with stubs.


233203 19-Mar-2012 tijl

Move userland bits (and some common kernel bits) from amd64 and i386
segments.h to a new x86 segments.h.

Add __packed attribute to some structs (just to be sure).
Also make it clear that i386 GDT and LDT entries are used in ia64 code.


233125 18-Mar-2012 tijl

Eliminate ia32_reg.h by moving its contents to x86 and ia64 reg.h.

Reviewed by: kib


233124 18-Mar-2012 tijl

Copy i386 reg.h to x86 and merge with amd64 reg.h. Replace i386/amd64/pc98
reg.h with stubs.

The tREGISTER macros are only made visible on i386. These macros are
deprecated and should not be available on amd64.

The i386 and amd64 versions of struct reg have been renamed to struct
__reg32 and struct __reg64. During compilation either __reg32 or __reg64
is defined as reg depending on the machine architecture. On amd64 the i386
struct is also available as struct reg32 which is used in COMPAT_FREEBSD32
code.

Most of compat/ia32/ia32_reg.h is now IA64 only.

Reviewed by: kib (previous version)


233044 16-Mar-2012 tijl

Move userland bits of i386 npx.h and amd64 fpu.h to x86 fpu.h.
Remove FPU types from compat/ia32/ia32_reg.h that are no longer needed.
Create machine/npx.h on amd64 to allow compiling i386 code that uses
this header.

The original npx.h and fpu.h define struct envxmm differently. Both
definitions have been included in the new x86 header as struct __envxmm32
and struct __envxmm64. During compilation either __envxmm32 or __envxmm64
is defined as envxmm depending on machine architecture. On amd64 the i386
struct is also available as struct envxmm32.

Reviewed by: kib


232745 09-Mar-2012 dim

Add casts to __uint16_t to the __bswap16() macros on all arches which
didn't already have them. This is because the ternary expression will
return int, due to the Usual Arithmetic Conversions. Such casts are not
needed for the 32 and 64 bit variants.

While here, add additional parentheses around the x86 variant, to
protect against unintended consequences.

MFC after: 2 weeks


232730 09-Mar-2012 tijl

Cast the expression in __bswap16(x) to __uint16_t because it is promoted
to int.

Reviewed by: dim


232721 09-Mar-2012 tijl

Clean up x86 endian.h:
- Remove extern "C". There are no functions with external linkage here. [1]
- Rename bswapNN_const(x) to bswapNN_gen(x) to indicate that these macros
are generic implementations that can take non-constant arguments. [1]
- Split up __GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P and deal with
each separately.
- Replace _LP64 with __amd64__ because asm instructions are machine
dependent, not ABI dependent.

Submitted by: bde [1]
Reviewed by: bde


232520 04-Mar-2012 tijl

Copy amd64 ptrace.h to x86 and merge with i386 ptrace.h. Replace
amd64/i386/pc98 ptrace.h with stubs.

For amd64 PT_GETXSTATE and PT_SETXSTATE have been redefined to match the
i386 values. The old values are still supported but should no longer be
used.

Reviewed by: kib


232519 04-Mar-2012 tijl

Do not use INT64_C and UINT64_C to define 64 bit integer limits. They
aren't defined for C++ code unless __STDC_CONSTANT_MACROS is defined.

Reported by: jhb


232492 04-Mar-2012 tijl

Copy amd64 trap.h to x86 and replace amd64/i386/pc98 trap.h with stubs.


232491 04-Mar-2012 tijl

Copy amd64 float.h to x86 and merge with i386 float.h. Replace
amd64/i386/pc98 float.h with stubs.


232276 28-Feb-2012 tijl

Copy amd64 stdarg.h to x86 and replace amd64/i386/pc98 stdarg.h with stubs.


232275 28-Feb-2012 tijl

Copy amd64 setjmp.h to x86 and replace amd64/i386/pc98 setjmp.h with stubs.


232266 28-Feb-2012 tijl

Copy amd64 endian.h to x86 and merge with i386 endian.h. Replace
amd64/i386/pc98 endian.h with stubs.

In __bswap64_const(x) the conflict between 0xffUL and 0xffULL has been
resolved by reimplementing the macro in terms of __bswap32(x). As a side
effect __bswap64_var(x) is now implemented using two bswap instructions on
i386 and should be much faster. __bswap32_const(x) has been reimplemented
in terms of __bswap16(x) for consistency.


232264 28-Feb-2012 tijl

Copy amd64 _stdint.h to x86 and merge with i386 _stdint.h. Replace
amd64/i386/pc98 _stdint.h with stubs.


232262 28-Feb-2012 tijl

Copy amd64 _limits.h to x86 and merge with i386 _limits.h. Replace
amd64/i386/pc98 _limits.h with stubs.


232261 28-Feb-2012 tijl

Copy amd64 _types.h to x86 and merge with i386 _types.h. Replace existing
amd64/i386/pc98 _types.h with stubs.


224096 16-Jul-2011 jhb

Fix build when NEW_PCIB is not defined.

Submitted by: gcooper (partially)
Pointy hat to: jhb


224069 15-Jul-2011 jhb

Respect the BIOS/firmware's notion of acceptable address ranges for PCI
resource allocation on x86 platforms:
- Add a new helper API that Host-PCI bridge drivers can use to restrict
resource allocation requests to a set of address ranges for different
resource types.
- For the ACPI Host-PCI bridge driver, use Producer address range resources
in _CRS to enumerate valid address ranges for a given Host-PCI bridge.
This can be disabled by including "hostres" in the debug.acpi.disabled
tunable.
- For the MPTable Host-PCI bridge driver, use entries in the extended
MPTable to determine the valid address ranges for a given Host-PCI
bridge. This required adding code to parse extended table entries.

Similar to the new PCI-PCI bridge driver, these changes are only enabled
if the NEW_PCIB kernel option is enabled (which is enabled by default on
amd64 and i386).

Approved by: re (kib)


223440 22-Jun-2011 jhb

Move {amd64,i386}/pci/pci_bus.c and {amd64,i386}/include/pci_cfgreg.h to
the x86 tree. The $PIR code is still only enabled on i386 and not amd64.
While here, make the qpi(4) driver on conditional on 'device pci'.


217157 08-Jan-2011 tijl

Copy powerpc/include/_inttypes.h to x86 and replace i386/amd64/pc98
headers with stubs.

Approved by: kib (mentor)


216592 20-Dec-2010 tijl

Merge amd64 and i386 bus.h and move the resulting header to x86. Replace
the original amd64 and i386 headers with stubs.

Rename (AMD64|I386)_BUS_SPACE_* to X86_BUS_SPACE_* everywhere.

Reviewed by: imp (previous version), jhb
Approved by: kib (mentor)


215856 26-Nov-2010 tijl

Merge amd64/i386 _align.h by aligning on the size of register_t (copied
from powerpc).

Reviewed by: imp, jhb
Approved by: kib (mentor)


215140 11-Nov-2010 jkim

Move identical copies of apm_bios.h to sys/x86/include, replace them with
stubs, and adjust PC98 stub accordingly.

Reviewed by: imp, nyan


215051 09-Nov-2010 attilio

Move the mptable.h under x86/include/.

Sponsored by: Sandvine Incorporated
MFC after: 14 days


214631 01-Nov-2010 jhb

Move <machine/apicreg.h> to <x86/apicreg.h>.


214630 01-Nov-2010 jhb

Move the <machine/mca.h> header to <x86/mca.h>.


214629 01-Nov-2010 jhb

Add an x86/include directory to the kernel to hold headers that are common
to amd64, i386, and pc98. The headers are installed to /usr/include/x86
during an installworld, and an 'x86' symlink is created for kernel builds
similar to 'machine' so that the headers can be included as <x86/foo.h>.

Reviewed by: imp