Commit Graph

75051 Commits

Author SHA1 Message Date
Alexander Motin
3015ec2db6 MFC r205074:
Mask disk_idx to avoid panic because of extra bits set.

PR:             kern/102211
Submitted by:   yoichi
2010-03-31 07:49:59 +00:00
Marcel Moolenaar
419ee98298 MFC rev 199727, 200888, 201031, 202904, 203054, 203106, 203572, 203884,
204183, 204184, 204185, 204425, 204904, 204905, 205172, 205234, 205357,
205428, 205429, 205431, 205432, 205433, 205434, 205435, 205454, 205665,
205713, 205723, 205726 and 205727:

Bring ia64 machine-dependent changes from 9-current to 8-stable.
2010-03-31 05:05:28 +00:00
Marcel Moolenaar
3559a7713a MFC revs 199502, 199566 and 199574:
Add a seatbelt to the Nested TLB Fault handler to give us a chance
to panic when we have an unexpected TLB fault while interrupt
collection is disabled.
2010-03-31 03:20:14 +00:00
Marcel Moolenaar
e9fa42544e MFC rev 198431:
Have the early USB takeover only enabled for i386 and amd64
by default. This also avoids a panic on PowerPC.
2010-03-31 03:14:40 +00:00
Marcel Moolenaar
dfeca18773 MFC rev 198341 and 198342:
o   Introduce vm_sync_icache() for making the I-cache coherent with
    the memory or D-cache, depending on the semantics of the platform.
    vm_sync_icache() is basically a wrapper around pmap_sync_icache(),
    that translates the vm_map_t argumument to pmap_t.
o   Introduce pmap_sync_icache() to all PMAP implementation. For powerpc
    it replaces the pmap_page_executable() function, added to solve
    the I-cache problem in uiomove_fromphys().
o   In proc_rwmem() call vm_sync_icache() when writing to a page that
    has execute permissions. This assures that when breakpoints are
    written, the I-cache will be coherent and the process will actually
    hit the breakpoint.
o   This also fixes the Book-E PMAP implementation that was missing
    necessary locking while trying to deal with the I-cache coherency
    in pmap_enter() (read: mmu_booke_enter_locked).
2010-03-31 02:43:58 +00:00
Luigi Rizzo
353be77138 A last-minute change in the previous commit broke rule deletion,
so i am fixing it, this time with a more detailed description
of what the code is supposed to do.
2010-03-31 01:51:08 +00:00
Xin LI
73a0004b9d MFC r204533:
Add PCI ID for MCS9901.

Submitted by:	gcooper
PR:		kern/144397
2010-03-31 00:41:32 +00:00
Marius Strobl
8fcbb37733 MFC: r203846
Predict KASSERTs to be true.
2010-03-30 20:46:10 +00:00
Marius Strobl
411fea736d MFC: r203845
- Add the 'cmp' and 'core' pseudo-busses which are used to group CPU cores
  to the exclusion lists as the CPU nodes aren't handled as regular devices
  either. Also add the pseudo-devices found in Sun Fire V1280.
- Allow nexus_attach() and nexus_alloc_resource() to be used by drivers
  derived from nexus(4) for subordinate busses.
- Don't add the zero-sized memory resources of glue devices to the resource
  lists.
2010-03-30 20:44:04 +00:00
Marius Strobl
306d372fa5 MFC: r203843
Resurrect nexusvar.h from r167307.
2010-03-30 20:39:47 +00:00
Marius Strobl
ceaf6ad0fa MFC: r203839
Style fixes
2010-03-30 20:38:18 +00:00
Marius Strobl
9604687663 MFC: r203838
- Search the whole OFW device tree instead of only the children of the
  root nexus device for the CPUs as starting with UltraSPARC IV the 'cpu'
  nodes hang off of from 'cmp' (chip multi-threading processor) or 'core'
  or combinations thereof. Also in large UltraSPARC III based machines
  the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which
  group snooping-coherency domains together instead of directly from the
  nexus.
  It would be great if we could use newbus to deal with the different ways
  the 'cpu' devices can hang off of pseudo ones but unfortunately both
  cpu_mp_setmaxid() and sparc64_init() have to work prior to regular device
  probing.
- Add support for UltraSPARC IV and IV+ CPUs. Due to the fact that these
  are multi-core each CPU has two Fireplane config registers and thus the
  module/target ID has to be determined differently so the one specific
  to a certain core is used. Similarly, starting with UltraSPARC IV the
  individual cores use a different property in the OFW device tree to
  indicate the CPU/core ID as it no longer is in coincidence with the
  shared slot/socket ID.
  This involves changing the MD KTR code to not directly read the UPA
  module ID either. We use the MID stored in the per-CPU data instead of
  calling cpu_get_mid() as a replacement in order prevent clobbering any
  registers as side-effect in the assembler version. This requires CATR()
  invocations from mp_startup() prior to mapping the per-CPU pages to be
  removed though.
  While at it additionally distinguish between CPUs with Fireplane and
  JBus interconnects as these also use slightly different sizes for the
  JBus/agent/module/target IDs.
- Make sparc64_shutdown_final() static as it's not used outside of
  machdep.c.
2010-03-30 20:29:45 +00:00
Marius Strobl
c4adffba57 MFC: r203833
- At least the trap table of the Sun Fire V1280 firmware apparently has
  no cleanwindows handler so just remove trying to trigger it from _start
  and the AP trampoline code as that leads to a crash there. This should
  be okay as leaking data from the OFW via the CPU registers on start of
  the kernel should be no real concern.
- Make the comments of _start and the AP trampoline code regarding the
  initializations they perform match each other and reality.
- Make the comments of the AP trampoline code regarding iTLB accesses
  refer to the right macro.
2010-03-30 20:12:42 +00:00
Marius Strobl
935f345ea4 MFC: r203830, r203831
Use the SUNW,{d,i}tlb-load methods for entering locked TLB entries like
OpenBSD and OpenSolaris do instead of fiddling with the MMUs ourselves.
Unlike direct access the firmware methods don't automatically use the
next free (?) TLB slot, instead the slot to be used has to be specified.
We allocate the TLB slots for the kernel top-down as OpenSolaris suggests
that the firmware will always allocate the ones for its own use bottom-up.
Besides being simpler, according to OpenBSD using the firmware methods is
required to allow booting on Sun Fire E10K with multi-systemboard domains.
2010-03-30 20:05:20 +00:00
Marius Strobl
0a1e6ecc1f MFC: r203829
- Assert that HEAPSZ is a multiple of PAGE_SIZE as at least the firmware
  of Sun Fire V1280 doesn't round up the size itself but instead lets
  claiming of non page-sized amounts of memory fail.
- Change parameters and variables related to the TLB slots to unsigned
  which is more appropriate.
- Search the whole OFW device tree instead of only the children of the
  root nexus device for the BSP as starting with UltraSPARC IV the 'cpu'
  nodes hang off of from 'cmp' (chip multi-threading processor) or 'core'
  or combinations thereof. Also in large UltraSPARC III based machines
  the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which
  group snooping-coherency domains together instead of directly from the
  nexus.
- Add support for UltraSPARC IV and IV+ BSPs. Due to the fact that these
  are multi-core each CPU has two Fireplane config registers and thus the
  module/target ID has to be determined differently so the one specific
  to a certain core is used. Similarly, starting with UltraSPARC IV the
  individual cores use a different property in the OFW device tree to
  indicate the CPU/core ID as it no longer is in coincidence with the
  shared slot/socket ID.
  While at it additionally distinguish between CPUs with Fireplane and
  JBus interconnects as these also use slightly different sizes for the
  JBus/agent/module/target IDs.
- Check the return value of init_heap(). This requires moving it after
  cons_probe() so we can panic when appropriate. This should be fine as
  the PowerPC OFW loader uses that order for quite some time now.
2010-03-30 20:02:26 +00:00
Marius Strobl
4139c876fa MFC: r203731
Some style(9) fixes
2010-03-30 19:52:45 +00:00
Marius Strobl
e73d23dad8 MFC: r203341
- Remove the BUS_HANDLE_MIN checking in the __BUS_DEBUG_ACCESS macro;
  for UPA it should have fulfilled its purpose by now and Fireplane-
  and JBus-based machines are way to messy in organization to implement
  something equivalent.
- Fix a bunch of style(9) bugs.
2010-03-30 19:37:47 +00:00
Marius Strobl
592227a6e8 MFC: r203335
- Const'ify the bus_stream_asi and bus_type_asi arrays.
- Replace hard-coded functions names missed in bus_machdep.c with __func__.
- Break some long lines.
2010-03-30 19:36:00 +00:00
Marius Strobl
e18f909f8d MFC: r203334
Sync with the other archs and declare the memory location referenced by
the address argument of the bus_space_write_multi_*() familiy as const.
2010-03-30 19:33:09 +00:00
Attilio Rao
6f1f54906a MFC r205167:
Make the code more readable and compiling on 64-bits arch different
than amd64.

Sponsored by:	Sandvine Incorporated
2010-03-30 12:06:18 +00:00
Attilio Rao
58c7715bb0 MFC r205160:
Checkin a facility for specifying a passthrough FIB from userland.
arcconf tool by Adaptec already seems to use for identifying the
Serial Number of the devices.

Sponsored by:	Sandvine Incorporated
2010-03-30 11:46:43 +00:00
Attilio Rao
acde5c5d1d MFC r204641, r204753:
Improving the clocks auto-tunning by firstly checking if the atrtc may be
correctly initialized and just then assign to softclock/profclock.

Sponsored by:   Sandvine Incorporated
2010-03-30 11:19:29 +00:00
Jung-uk Kim
ac39796e38 MFC: r205647
Fix stupid typos.  Some VESA BIOSes directly call BIOS interrupt handlers
within the VBE interrupt handler.  Unfortunately it was causing real mode
page faults because we were fetching instructions from bogus addresses.

PR:		kern/144654
2010-03-29 15:59:37 +00:00
Attilio Rao
7dd1fd87e8 MFC r199852, r202387, r202441, r202534:
Handling all the three clocks with the LAPIC may lead to aliasing for
softclock and profclock.
Revert the change when the LAPIC started taking charge of all three of
them.

Sponsored by:	Sandvine Incorporated
2010-03-29 15:39:17 +00:00
Luigi Rizzo
d15984d46e mfc 205830:
fixes to rule set handling (including potential kernel panics)
2010-03-29 12:32:16 +00:00
Luigi Rizzo
0d3003c0c8 remove a leftover debugging message 2010-03-29 12:29:34 +00:00
Fabien Thomas
44a4e1d8fb MFC r205694:
Handling SIGPIPE will cause deadlock/crash.
Return an error immediatly in case of hard shutdown.
2010-03-29 06:55:38 +00:00
Ed Maste
171dfe111d MFC aac(4) driver changes
r204019:

  Include command type in COMMAND TIMEOUT messages to aid in debugging.

r203885:

  Diff reduction with Adaptec's vendor driver.

  Driver version 2.1.9 chosen as that Adaptec version roughly corresponds
  with the current feature set merged to the in-tree driver.

r203801:

  Garbage collect Falcon/PPC support that has not been used in released
  products, based on discussion with Adaptec.

r198617:

  Rename aac_srb32 to aac_srb, to match Adaptec's vendor driver.
2010-03-29 00:30:44 +00:00
Ed Maste
436405f522 MFC r204264:
Minor diff reduction with Adaptec's driver: in aac_release_command() set
  cm_queue to AAC_ADAP_NORM_CMD_QUEUE by default.  In every place it was
  set, it was set to AAC_ADAP_NORM_CMD_QUEUE anyhow.
2010-03-29 00:14:34 +00:00
Ed Maste
83867e0aa4 MFC r205411:
Avoid holding the VLAN_LOCK() over the parent interface SIOCGIFMEDIA
  ioctl call, as it may sleep.

  Reviewed by:    rwatson
2010-03-29 00:08:58 +00:00
Edward Tomasz Napierala
fddc12138a MFC r200723:
Interpret VAPPEND correctly in vaccess_acl_nfs4(9).
2010-03-27 18:12:00 +00:00
Edward Tomasz Napierala
bf876fcd34 MFC r200273:
Don't add VAPPEND if the file is not being opened for writing.  Note that this
only affects cases where open(2) is being used improperly - i.e. when the user
specifies O_APPEND without O_WRONLY or O_RDWR.

Reviewed by:	rwatson
2010-03-27 18:09:40 +00:00
Edward Tomasz Napierala
89a2dbabba MFC r200058:
Add change that was somehow missed in r192586.  It could manifest by
incorrectly returning EINVAL from acl_valid(3) for applications linked
against pre-8.0 libc.
2010-03-27 18:08:14 +00:00
Edward Tomasz Napierala
3fbc03cc99 MFC r199875:
Provide a set of sysctls and tunables to disable device node creation
for specific "kinds" of disk labels - for example, GPT UUIDs.  Reason
for this is that sometimes, other GEOM classes attach to these device
nodes instead of the proper ones - e.g. they attach to /dev/gptid/XXX
instead of /dev/ada0p2, which is annoying.

Reviewed by:	pjd (earlier version)
2010-03-27 18:04:33 +00:00
Edward Tomasz Napierala
168d1f006b MFC r197945:
Orphaning provider with EXDEV seems weird; perhaps the author meant
ENXIO here?
2010-03-27 17:56:45 +00:00
Bjoern A. Zeeb
2287aa049c MFC r205626:
Print the pointer to the lock with the panic message. The previous
        panic: rw lock not unlocked
  was not really helpful for debugging. Now one can at least call
        show lock <ptr>
  form ddb to learn more about the lock.
2010-03-27 17:54:44 +00:00
Bjoern A. Zeeb
0b93ad54a2 MFC r205276:
Add ddb support to the "new" link layer code ("new-arp"):
   - show all lltables [1] (optional flag to also show the llentries as well)
   - show lltable <struct lltable *>
   - show llentry <struct llentry *>
2010-03-27 17:52:56 +00:00
Bjoern A. Zeeb
397069f2c5 MFC r205251:
Add pcb reference counting to the pcblist sysctl handler functions
  to ensure type stability while caching the pcb pointers for the
  copyout.

  Reviewed by:  rwatson
2010-03-27 17:51:27 +00:00
Bjoern A. Zeeb
62f500d0c2 MFC r204838:
Destroy TCP UMA zones (empty or not) upon network stack teardown
  to not leak them, otherwise making UMA/vmstat unhappy with every
  stoped vnet.
  We will still leak pages (especially for zones marked NOFREE).

  Reshuffle cleanup order in tcp_destroy() to get rid of what we can
  easily free first.

  Reviewed by:  rwatson
2010-03-27 17:50:02 +00:00
Bjoern A. Zeeb
a4f6889460 MFC r204805:
Rework reference counting in case we queue into the netisr,
  or overflow the netisr queue and fall back to the interface
  queue so that we can garuantee that the ifnet pointer stays
  valid.   Formerly we ended up with reference counts <= 0 in
  case the netisr had returned ENOBUFS.  The idea is to track
  any packet in the netisr queue and only change the refount
  on edge operations for the fallback interface queue. This
  also avoids problems in case the if_snd.ifq_len lies to us.

  Also rework refount assertions to make sure they trigger if
  we go below 1. Formerly a negative refence count did not
  trigger the assert as the refcount variable is u_int.
2010-03-27 17:48:13 +00:00
Bjoern A. Zeeb
3662f299d2 MFC r204807:
Destroy UDP UMA zones (empty or not) upon network stack teardown
  to not leak them making UMA/vmstat -z unhappy with every stoped vnet.
  We will still leak pages (especially as zones are marked NOFREE).
2010-03-27 17:46:06 +00:00
Bjoern A. Zeeb
67208dfa16 MFC r204147:
Set curvnet earlier so that it also covers calls to sodisconnect(), which
  before were possibly panicing the system in ULP code in the VIMAGE case.

  Submitted by: Igor (igor ispsystem.com)
2010-03-27 17:42:04 +00:00
Bjoern A. Zeeb
1386abc0a7 MFC r204279:
Use the DB_SHOW_ALL_COMMAND() macro to register the formerly 'show ifnets'
  in the db_show_all_table as 'show all ifnets' and with that follow the
  convention for showing complete lists.

  Submitted by: thompsa
2010-03-27 17:40:28 +00:00
Bjoern A. Zeeb
0519db7239 MFC r204145:
Start to implement ifnet DDB support:
  - 'show ifnets' prints a list of ifnet *s per virtual network stack,
  - 'show ifnet <struct ifnet *>' prints fields matching the given ifp.

  We do not yet print the complete set of fields and might want to
  factor this out to an extra if_debug.c file in case this grows
  a lot[1]. We may also want to grow 'show ifnet <if_xname>' support[1].

  Suggested by: rwatson [1]
  Reviewed by:  rwatson
2010-03-27 17:39:02 +00:00
Bjoern A. Zeeb
1198bd71ba MFC r204143:
Upon virtual network stack teardown properly release the TCP syncache
  resources.

  Reviewed by:  rwatson
2010-03-27 17:36:52 +00:00
Bjoern A. Zeeb
e47658ce90 MFC r204140:
Split up ip_drain() into an outer lock and iterator part and
  a "locked" version that will only handle a single network stack
  instance. The latter is called directly from ip_destroy().

  Hook up an ip_destroy() function to release resources from the
  legacy IP network layer upon virtual network stack teardown.

  Reviewed by:  rwatson
2010-03-27 17:34:57 +00:00
Bjoern A. Zeeb
9bdad32791 MFC r204142:
Enhance a panic string to contain more useful debugging information.
2010-03-27 17:33:19 +00:00
Bjoern A. Zeeb
78ba8b295c MFC r203729:
Add DDB support for printing vnet_sysinit and vnet_sysuninit
  ordered call lists. Try to lookup function/symbol names and print
  those in addition to the pointers, along with the constants for
  subsystem and order.
  This is useful for debugging vnet teardown ordering issues.

  Make it possible to call the actual printing frunction from normal
  code at runtime, ie. from vnet_sysuninit(), if DDB support is there.
2010-03-27 17:31:54 +00:00
Bjoern A. Zeeb
72ec67fcb7 MFC r203727:
Add an SDT provider for "vnet"s along with probes for vnet_alloc
  and vnet_destroy.
  Use the line number rather than NULL as dummy argument.

  Note: the fbt provider does not reliably provide :return probes
  (depending on optimization levels used at compile time) making
  it unusable for scripts to generate complete call-traces with
  well defined boundaries over allocations or destructions of
  virtual network stacks.
2010-03-27 17:29:50 +00:00
Bjoern A. Zeeb
ef18ad7e2d MFC r203724:
Properly free resources when destroying the TCP hostcache while
  tearing down a network stack (in the VIMAGE jail+vnet case).

  For that break out the logic from tcp_hc_purge() into an internal
  function we can call from both, the sysctl handler and the
  tcp_hc_destroy().

  Reviewed by:  silby, lstewart
2010-03-27 17:26:31 +00:00