Commit Graph

11668 Commits

Author SHA1 Message Date
John Baldwin
cd6f0f7554 MFC 204518:
Print the contents of the miscellaneous (MISC) register to the console if
it is valid along with the other register values when a machine check is
encountered.
2010-03-08 21:36:20 +00:00
Alan Cox
c288186fe8 MFC r204420
When running as a guest operating system, the FreeBSD kernel must assume
  that the virtual machine monitor has enabled machine check exceptions.
  Unfortunately, on AMD Family 10h processors the machine check hardware
  has a bug (Erratum 383) that can result in a false machine check exception
  when a superpage promotion occurs.  Thus, I am disabling superpage
  promotion when the FreeBSD kernel is running as a guest operating system
  on an AMD Family 10h processor.
2010-03-02 16:29:08 +00:00
Xin LI
aa3d547d09 MFC x86emu/x86bios emulator and make previously i386 only dpms and vesa
framebuffer driver, etc. work on FreeBSD/amd64.

A significant amount of improvements were done by jkim@ during the recent
months to make vesa(4) work better, over the initial code import.  This
work is based on OpenBSD's x86emu implementation and contributed by
paradox <ddkprog yahoo com> and swell.k at gmail com.

Hopefully I have stolen all their work to 8-STABLE :)

All bugs in this commit are mine, as usual.
2010-03-02 01:56:55 +00:00
Brooks Davis
3c48c0897f MFC r202143,202163,202341,202342,204278
Replace the static NGROUPS=NGROUPS_MAX+1=1024 with a dynamic
  kern.ngroups+1.  kern.ngroups can range from NGROUPS_MAX=1023 to
  somewhere in the neighborhood of INT_MAX/4 one a system with sufficent
  RAM and memory bandwidth.  Given that the Windows group limit is
  1024, this range should be sufficient for most applications

r202342:
  Only allocate the space we need before calling kern_getgroups instead
  of allocating what ever the user asks for up to "ngroups_max + 1".  On
  systems with large values of kern.ngroups this will be more efficient.

  The now redundant check that the array is large enough in
  kern_getgroups() is deliberate to allow this change to be merged to
  stable/8 without breaking potential third party consumers of the API.
2010-02-24 22:16:16 +00:00
Alan Cox
454947a618 MFC r203085
Optimize pmap_demote_pde() by using the new KPTmap to access a kernel
  page table page instead of creating a temporary mapping to it.

  Set the PG_G bit on the page table entries that implement the KPTmap.

  Locore initializes the unused portions of the NKPT kernel page table
  pages that it allocates to zero.  So, pmap_bootstrap() needn't zero
  the page table entries referenced by CMAP1 and CMAP3.

  Simplify pmap_set_pg().
2010-02-21 04:10:25 +00:00
Konstantin Belousov
c329abd0d3 MFC r202882:
For i386, amd64 and ia32 on amd64 MD syscall(), reread syscall number
and arguments after ptracestop(), if debugger modified anything in the
process environment.
2010-02-07 11:37:38 +00:00
Andriy Gapon
bb07fbe3c1 MFC r203160: add static qualifier to definition of a static function 2010-02-06 12:17:20 +00:00
Gavin Atkinson
75cf52103d Merge r202161 from head:
Spell "Hz" correctly wherever it is user-visible.

PR:		bin/142566
Submitted by:	N.J. Mann   njm njm.me.uk
2010-02-05 08:52:51 +00:00
Alan Cox
6d41eae028 MFC r202894
Handle a race between pmap_kextract() and pmap_promote_pde().
2010-01-30 06:23:28 +00:00
Marcel Moolenaar
4b5ab11113 MFC rev. 202097:
Use io(4) for I/O port access on ia64, rather than through sysarch(2).
2010-01-22 03:50:43 +00:00
John Baldwin
7b10638c5b MFC 198134,198149,198170,198171,198391,200948:
Add a facility for associating optional descriptions with active interrupt
handlers.  This is primarily intended as a way to allow devices that use
multiple interrupts (e.g. MSI) to meaningfully distinguish the various
interrupt handlers.
- Add a new BUS_DESCRIBE_INTR() method to the bus interface to associate
  a description with an active interrupt handler setup by BUS_SETUP_INTR.
  It has a default method (bus_generic_describe_intr()) which simply passes
  the request up to the parent device.
- Add a bus_describe_intr() wrapper around BUS_DESCRIBE_INTR() that supports
  printf(9) style formatting using var args.
- Reserve MAXCOMLEN bytes in the intr_handler structure to hold the name of
  an interrupt handler and copy the name passed to intr_event_add_handler()
  into that buffer instead of just saving the pointer to the name.
- Add a new intr_event_describe_handler() which appends a description string
  to an interrupt handler's name.
- Implement support for interrupt descriptions on amd64, i386, and sparc64 by
  having the nexus(4) driver supply a custom bus_describe_intr method that
  invokes a new intr_describe() MD routine which in turn looks up the
  associated interrupt event and invokes intr_event_describe_handler().
2010-01-21 17:54:29 +00:00
Alan Cox
294a68ca62 MFC r202085
Simplify pmap_init().  Additionally, correct a harmless misbehavior on
  i386.
2010-01-18 21:17:03 +00:00
Warner Losh
7578ff89fc MFC r202019:
Add INCLUDE_CONFIG_FILE in GENERIC on all non-embedded platforms.
  # This is the resolution of removing it from DEFAULTS...
2010-01-18 00:53:21 +00:00
Brooks Davis
9600c47d52 MFC r201443:
Add vlan(4) to all GENERIC kernels.
2010-01-12 06:00:56 +00:00
Warner Losh
1b1bff673f Revert 201158. DEFAULTS isn't for this kind of thing.a 2010-01-04 21:33:10 +00:00
Doug Barton
be0d315238 MFC r200594:
Add INCLUDE_CONFIG_FILE, and a note in comments about how to also
include the comments with CONFIGARGS
2009-12-29 05:35:25 +00:00
John Baldwin
262cd96817 MFC 200514:
Remove comment claiming that building acpi into the kernel is deprecated.
2009-12-22 14:58:23 +00:00
Andriy Gapon
5e860e7b2f MFC r199969: amdsbwd: new driver for AMD SB600/SB7xx watchdog timer 2009-12-21 05:58:55 +00:00
Konstantin Belousov
43ba78037b MFC r198507:
Use kern_sigprocmask() instead of direct manipulation of td_sigmask to
reschedule newly blocked signals.

MFC r198590:
Trapsignal() calls kern_sigprocmask() when delivering catched signal
with proc lock held.

MFC r198670:
For trapsignal() and postsig(), kern_sigprocmask() is called with
both process lock and curproc->p_sigacts->ps_mtx locked. Prevent lock
recursion on ps_mtx in reschedule_signals().
2009-12-19 11:31:28 +00:00
Andriy Gapon
176c4e5508 MFC r200064: mca: small enhancements related to cpu quirks 2009-12-19 10:44:26 +00:00
Andriy Gapon
c9ac7946d7 MFC r200033: mca: improve status checking, recording and reporting 2009-12-19 10:38:28 +00:00
Konstantin Belousov
f0087a7a3c MFC r199135:
Extract the code that records syscall results in the frame into MD
function cpu_set_syscall_retval().
2009-12-12 20:06:25 +00:00
Andriy Gapon
2cd46f059b MFC r199968: x86 cpu features: add MOVBE reporting and flag 2009-12-08 15:27:06 +00:00
Andriy Gapon
3ed91d6a6d MFC r199184: reflect that pg_ps_enabled is a tunable 2009-12-08 15:21:39 +00:00
Bjoern A. Zeeb
c4de0a57f3 MFC r197729:
Make sure that the primary native brandinfo always gets added
  first and the native ia32 compat as middle (before other things).
  o(ld)brandinfo as well as third party like linux, kfreebsd, etc.
  stays on SI_ORDER_ANY coming last.

  The reason for this is only to make sure that even in case we would
  overflow the MAX_BRANDS sized array, the native FreeBSD brandinfo
  would still be there and the system would be operational.

Reviewed by:	kib
2009-12-05 20:43:15 +00:00
Bjoern A. Zeeb
a1778929b7 MFC r197518:
lindev(4) [1] is supposed to be a collection of linux-specific pseudo
  devices that we also support, just not by default (thus only LINT or
  module builds by default).

  While currently there is only "/dev/full" [2], we are planning to see more
  in the future.  We may decide to change the module/dependency logic in the
  future should the list grow too long.

  This is not part of linux.ko as also non-linux binaries like kFreeBSD
  userland or ports can make use of this as well.

Suggested by:	rwatson [1] (name)
Submitted by:	ed [2]
Discussed with:	markm, ed, rwatson, kib (weeks ago)
Reviewed by:	rwatson, brueffer (prev. version)
PR:		kern/68961
2009-12-05 20:37:46 +00:00
Alexander Motin
4fb5bc4259 MFC r199268, r199269, r199273:
Core2Duo/Core2Quad CPUs are unable to control frequency of single CPU
core, only pair of them. As result, both cores are running on highest
one of requested frequencies, and that is reported by status register.
Such behavior confuses frequency validation logic, as it runs on only
one core, as SMP is not yet launched, making EIST completely unusable.

Disable frequency validation by default, for systems with more then one
CPU, until we can implement it properly. It looks like making more harm
now then benefits. Add 'hw.est.strict' loader tunable to control it.

PR:		amd64/140506
2009-11-26 15:11:19 +00:00
Kip Macy
fa178c7b04 fix UP compilation 2009-11-25 01:55:34 +00:00
Kip Macy
4956a0d10f MFC xen pmap updates and eflags fixes 2009-11-25 01:52:36 +00:00
Jun Kuriyama
9497adf974 - MFC r199067,199215,199253
- Add hw.clflush_disable loader tunable to avoid panic (trap 9) at
    map_invalidate_cache_range() even if CPU is not Intel.

  - This tunable can be set to -1 (default), 0 and 1.  -1 is same as
    current behavior, which automatically disable CLFLUSH on Intel CPUs
    without CPUID_SS (should be occured on Xen only).  You can specify 1
    when this panic happened on non-Intel CPUs (such as AMD's).  Because
    disabling CLFLUSH may reduce performance, you can try with setting 0
    on Intel CPUs without SS to use CLFLUSH feature.

  - Amd64 init_secondary() calls initializecpu() while curthread is
    still not properly set up. r199067 added the call to
    TUNABLE_INT_FETCH() to initializecpu() that results in hang because
    AP are started when kernel environment is already dynamic and thus
    needs to acquire mutex, that is too early in AP start sequence to
    work.

    Extract the code that should be executed only once, because it sets
    up global variables, from initializecpu() to initializecpucache(),
    and call the later only from hammer_time() executed on BSP. Now,
    TUNABLE_INT_FETCH() is done only once at BSP at the early boot
    stage.
2009-11-22 14:32:32 +00:00
Yoshihiro Takahashi
50324497fb MFC: revision 199219
Fix cpu model for PODP5V83.  It is P24T, not P54T.
  Also remove redundant 'Overdrive' word.
2009-11-19 12:07:00 +00:00
John Baldwin
fb5f8c0a4f MFC 198043:
Move the USB wireless drivers down into their own section next to the USB
ethernet drivers.
2009-11-17 15:56:45 +00:00
Ken Smith
50aa951061 Comment out the sbp(4) entry for GENERIC config files that contain it.
There are known issues with this driver that are beyond what can be
fixed for 8.0-RELEASE and the bugs can cause boot failure on some systems.
It's not clear if it impacts all systems and there is interest in getting
the problem fixed so for now just comment it out instead of remove it.

Commit straight to stable/8, this is an 8.0-RELEASE issue.  Head was left
alone so work on it can continue there.

Reviewed by:	Primary misc. architecture maintainers (marcel, marius)
2009-11-09 21:39:42 +00:00
Attilio Rao
dcf9f13772 MFC r197070:
Consolidate CPUID to CPU family/model macros for amd64 and i386 to reduce
unnecessary #ifdef's for shared code between them.

This MFC should unbreak the kernel build breakage introduced by
r198977.

Reported by:	kib
Pointy hat to:	me
2009-11-06 15:24:48 +00:00
Attilio Rao
063e246163 MFC r198868, r198950:
Opteron rev E family of processor expose a bug where acq memory barriers
can be broken, resulting in random breakages.
Printout a warning message if affecred family and model are found.
2009-11-06 10:15:15 +00:00
John Baldwin
dad4753c04 MFC 198554:
Fix some problems with effective mmap() offsets > 32 bits.  This was
partially fixed on amd64 earlier.  Rather than forcing linux_mmap_common()
to use a 32-bit offset, have it accept a 64-bit file offset.  This offset
is then passed to the real mmap() call.  Rather than inventing a structure
to hold the normal linux_mmap args that has a 64-bit offset, just pass
each of the arguments individually to linux_mmap_common() since that more
closes matches the existing style of various kern_foo() functions.
2009-11-04 20:49:14 +00:00
Andriy Gapon
ea9b1909f6 MFC 197450: number of cleanups in i386 and amd64 pci md code 2009-11-01 18:39:26 +00:00
Andriy Gapon
fc06d8191e MFC 198271: add amdtemp to i386 NOTES 2009-11-01 17:53:33 +00:00
Andriy Gapon
f13868d206 MFC 197647: cpufunc.h: unify/correct style of c extension names 2009-11-01 17:45:37 +00:00
Alan Cox
13529df13b MFC r197317
When superpages are enabled, add the 2 or 4MB page size to the array of
  supported page sizes.
2009-10-31 19:02:08 +00:00
Alan Cox
ebc91405bd MFC r197316
Add a new sysctl for reporting all of the supported page sizes.
2009-10-31 18:54:26 +00:00
Konstantin Belousov
c2204c03c8 MFC r197389:
Do panic regardeless of execution mode at the moment of T_RESERVED trap.
2009-10-29 16:24:39 +00:00
John Baldwin
ff5bfa3ef6 MFC 197439:
Extract the code to find and map the MADT ACPI table during early kernel
startup and genericize it so it can be reused to map other tables as well:
- Add a routine to walk a list of ACPI subtables such as those used in the
  APIC and SRAT tables in the MI acpi(4) driver.
- Move the routines for mapping and unmapping an ACPI table as well as
  mapping the RSDT or XSDT and searching for a table with a given signature
  out into acpica_machdep.c for both amd64 and i386.
2009-10-29 16:00:27 +00:00
Konstantin Belousov
55f128de91 MFC r197933:
Define architectural load bases for PIE binaries.

MFC r198203 (by marius):
Change load base for sparc to match default gcc memory layout model.

Approved by:	re (kensmith)
2009-10-20 13:32:28 +00:00
Attilio Rao
4dc32a7398 MFC r197803, r197824, r197910:
Per their definition, atomic instructions used in conjuction with
memory barriers should also ensure that the compiler doesn't reorder paths
where they are used.  GCC, however, does that aggressively, even in
presence of volatile operands.  The most reliable way GCC offers for avoid
instructions reordering is clobbering "memory".
Not all our memory barriers, right now, clobber memory for GCC-like
compilers.
Fix these cases.

Approved by:	re (kib)
2009-10-12 16:05:31 +00:00
Konstantin Belousov
9072a0309e MFC r197663:
As a workaround, for Intel CPUs, do not use CLFLUSH in
pmap_invalidate_cache_range() when self-snoop is apparently not reported
in cpu features.

Approved by:	re (bz, kensmith)
2009-10-04 12:20:59 +00:00
Rui Paulo
f24f7ffbd4 MFC r197653:
Improve 802.11s comment.

Approved by:	re (kib)
2009-10-01 10:06:09 +00:00
John Baldwin
57a0ee4c0b MFC 197410:
- Split the logic to parse an SMAP entry out into a separate function on
  amd64 similar to i386.  This fixes a bug on amd64 where overlapping
  entries would not cause the SMAP parsing to stop.
- Change the SMAP parsing code to do a sorted insertion into physmap[]
  instead of an append to support systems with out-of-order SMAP entries.

Approved by:	re (kib)
2009-09-25 15:08:26 +00:00
Konstantin Belousov
72c975651d MFC r197046:
As was done in r196643 for i386 and amd64, swap the start/end virtual
addresses in pmap_invalidate_cache_range().

Approved by:	re (kensmith)
2009-09-12 18:11:48 +00:00
Ken Smith
ac7d4c93c6 Remove extra debugging support that is turned on for head but turned off
for stable branches:

	- shift to MALLOC_PRODUCTION
	- turn off automatic crash dumps
	- Remove kernel debuggers, INVARIANTS*[1], WITNESS* from
	  GENERIC kernel config files[2]

[1] INVARIANTS* left on for ia64 by request marcel
[2] sun4v was left as-is

Reviewed by:	marcel, kib
Approved by:	re (implicit)
2009-09-10 14:04:00 +00:00