MFC: r223954
Try and fix the exports.5 man page so that it clarifies how
NFSv4 exports are handled. Improved by comments from
mckusick, kudak at mit.edu and bde.
This is a content change.
- Sync with the latest version from NetBSD. It notably addds ISO9660 support.
- Add support for synthesizing an APM partition map to map Mac PowerPC
bootstrap partitions from the ISO9660 boot catalog. This preserves OS X's
ability to mount the CD, while allowing us a way to provide HFS-ified
bootstrap code for Open Firmware.
- Add analogs to the -chrp-boot and -prep-boot options to mkisofs.
marius [Tue, 26 Jul 2011 13:29:11 +0000 (13:29 +0000)]
MFC: r220389, r220392
- Mark getc() as inline, this has no effect on gcc but helps clang.
- Move getc() body before xgetc() so gcc does not emit a warning about function
having no body.
marius [Tue, 26 Jul 2011 13:23:25 +0000 (13:23 +0000)]
MFC: r218926
In sys/boot/i386/boot2/boot2.c, change the type of the 'opts' variable
from uint16_t back to uint32_t. The actual option bitmasks (RB_* and
RBX_*) assume at least a 32 bit variable.
marius [Tue, 26 Jul 2011 13:22:12 +0000 (13:22 +0000)]
MFC: r218745
Remove reading of symbols from a.out loaded files. Since we are tight
on space for clang and a.out support is only needed for /boot/loader,
they are excess bytes that serve no useful purpose other than to
support really old kernels (FreeBSD < 3.2 or so). Prefer clang
support over support for these old kernels and remove this code. We
gain about 100 bytes of space this way.
marius [Tue, 26 Jul 2011 13:13:31 +0000 (13:13 +0000)]
MFC: r220685
MFi386: revisions 220389 and 220392
- Mark getc() as inline, this has no effect on gcc but helps clang.
- Move getc() body before xgetc() so gcc does not emit a warning about
function having no body.
marius [Tue, 26 Jul 2011 13:06:21 +0000 (13:06 +0000)]
MFC: r219225
MFi386: revision 219186
This patch shrinks boot2 a little.
o It switches kname to be just a pointer instead of an array.
o It changes ioctl to unsigned from uint8_t.
o It changes the second keyhit limit to 3 seconds from 5.
o It removes bi_basemem/bi_extmem/bi_memsizes_valid setting.
marius [Tue, 26 Jul 2011 12:57:23 +0000 (12:57 +0000)]
MFC: r212064, r212098
Use a cleaner expression to retrieve the memory size in pc98's boot2.c,
which also avoids NULL pointer arithmetic, as suggested by jhb. The
available space goes from 11 bytes to 7.
marius [Mon, 25 Jul 2011 23:01:08 +0000 (23:01 +0000)]
MFC: r223938
Since r219452 the alignment of __dmadat has changed, revealing that fsread()
bogusly casts its contents around causing alignment faults on sparc64 and
most likely also on at least powerpc. Fix this by copying the contents
bytewise instead as partly already done here. Solving this the right way
costs some space, i.e. 148 bytes with GCC and 16 bytes with clang on x86
there are still some bytes left there though, and an acceptable hack which
tricks the compiler into only using a 2-byte alignment instead of the native
one when accessing the contents turned out to even take up more space that.
MFC r222932: skel/.shrc: Improve commented CDPATH example for POSIX
requirements.
POSIX says an empty entry in CDPATH shall not result in the new directory
being printed, while any non-empty entry shall result in the new directory
being printed, including ".". Therefore, the value of CDPATH should almost
always start with a colon, not dot and colon.
Our sh does not print the name for empty entries as well as "." entries.
marius [Mon, 25 Jul 2011 21:44:35 +0000 (21:44 +0000)]
MFC: r218713, r218716
Apply a few small optimizations to boot2's code, to make it shrink a
little further. This gets us further on the way to be able to build it
successfully with clang. Using in-tree gcc, this shrinks boot2.bin with
60 bytes, the in-tree clang shaves off 72 bytes, and ToT clang 84 bytes.
MFC r224157:
Revert r222135 by allowing controller reinitialization. Due to
unknown reason Apple UniNorth2 gem(4) device required manual
interface down/up operation after r222135. Even though this is not
correct thing and I don't like to revert it but it would be better
than breaking gem(4) on PPC. This should be revisited.
MFC r224023,224060:
Document AX88772B and AX88760. AX88760 is treated as AX88772A in
driver.
Mention all ASIX USB controllers that are supported by axe(4).
Reword media types and explicly mention AX88178 is the only
controller that supports gigabit link.
While I'm here use shorten model instead of showing all controller
model numbers.
MFC r224020:
Add initial support for AX88772B USB Fast Ethernet. AX88772B
supports IPv4/IPv6 checksum offloading and VLAN tag insertion/
stripping as well as WOL. Because uether does not provide a way
to announce driver specific offload capabilities to upper stack,
checksum offloading support needs more work and will be done in
future.
Special thanks to ASIX for donating sample hardware.
marius [Mon, 25 Jul 2011 19:13:51 +0000 (19:13 +0000)]
MFC: r223986
- Expand the scope of the lock in the interrupt routine to close races with
checking IFF_DRV_RUNNING and simplify the code. This also involves holding
the driver lock in the rx_ch callout.
- Just use ifp instead of sc->sc_ifp.
marius [Mon, 25 Jul 2011 19:11:29 +0000 (19:11 +0000)]
MFC: r223984
PCIB_ALLOC_MSIX() may already fail on the first pass, f.e. when the PCI-PCI
bridge is blacklisted. In that case just return from pci_alloc_msix_method(),
otherwise we continue without a single MSI-X resource, causing subsequent
attempts to use the seemingly available resource to fail or when booting
verbose to NULL-dereference rle->start when trying to print the IRQ in
pci_alloc_msix_method().
marius [Mon, 25 Jul 2011 19:03:45 +0000 (19:03 +0000)]
MFC: r223961
- Remove redundant timecounter masking from counter_get_timecount().
- Zero the timecounter when allocation so we don't need to initialize unused
members and remove a now redundant NULL assignment.
marius [Mon, 25 Jul 2011 19:01:36 +0000 (19:01 +0000)]
MFC: r223960
- Current testing shows that (ab)using the JBC performance counter in bus
cycle mode as timecounter just works fine. My best guess is that a firmware
update has fixed this, so check at run-time whether it advances and use a
positive quality if it does. The latter will cause this timecounter to be
used instead of the tick counter based one, which just sucks for SMP.
- Remove a redundant NULL assignment from the timecounter initialization.
marius [Mon, 25 Jul 2011 18:59:45 +0000 (18:59 +0000)]
MFC: r223959
- Add a missing shift in schizo_get_timecount(). This happened to be non-fatal
as STX_CTRL_PERF_CNT_CNT0_SHIFT actually is zero, if we were using the
second counter in the upper 32 bits this would be required though as the MI
timecounter code doesn't support 64-bit counters/counter registers.
- Remove a redundant NULL assignment from the timecounter initialization.
marius [Mon, 25 Jul 2011 18:46:54 +0000 (18:46 +0000)]
MFC: r223795
Call pmap_qremove() before freeing or unwiring the pages, otherwise
there's a window during which a page can be re-used before its previous
mapping is removed.
marius [Mon, 25 Jul 2011 18:44:46 +0000 (18:44 +0000)]
MFC: r223721
UltraSPARC-IV CPUs seem to be affected by a not publicly documented
erratum causing them to trigger stray vector interrupts accompanied by a
state in which they even fault on locked TLB entries. Just retrying the
instruction in that case gets the CPU back on track though. OpenSolaris
also just ignores a certain number of stray vector interrupts.
While at it, implement the stray vector interrupt handling for SPARC64-VI
which use these for indicating uncorrectable errors in interrupt packets.
marius [Mon, 25 Jul 2011 18:41:52 +0000 (18:41 +0000)]
MFC: r223719
- For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from
the TLBs in order to get rid of the user mappings but instead traverse
them an flush only the latter like we also do for the Spitfire-class.
Also flushing the unlocked kernel entries can cause instant faults which
when called from within cpu_switch() are handled with the scheduler lock
held which in turn can cause timeouts on the acquisition of the lock by
other CPUs. This was easily seen with a 16-core V890 but occasionally
also happened with 2-way machines.
While at it, move the SPARC64-V support code entirely to zeus.c. This
causes a little bit of duplication but is less confusing than partially
using Cheetah-class bits for these.
- For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024-
entry, 2-way set associative TLB.
- In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure
that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back.
Tested by: Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V)
marius [Mon, 25 Jul 2011 18:32:56 +0000 (18:32 +0000)]
MFC: r223648, r223949
- In gem_reset_rx() also reset the RX MAC which is necessary in order to
get it out of a stuck condition that can be caused by GEM_MAC_RX_OVERFLOW.
- In gem_reset_rxdma() call gem_setladrf() in order to reprogram the RX
filter and restore the previous content of GEM_MAC_RX_CONFIG. While at it
consistently use the newly introduced sc_mac_rxcfg throughout the driver
instead of reading the its old content.
- Increment if_iqdrops instead of if_ierrors in case of RX buffer allocation
failure.
- According to the GEM datasheet the RX MAC should also be disabled in
gem_setladrf() before changing its configuration.
- Add error messages to gem_disable_{r,t}x() and take advantage of these
throughout the driver instead of duplicating their functionality all over
the place.
marius [Mon, 25 Jul 2011 18:28:12 +0000 (18:28 +0000)]
MFC: r223378
On machines where we don't need to lock the kernel TSB into the dTLB and
thus may basically use the entire 64-bit kernel address space reduce
VM_KMEM_SIZE_SCALE to 1 allowing kernel to use more memory.
marius [Mon, 25 Jul 2011 18:26:54 +0000 (18:26 +0000)]
MFC: r223377
On machines where we don't need to lock the kernel TSB into the dTLB and
thus may basically use the entire 64-bit kernel address space increase
the kernel virtual memory to not be limited by VM_KMEM_SIZE_MAX.
marius [Mon, 25 Jul 2011 18:23:24 +0000 (18:23 +0000)]
MFC: r223235
- As with stray vector interrupts limit the reporting of stray level
interrupts. Bringup on additional machine models repeatedly reveals
firmware that enables interrupts behind our back, causing the console
to be flooded otherwise.
- As with the regular interrupt counters using uint16_t instead of
u_long for counting the stray vector interrupts should be more than
sufficient.
- Cache the interrupt vector in intr_stray_vector().
marius [Mon, 25 Jul 2011 18:17:11 +0000 (18:17 +0000)]
MFC: r223126 (partial)
Don't include curcpu in the mask which is used as the IPI cookie as we
have to ignore it when sending the IPI anyway. Actually I can't think of
a good reason why this ever was done that way in the first place as it's
not even usefull for debugging.
marius [Mon, 25 Jul 2011 17:56:06 +0000 (17:56 +0000)]
MFC: r222840
- For the case when tl1_align(_trap) is used to call rsf_fatal via
RSF_FATAL we need to switch to alternate globals for KSTACK_CHECK just
like tl1_data_excptn(_trap) does. This is more or less cosmetic because
in case RSF_FATAL is called we're already heading south.
- Correct an END().
- Read the window state from the correct register for a CATR().
marius [Mon, 25 Jul 2011 17:54:04 +0000 (17:54 +0000)]
MFC: r222828 (partial)
- Test KTR_CPUMASK against pc_cpuid rather than pc_mid to match what the C
version does.
- Initialize global registers early in the MP startup code so PCPU can be
used.
marius [Mon, 25 Jul 2011 17:20:36 +0000 (17:20 +0000)]
MFC: r221955
- Add 10baseT as an alias for 10baseT/UTP.
- Add shorthand aliases for common media+option combinations as announced
by miibus(4) so that one can actually supply the media strings found in
the dmesg output to ifconfig(8).
marius [Mon, 25 Jul 2011 17:18:46 +0000 (17:18 +0000)]
MFC: r221954
When setting media always and not just in case of switching to IFM_AUTO
clear the options of the current media, i.e. only inherit the instance,
which matches what NetBSD does. Without this it's really non-intuitive
that the following sequence:
ifconfig bge0 media 1000baseT mediaopt full-duplex
ifconfig bge0 media 100baseTX
results in 100baseTX full-duplex to be set or that:
ifconfig bge0 media autoselect mediaopt flowcontrol
ifconfig bge0 media 1000baseT mediaopt full-duplex
tries to set 1000baseT full-duplex with flowcontrol, which isn't suported
und thus fails while the following:
ifconfig re0 media 1000baseT mediaopt flowcontrol,full-duplex
ifconfig re0 media autoselect
just switches to autoselection without flowcontrol.
marius [Mon, 25 Jul 2011 14:39:22 +0000 (14:39 +0000)]
MFC: r220931
- Use the streaming cache unless BUS_DMA_COHERENT is specified. Since
r220375 (MFC'ed to stable/8 in r221191) all drivers enabled in the
sparc64 GENERIC should be either correctly using bus_dmamap_sync(9)
calls or supply BUS_DMA_COHERENT when appropriate or as a workaround
for missing bus_dmamap_sync(9) calls (sound(4) drivers and partially
sym(4)). In at least some configurations taking advantage of the
streaming cache results in a modest performance improvement.
- Remove the memory barrier for BUS_DMASYNC_PREREAD which as the
comment already suggested is bogus.
- Add my copyright for having implemented several things like support
for the Fire and Oberon IOMMUs, taking over PROM IOMMU mappings etc.
marius [Mon, 25 Jul 2011 14:30:44 +0000 (14:30 +0000)]
MFC: r216016
Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with
DEBUG_MEMGUARD panics early in kmeminit() with the message
"kmem_suballoc: bad status return of 1" because of zero "size" argument
passed to kmem_suballoc() due to "vm_kmem_size_max" being zero.
MFC: Strip any leading slashes before feeding the label to the geom_label
code. Some linux distros put mount point into the ext2fs labels, such as
'/', or '/boot', which confuses the devfs code and can cause userland
programs to fail reading /dev/ext2fs directory with weird error code.
ed [Sun, 24 Jul 2011 19:13:54 +0000 (19:13 +0000)]
MFC r223744:
Improve portability of config(8).
- Use strlen(dp->d_name) instead of the unportable dp->d_namlen. Rename
i to len to make it slightly more descriptive and prevent negative
indexing of the array.
- Replace index() by strchr().
This supposedly fixes compilation on GNU systems.
Submitted by: Robert Millan <rmh debian org> (original patch)
If we can retrieve interface address sleep for one second and try again.
This can happen during start-up, when natd starts before dhclient has a
chance to receive IP address from the upstream provider. Do this only in
background, dynamic mode.
MFC r224180:
Only the USB root HUB thread is allowed to attach and detach drivers
to and from USB devices. Remove related DEVMETHOD() lines from USB
drivers.