Marcel Moolenaar [Wed, 16 Mar 2011 03:53:18 +0000 (03:53 +0000)]
MFaltix:
Add support for Pre-Boot Virtual Memory (PBVM) to the loader.
PBVM allows us to link the kernel at a fixed virtual address without
having to make any assumptions about the physical memory layout. On
the SGI Altix 350 for example, there's no usuable physical memory
below 192GB. Also, the PBVM allows us to control better where we're
going to physically load the kernel and its modules so that we can
make sure we load the kernel in memory that's close to the BSP.
The PBVM is managed by a simple page table. The minimum size of the
page table is 4KB (EFI page size) and the maximum is currently set
to 1MB. A page in the PBVM is 64KB, as that's the maximum alignment
one can specify in a linker script. The bottom line is that PBVM is
between 64KB and 8GB in size.
The loader maps the PBVM page table at a fixed virtual address and
using a single translations. The PBVM itself is also mapped using a
single translation for a maximum of 32MB.
While here, increase the heap in the EFI loader from 512KB to 2MB
and set the stage for supporting relocatable modules.
Edwin Groothuis [Wed, 16 Mar 2011 03:28:42 +0000 (03:28 +0000)]
MFV of r219685, tzdata2011d
- Pacific/Apia will have DST on 2 April instead of 3 April in 2011.
- Turkye will go to DST on 28 April instead of 27 April in 2011.
- Cuba will go to DST on 20 April in 2011.
Edwin Groothuis [Wed, 16 Mar 2011 03:07:08 +0000 (03:07 +0000)]
Vendor import of tzdata2011d:
- Pacific/Apia will have DST on 2 April instead of 3 April in 2011.
- Turkye will go to DST on 28 April instead of 27 April in 2011.
- Cuba will go to DST on 20 April in 2011.
Marcel Moolenaar [Wed, 16 Mar 2011 00:42:15 +0000 (00:42 +0000)]
Fix mv_gpio_in() for pin numbers that occupy bits 8-31 in GPIO registers.
The compiler will truncate the 32-bit return value of mv_gpio_value_get()
to match the 8-bit return value of mv_gpio_in(). A conditional expression
is used to have mv_gpio_in() always return 0 or 1 instead.
Marcel Moolenaar [Wed, 16 Mar 2011 00:08:10 +0000 (00:08 +0000)]
Revert previous commit: EFI_STATUS is a 64-bit integral on ia64. Fix the
compile warning on i386 (where EFI_STATUS is a 32-bit integral) by casting
the status argument to u_long instead.
Calling rfork_thread(3) does not interoperate with pthreads and global state
is not properly protected.
Remove the BUGS section suggesting LinuxThreads entirely. With the current
pthread library libthr, all threads are kernel-level entities so there seems
little reason to use LinuxThreads.
Jung-uk Kim [Tue, 15 Mar 2011 21:45:10 +0000 (21:45 +0000)]
Partially revert r219672. After r198295, kernel need to seed randomness as
soon as possible for stack protector. However, dummy timecounter does not
have enough entropy and we don't need to sacrifice Pentium class and later.
Pointed out by: Maxim Dounin (mdounin at mdounin dot ru)
Jung-uk Kim [Tue, 15 Mar 2011 17:14:26 +0000 (17:14 +0000)]
Unconditionally use binuptime(9) for get_cyclecount(9) on i386. Since this
function is almost exclusively used for random harvesting, there is no need
for micro-optimization. Adjust the manual page accordingly.
Marcel Moolenaar [Tue, 15 Mar 2011 16:50:17 +0000 (16:50 +0000)]
Reserve 24KB for the static kernel stack. We use this stack to call into
the firmware for physical mode calls and the Altix doesn't work when it's
16KB.
Forgot to commit this change along with r219563: pam_group(8) now issues
a warning if neither luser nor ruser is specified. The correct option
for su(1) is ruser.
Marcel Moolenaar [Mon, 14 Mar 2011 23:49:41 +0000 (23:49 +0000)]
Don't define IA64_PBVM_PAGE_SIZE as 1U shifted to the left by some amount.
The compiler seems to assume it's a 32-bit integral and rounding to the
page size using the standard expression (((u_long)(x) + mask) & ~mask),
results in a 32-bit value. Dropping the 'U' suffix is enough to have the
compiler treat the expression as a 64-bit integral.
Marcel Moolenaar [Mon, 14 Mar 2011 05:29:45 +0000 (05:29 +0000)]
o Deal with unmapped PBVM in the alternate instruction and data TLB fault
handlers.
o Put the IVT in its own section and keep the supporting code close.
o Make sure the VHPT is sized so that it can be mapped using a single
translation.
o Map the PAL code and VHPT with a translation that has the right size.
Assume the platform has a PAL code size that can be mapped with a
single translations.
o Pass the pointer to the bootinfo structure as an argument to ia64_init().
o Get rid of LOG2_ID_PAGE_SIZE and IA64_ID_PAGE_SIZE. It was used to map
the regions 6 & 7 and was as large as possible. The problem is that we
can't support memory attributes easily if the granuratity is not a page.
We need to support memory attributes because the new USB stack violates
the BUS_DMA(9) interface.
o Update some comments...
NOTE: this is broken for SMP kernels, because the AP startup code hasn't
been updated yet.
Marcel Moolenaar [Mon, 14 Mar 2011 05:16:12 +0000 (05:16 +0000)]
Move the actual code to the front of the segment and make sure the IVT
can be put right at the front when put in its own section. This makes
sure that when the loader can only map a relatively small part of the
PBVM, the IVT and the startup code is wired.
Adrian Chadd [Mon, 14 Mar 2011 00:42:48 +0000 (00:42 +0000)]
Bring over the AR9285 board update code from ath9k.
This does a few things in particular:
* Abstracts out the gain control settings into a separate function;
* Configure antenna diversity, LNA and antenna gain parameters;
* Configure ob/db entries - the later v4k EEPROM modal revisions have
multiple OB/DB parameters which are used for some form of
calibration. Although the radio does have defaults for each,
the EEPROM can override them.
This resolves the AR2427 related issues I've been seeing and makes
it stable at all 11g rates for both TX and RX.
Marcel Moolenaar [Sun, 13 Mar 2011 22:04:19 +0000 (22:04 +0000)]
o Make sure the page table has a size that is mappable. Certain page
sizes are not supported.
o Map the PBVM page table.
o Map the PBVM using the largest possible power of 2 that is less than
the amount of PBVM used and round down to a valid page size. Note
that the current kernel is between 8MB and 16MB in size, which would
mean that 8MB would be the typical size of the mapping, if only 8MB
wasn't an invalid page size. In practice, we end up mapping the first
4MB of PBVM in most cases.
Nathan Whitehorn [Sun, 13 Mar 2011 21:23:25 +0000 (21:23 +0000)]
Don't sleep while setting the clock. This can cause panics when
periodic_resettodr() calls CLOCK_SETTIME() and smu tries to sleep while
running from a callout.
Jilles Tjoelker [Sun, 13 Mar 2011 20:02:39 +0000 (20:02 +0000)]
sh: Fix some parameter expansion variants ${#...}.
These already worked: $# ${#} ${##} ${#-} ${#?}
These now work as well: ${#+word} ${#-word} ${##word} ${#%word}
There is an ambiguity in the standard with ${#?}: it could be the length of
$? or it could be $# giving an error in the (impossible) case that it is not
set. We continue to use the former interpretation as it seems more useful.
Nathan Whitehorn [Sun, 13 Mar 2011 18:23:47 +0000 (18:23 +0000)]
Use the manifest file count, if available, to determine the number of files
in the archive instead of spinning through it to get a file count for the
progress bar. This speeds up installation a lot on systems with slow
CD drives.
Nathan Whitehorn [Sun, 13 Mar 2011 17:15:31 +0000 (17:15 +0000)]
Add generation of an installation manifest containing SHA256 checksums as
well as package descriptions and add code in the installer to check the
checksums.
Adrian Chadd [Sun, 13 Mar 2011 13:00:45 +0000 (13:00 +0000)]
Fix the nfarray offsets for the ar2133/ar5133 radio - (AR5416, AR9160, etc.)
The offsets didn't match the assumption that nfarray[] is ordered by the
chainmask bits and programmed via the register order in ar5416_cca_regs[].
This repairs that damage and ensures that chain 1 is programmed correctly.
(And extension channels will now be programmed correctly also.)
This fixes some of the stuck beacons I've been seeing on my AR9160/AR5416
setups - because Chain 1 would be programmed -80 or -85 dBm, which is
higher than the actual noise floor and thus convincing the radio that
indeed it can't ever transmit.
Bernhard Schmidt [Sun, 13 Mar 2011 12:56:46 +0000 (12:56 +0000)]
When injecting frames a temporary node is faked, during this several
uses of ic_curchan occur. Due to the nature of a scan, switching
channels constantly and all this happening without any kind of locks
held, it might happen that ic_curchan points to nowhere leading to
panics. Fix this by not allowing frame injections while in SCAN state.
Bernhard Schmidt [Sun, 13 Mar 2011 12:21:04 +0000 (12:21 +0000)]
Fix a cut&paste error while parsing htcap/htinfo elements. This one is
reponsible for not filling ni_htrates if a pre-ht information element is
present.
Bernhard Schmidt [Sun, 13 Mar 2011 11:58:40 +0000 (11:58 +0000)]
Fix rmax calculation during BSS selection.
If multiple networks are available the max bandwidth is one
condition used for selecting the "best" BSS. To achieve that
we should consider all parameters which affect the max RX rate.
This includes 20/40MHz, SGI and the of course the MCS set.
If the TX MCS parameters are available we should use those,
because an AP announcing support for receiving frames at 450Mbps
might only be able to transmit at 150Mbps (1T3R). I haven't seen
devices with support for transmitting at higher rates then
receiving, so prefering TX over RX information should be safe.
While here, remove the hardcoded assumption that MCS15 is the max
possible MCS rate, use MCS31 instead which really is the highest
rate (according to the 802.11n std). Also, fix a mismatch of an
40MHz/SGI check.
Bernhard Schmidt [Sun, 13 Mar 2011 11:56:33 +0000 (11:56 +0000)]
Fill hc_mcsset completely.
Contrary to the rateset information in legacy frames the MCS Set
field also contains TX capability information in cases where the
number of available TX and RX spartial streams differ. Because a
rateset doesn't contain that information we have to pull the
those directly from the hardware capabilities.
Bernhard Schmidt [Sun, 13 Mar 2011 11:45:58 +0000 (11:45 +0000)]
Change the way HT capatibilities are announced.
Get rid of the assumption that every device is capable of 40MHz,
SGI and 2 spartial streams. Instead of printing, in the worst case,
8 times 76 MCS rates, print logically connect ranges and the
support RX/TX streams.
Bernhard Schmidt [Sun, 13 Mar 2011 11:40:18 +0000 (11:40 +0000)]
First step on removing the harcoded RX/TX stream and MCS0-15 assumptions.
Initialize ic_rxstream/ic_txstream with 2, for compatibility reasons.
Introduce 4 new HTC flags, which are used in addition to ic_rxstream
and ic_txstream to compute the hc_mcsset content and also for initializing
ni_htrates. The number of spatial streams is enough to determine support
for MCS0-31 but not for MCS32-76 as well as some TX parameters in the
hc_mcsset field.
Adrian Chadd [Sun, 13 Mar 2011 05:54:05 +0000 (05:54 +0000)]
Move out some of the shared eeprom board value calculation routines into ah.c
rather than duplicating them for the v14 (ar5416+) and v4k (ar9285) codebases.
Further chipsets (eg the AR9287) have yet another EEPROM format which will use
these routines to calculate things.
Adrian Chadd [Sun, 13 Mar 2011 05:30:14 +0000 (05:30 +0000)]
* Add in some board settings debugging to log what's being written
to the TX closed-loop power control registers.
* Modify a couple of functions to take the register chain number,
rather than the regChainOffset value. This allows for the
register chain to be logged.
Nathan Whitehorn [Sun, 13 Mar 2011 01:38:24 +0000 (01:38 +0000)]
Add generation of memstick images to the bsdinstall release makefile for
i386 and amd64. This involved moving the memstick generation script to
the arch directories from scripts/, in analogy to mkisoimages.sh. This
script was never called from /usr/src/release/Makefile, so that hasn't
been updated.
Doug Barton [Sat, 12 Mar 2011 21:13:08 +0000 (21:13 +0000)]
Use the allexport option in load_rc_config() in order to avoid having
to repeatedly read the conf files. Depending on what is enabled the
files are being read anywhere from 15, 30, or more times currently.
By loading the values in the environment this is reduced to 1, with
perhaps a couple more, again depending on what is enabled.
The speed-up for boot and shutdown is negligible when rc.conf is
on local disk, noticable when accessing files over NFS, and dramatic
when pulling rc.conf values from a database.
This change also includes a minor optimization to the conditional
for $_rc_conf_loaded.
Steve Kargl [Sat, 12 Mar 2011 19:37:35 +0000 (19:37 +0000)]
Take two. Add the missing file that should have been committed
with r219571 and re-enable building of cbrtl.
Implement the long double version for the cube root function, cbrtl.
The algorithm uses Newton's iterations with a crude estimate of the
cube root to converge to a result.
Steve Kargl [Sat, 12 Mar 2011 16:50:39 +0000 (16:50 +0000)]
Implement the long double version for the cube root function, cbrtl.
The algorithm uses Newton's iterations with a crude estimate of the
cube root to converge to a result.
Bjoern A. Zeeb [Sat, 12 Mar 2011 16:45:15 +0000 (16:45 +0000)]
Push a possible "unbind" in some situation from in6_pcbsetport() to
callers. This also fixes a problem when the prison call could set
the inp->in6p_laddr (laddr) and a following priv_check_cred() call
would return an error and will allow us to merge the IPv4 and IPv6
implementation.
Add "ruser" and "luser" options. The former corresponds to the current
behavior, where the module checks that the supplicant is a member of the
required group. The latter checks the target user instead. If neither
option was specified, pam_group(8) assumes "ruser" and issues a warning.
I intend to eventually change the default to "luser" to match the
behavior of similarly-named service modules in other operating systems.
Bjoern A. Zeeb [Sat, 12 Mar 2011 09:41:25 +0000 (09:41 +0000)]
Make sure the locally cached value of rt->rt_gateway stays stable,
even after dropping the reference and unlocking. Previously we
have dereferenced a NULL pointer (after r121765).
Simply unlocking after the block does not work either because of
lock ordering (see r121765) and in addition we would still hold
a pointer to something that might be gone by the time we access it.
Thus take a copy of the value rather than just caching the pointer.
Andriy Gapon [Sat, 12 Mar 2011 09:09:25 +0000 (09:09 +0000)]
add DTrace systrace support for linux32 and freebsd32 on amd64 syscalls
Add systrace_linux32 and systrace_freebsd32 modules which provide
support for tracing compat system calls in addition to native system
call tracing provided by systrace module.
Provided that all the systrace modules are loaded now you can select
what syscalls to trace in the following manner:
syscall::xxx:yyy - work on all system calls that match the specification
syscall:freebsd:xxx:yyy - only native system calls
syscall:linux32:xxx:yyy - linux32 compat system calls
syscall:freebsd32:xxx:yyy - freebsd32 compat system calls on amd64