4542 Commits

Author SHA1 Message Date
jhb
b320baddf7 MFC some fixes to IPI_PREEMPT:
- Use the proper bitmask tests for an IPI in the bitmap handler on amd64
  and i386.
- Don't test against idle priority, just the idle thread in the IPI_PREEMPT
  handlers.
2007-10-08 21:51:01 +00:00
jhb
8d5360c01e MFC: Handle CPUs with APIC IDs higher than 32. 2007-10-05 15:22:37 +00:00
jhb
1db2bde192 MFC: Use rman_set_rid() to save the rid in new resources when they are
allocated.  This makes 'bus_free_resource()' safe to use in 6.x and also
fixes an issue with the recent PCI MSI code MFCs that caused them to never
update the MSI config registers.

Reported by:	gallatin (MSI breakage)
2007-10-03 20:41:35 +00:00
gallatin
ce75f1ca36 MFC: sync the mxge driver with HEAD, modulo some slight differences
due to RELENG_6 limitations.
	(no TSO in RELENG_6, no VLAN tag insertion/removal due to
         vlan differences, etc).
2007-10-02 15:59:54 +00:00
des
6864233f0c MFC: coretemp(4) 2007-09-28 08:54:41 +00:00
des
1784c5897c MFC: whitespace changes from HEAD 2007-09-28 08:43:54 +00:00
des
8581c17a99 MFC: synch with HEAD, minus whitespace changes. 2007-09-28 08:42:04 +00:00
des
58043bbfa7 MFC: remove confusing boot message, add feature bits 2007-09-28 08:26:16 +00:00
peter
ad71fee25d Export the MAXCPU symbol to assym.s. This is used to size the intrcnt
and intrnames arrays.  as(1)/ld(1) don't detect the undefined MAXCPU
variable, leading to insufficient space being reserved.
2007-09-10 23:01:35 +00:00
netchild
68fcd79292 MFC:
- sync linuxulator:
   * de-COMPAT_43-ify:
     + socket related ioctl's
     This differs from -current, as the kernel ABI is different
     (kern_bind() and kern_connect() free the struct sockaddr on -stable
     themself, so two calls to free() are not included in this MFC).
   * bug-/compatibility-fixes
   * ioctl TIOCGPTN
   * 1 style(9)-fix

Tested by:	"Arno J. Klaassen" <arno@heho.snv.jussieu.fr>
2007-09-03 13:18:42 +00:00
netchild
3e5a47e506 Remove second entry for tgkill.
Noticed by:	dwhite
2007-08-30 07:16:58 +00:00
peter
cd2b6bda41 MFC: rev 1.261. Set a stack for interrupt stack 1 (double fault) on
AP cpus.  This changes a guaranteed triple-fault (silent reset) into
something that has a chance to work.  Apparently, the NMI handler uses
this stack too.
2007-08-29 23:26:33 +00:00
netchild
e0b4a0fff2 regen 2007-08-29 15:05:36 +00:00
netchild
5a60814e56 MFC:
- sync linuxulator:
   * add syscalls:
     + stat            (i386, amd64)
     + iopl            (i386, amd64)
     + mprotect        (i386)
     + rt_sigpending   (i386)
     + rt_sigtimedwait (i386)
     + statfs64        (i386, amd64)
     + utimes          (i386, amd64)
     + settimeofday    (amd64)
     + clock_*         (i386, amd64)
   * de-COMPAT_43-ify:
     + sethostname
     + lstat
     + ftruncate
     + nanosleep (i386)
   * add more dummy syscalls so that we know what is needed

Tested by:	bsam (on i386/amd64 with LTP 20070630)
2007-08-29 15:04:26 +00:00
jhb
99ff582459 MFC: Move 'intbase != expected base' warning under boot verbose.
Requested by:	delphij
2007-08-28 15:47:41 +00:00
jhb
ce3ef5f34e MFC: Partial MFC of earlier minor fixes and tweaks to x86 interrupt code:
- Add a new nexus hook: nexus_add_irq() to ask the nexus driver to add an
  IRQ to its irq_rman.  The MSI code uses this when it creates new
  interrupt sources to let the nexus know about newly valid IRQs.
  Previously the msi_alloc() and msix_alloc() passed some extra stuff
  back to the nexus methods which then added the IRQs.  This approach is
  a bit cleaner.
- Change the MSI sx lock to a mutex.  If we need to create new sources,
  drop the lock, create the required number of sources, then get the lock
  and try the allocation again.
2007-08-15 21:12:08 +00:00
jhb
24a23340cc MFC: Revamp the MSI/MSI-X code a bit to achieve two main goals:
- Simplify the amount of work that has be done for each architecture by
  pushing more of the truly MI code down into the PCI bus driver.
- Don't bind MSI-X indicies to IRQs so that we can allow a driver to map
  multiple MSI-X messages into a single IRQ when handling a message
  shortage.

Note that as with the previous MSI MFC, this does not yet include the
'pci_remap_msix()' function.
2007-08-15 20:56:10 +00:00
jhb
f0f120d153 MFC: Handle negative trap numbers (due to a corrupted trapframe) by not
triggering a nested page fault when indexing the trap_msg[] array.
2007-08-14 19:42:52 +00:00
jkoshy
ef5ab215c2 MFC rev 1.669: "Use a known good stack at the time of servicing an
NMI--- reuse the space allocated for the double fault handler since
  this space is otherwise unused till the time a double fault occurs."
2007-08-07 09:16:18 +00:00
netchild
70891f8aea regen after syscalls.master change 2007-07-08 12:23:37 +00:00
netchild
ae2249d960 MFC (5 of X):
- linuxulator mmap handling
 - memleak fixes
 - extend linux errno mapping
 - handle address space limits for linux processes
 - sync linprocfs (/proc/sys/... part)

Compile tested by:	scf (i386, as part of a mega-MFC-patch)
Tested by:		Arno J. Klaassen <arno@heho.snv.jussieu.fr> (amd64)
2007-07-08 12:20:36 +00:00
netchild
962e1e6836 MFC (4 of X):
- don't limit number of syscalls to 255
 - handle more socket options
 - bug-/compatibility-fixes to linux
   * file related (includes fixes which prevent creation of strange files
     which can only be removed with a fsck)
   * make ping work
   * ...
 - add devfs to the file system type handling/translation

Compile tested by:	scf (i386, as part of a mega-MFC-patch)
Tested by:		Arno J. Klaassen <arno@heho.snv.jussieu.fr> (amd64)
2007-07-08 09:04:44 +00:00
netchild
b6ba7285b9 MFC (2 of X):
- some linuxulator style(9) fixes
 - add datatypes and definitions in preparation of further commits
 - use one (l_sigval) of the new datatypes on amd64 and get rid of a now unused
   include (this may or may not fix some signal handling issues on amd64) [1]
 - convert some unconditional debug handling into the common linuxulator way
 - use some more appropriate format string types in some debug printf's
 - convert signal validation into a macro

Except for [1] on amd64 there is no visible change to a normal user.

Tested by:	scf (i386), Arno J. Klaassen <arno@heho.snv.jussieu.fr> (amd64)
2007-07-08 08:41:09 +00:00
netchild
34d21d2a2c MFC (1 of X):
- easy linuxulator style(9) fixes (easy = hand removal of non-style code
   change sections in a full diff)

Tested by:	scf (i386), Arno J. Klaassen <arno@heho.snv.jussieu.fr> (amd64)
2007-07-08 08:26:10 +00:00
jhb
40ca6c4170 MFC: Use the tsc to implement DELAY() if it is usable and calibrated.
Reviewed by:	peter
2007-06-29 21:05:28 +00:00
jhb
6eac914455 Properly initialize the address value in siginfo for Linux binaries on
amd64.  amd64 has a separate tf_addr in the trapframe unlike i386 which
reuses tf_err to pass the address to signals.
2007-06-29 21:04:22 +00:00
jhb
9d52499b7d MFC: Support for running 32-bit multithreaded binaries using libthr on
amd64 including:
- Add 32-bit wrappers for thr_new(), thr_suspend(), and the umtx system
  calls.
- Add support to amd64 for constructing thread upcalls for 32-bit
  processes.
- Leave %fs and %gs alone in the signal trampoline for 32-bit processes on
  amd64.
- Add 'casuword32()' to amd64 and ia64.

Tested by:	emaste
2007-06-18 22:44:59 +00:00
jhb
3464b119cd MFC: Rework the support used by ABIs to override resource limits so that
a 64-bit process exec'd by a 32-bit process doesn't end up with 32-bit
limits.

This doesn't break the ABI as neither of the 32-bit ABIs (COMPAT_LINUX32
and COMPAT_IA32) are buildable as modules on 6.x/amd64 and none of the
other ABIs use this hook.
2007-05-23 18:24:43 +00:00
alc
0aabd82211 MFC a change to pmap_copy() that was overlooked because revision 1.583
was MFCed before revision 1.540.
2007-05-06 18:36:57 +00:00
alc
2281ae7e91 MFC Revision 1.531 of pmap.c:
Avoid unnecessary differences between the amd64 and i386
  format strings.

MFC Revision 1.577 of pmap.c:
  Use a different bitmask for superpages' base address so that it
  doesn't conflict with the PG_PDE_PAT bit.
2007-05-06 05:23:19 +00:00
alc
ccd01b0033 MFC Revision 1.538:
Remove stale KSE code.

MFC Revision 1.551:
  In general, bits in the page directory entry (PDE) and the page table
  entry (PTE) have the same meaning.  The exception to this rule is the
  eighth bit (0x080).  It is the PS bit in a PDE and the PAT bit in a
  PTE.  This change avoids the possibility that pmap_enter() confuses a
  PAT bit with a PS bit, avoiding a panic().

  Eliminate a diagnostic printf() from the i386 pmap_enter() that serves
  no current purpose.

MFC Revision 1.559:
  Eliminate a comment that became stale after revision 1.540.

MFC Revision 1.575:
  Finish the PG_NX support at the pmap level.

MFC Revision 1.582:
  Eliminate the misuse of PG_FRAME to truncate a virtual address
  to a virtual page boundary.
2007-05-06 00:34:43 +00:00
alc
8bceade346 MFC
Acquiring smp_ipi_mtx on every call to pmap_invalidate_*() is wasteful.
  For example, during a buildworld more than half of the calls do not
  generate an IPI because the only TLB entry invalidated is on the calling
  processor.  This revision pushes down the acquisition and release of
  smp_ipi_mtx into smp_tlb_shootdown() and smp_targeted_tlb_shootdown() and
  instead uses sched_pin() and sched_unpin() in pmap_invalidate_*() so that
  thread migration doesn't lead to a missed TLB invalidation.
2007-05-05 21:13:16 +00:00
alc
85dce1c411 MFC Revision 1.530
Replace diagnostic printf()s by assertions.  Use consistent style
  for similar assertions.

MFC Revision 1.540
  Introduce pmap_try_insert_pv_entry().

  Use pmap_try_insert_pv_entry() in pmap_copy() instead of
  pmap_insert_entry().

  Eliminate the explicit low-memory checks in pmap_copy().

MFC Revision 1.544
  Retire pmap_track_modified().

MFC Revision 1.555
  Introduce the function pmap_enter_object().

MFC Revision 1.558 (in part)
  Change pmap_enter_quick_locked() to fail rather than wait if it is
  unable to allocate a page table page.  Similarly, change
  pmap_enter_quick_locked() to call pmap_try_insert_pv_entry() rather
  than pmap_insert_entry().

  Add an assertion that the object containing m_start is locked in
  pmap_enter_object().  Remove a similar assertion from
  pmap_enter_quick_locked() because that function no longer accesses
  the containing object.

  Remove a stale comment.
2007-05-05 18:58:22 +00:00
sobomax
9c8e38c33f MFC: Implement 32 bit getcontext/setcontext/swapcontext on amd64. Still
stubs for ia64 to keep it compiling.  These are used by 32 bit apps such
as gdb.
2007-05-03 11:13:58 +00:00
jhb
3b4d101cd7 MFC: Honor the BUS_DMA_NOCACHE flag to bus_dmamem_alloc() on amd64 and
i386 by mapping the pages as UC (uncacheable) using pmap_change_attr().

Requested by:	ariff
2007-05-02 18:48:18 +00:00
jhb
83beae72fc MFC: Initial PAT support including the following:
- New pmap_mapdev_attr() function for amd64 and i386.
- pmap_mapdev() on i386 and amd64 uses UC now rather than WB.
- New pmap_mapbios()/pmap_unmapbios() functions to map firmware tables.
- New pmap_change_attr() function for amd64 and i386.
- Bump __FreeBSD_version.
2007-05-02 18:42:47 +00:00
jhb
6950f85892 MFC: Add various constants for the PAT MSR and the PAT PTE and PDE flags
and initialize the PAT MSR during boot.
2007-05-02 16:16:57 +00:00
jhb
c39819f05f MFC: Add 'pmap_invalidate_cache()'. 2007-05-02 15:40:15 +00:00
jhb
94057636e9 MFC: Comment fixes in 1.106 and 1.107. 2007-05-02 15:22:20 +00:00
jhb
71a6651ba1 MFC: Various fixes to cpu_reset_real()
- Try to use the reset control register (I/O port 0xcf9) and the fast a20
  and init register (I/O port 0x92) if the keyboard reset fails.
- Fix the triple fault to actually work when PGE is enabled.
2007-04-30 17:45:44 +00:00
ariff
bfa3a1f568 MFC:
Disable C1 Enhanced mode on AMD K8 Family Revision F and above to keep
local APIC timer alive.

Reviewed by:	jhb
PR:		i386/104678
2007-04-28 09:04:10 +00:00
ups
df02abe19c MFC:
Invalidate all TLBs and page structure caches that may reference a page
for page walk acceleration before releasing it to the free list.

This is required for CPUs implementing page structure caches as described
in the Intel application note:
        "TLBs, Paging-Structure Caches, and Their Invalidation"
         (Document Number: 317080-001)
2007-04-25 18:21:24 +00:00
jhb
80b8da4bdb MFC: PCI MSI support for amd64 and i386. 2007-03-31 15:23:21 +00:00
yongari
83883fc711 MFC msk(4) to RELENG_6
Add msk(4) to the list of drivers supported by GENERIC kernel.
2007-03-27 02:33:00 +00:00
jhb
0fd3b96cdc MFC: Add a simple device driver to "eat" any I/O APICs that show up as PCI
devices.
2007-03-12 19:50:29 +00:00
cperciva
a0ed3a9320 MFi386: Ident the SMP kernel as SMP-GENERIC (not GENERIC). 2007-03-03 23:20:42 +00:00
kib
31bbfa289d MFC rev. 1.579: MFi386 rev. 1.544 of i386/i386/pmap.c:
Rounding addr upwards to next 2M boundary in pmap_growkernel() could
cause addr to become 0, resulting in an early return without populating
the last PDE.
2007-02-28 09:27:45 +00:00
cvs2svn
883ba8d29f This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2007-02-15 22:22:58 +00:00
jhb
2e5043cc5f MFC: Don't send interrupts to CPUs disabled via lapic hints. 2007-02-12 21:20:43 +00:00
jhb
856fba47dd MFC: Fix GDB_BUFSZ. 2007-02-08 17:45:50 +00:00