]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 years agoAdd a simple C program to check mmap calls to various different addresses.
bz [Sun, 27 Sep 2009 21:03:33 +0000 (21:03 +0000)]
Add a simple C program to check mmap calls to various different addresses.
The most important test is the mapping fixed at address 0 depending on the
new sysctl.

Things will be updated and possibly converted to m4/.t style once the
details about the kernel patch will be shaken out.

Submitted by: simon (initial version)

14 years ago- When we run our trap cleanup handler, echo that we are running this
simon [Sun, 27 Sep 2009 21:01:07 +0000 (21:01 +0000)]
- When we run our trap cleanup handler, echo that we are running this
  handler to make it more clear why we are 'suddenly' running df,
  umount, and mdconfig.
- Remove trap handler again after we have unconfigured the memory
  device etc.  Before we could end up running the trap handler if a
  later stage failed, which was a bit confusing and not really useful.

MFC after: 2 weeks

14 years agoReport SATA 3.x devices.
mav [Sun, 27 Sep 2009 20:50:54 +0000 (20:50 +0000)]
Report SATA 3.x devices.

14 years agoAdd more defines from recent and not only specs.
mav [Sun, 27 Sep 2009 20:48:10 +0000 (20:48 +0000)]
Add more defines from recent and not only specs.

14 years agoAdd support for VT200-style mouse input.
ed [Sun, 27 Sep 2009 18:19:41 +0000 (18:19 +0000)]
Add support for VT200-style mouse input.

Right now if applications want to use the mouse on the command line,
they use sysmouse(4) and install a signal handler in the kernel to
deliver signals when mouse events arrive. This conflicts with my plan to
change to TERM=xterm, so implement proper VT200-style mouse input.

Because mouse input is now streamed through the TTY, it means you can
now SSH to another system on the console and use the mouse there as
well. The disadvantage of the VT200 mouse protocol, is that it doesn't
seem to generate events when moving the cursor. Only when pressing and
releasing mouse buttons.

There are different protocols as well, but this one seems to be most
commonly supported.

Reported by: Paul B. Mahol <onemda gmail com>
Tested with: vim(1)

14 years agoDo not allow mmap with the MAP_FIXED argument to map at address zero.
simon [Sun, 27 Sep 2009 14:49:51 +0000 (14:49 +0000)]
Do not allow mmap with the MAP_FIXED argument to map at address zero.
This is done to make it harder to exploit kernel NULL pointer security
vulnerabilities.  While this of course does not fix vulnerabilities,
it does mitigate their impact.

Note that this may break some applications, most likely emulators or
similar, which for one reason or another require mapping memory at
zero.

This restriction can be disabled with the security.bsd.mmap_zero
sysctl variable.

Discussed with: rwatson, bz
Tested by: bz (Wine), simon (VirtualBox)
Submitted by: jhb

14 years agoCopy apm(4) emulation from sys/i386/acpica/acpi_machdep.c and
jkim [Sun, 27 Sep 2009 14:00:16 +0000 (14:00 +0000)]
Copy apm(4) emulation from sys/i386/acpica/acpi_machdep.c and
install apm(8) and apm_bios.h on amd64.

14 years agoAdd '#define NFSCLIENT' into opt_nfs.h if the NFSCLIENT variable is 1
nyan [Sun, 27 Sep 2009 13:24:34 +0000 (13:24 +0000)]
Add '#define NFSCLIENT' into opt_nfs.h if the NFSCLIENT variable is 1
(the default is 1).

This makes the nfslockd module works for NFS client.

Reviewed by: dfr
MFC after: 3 days

14 years ago- Add Galician NLS catalog
gabor [Sun, 27 Sep 2009 13:16:38 +0000 (13:16 +0000)]
- Add Galician NLS catalog

14 years agoprinterr_reply() has never been used for as long as we've had this code in
des [Sat, 26 Sep 2009 23:05:01 +0000 (23:05 +0000)]
printerr_reply() has never been used for as long as we've had this code in
our tree (13+ years).  This is an excellent argument for aggressive use
of "static".

14 years agoUse ipv6if() when $rtadvd_interfaces="AUTO".
hrs [Sat, 26 Sep 2009 19:00:47 +0000 (19:00 +0000)]
Use ipv6if() when $rtadvd_interfaces="AUTO".

14 years agoMove rc.d/{stf,faith} to just before rc.d/routing.
hrs [Sat, 26 Sep 2009 19:00:20 +0000 (19:00 +0000)]
Move rc.d/{stf,faith} to just before rc.d/routing.

Pointed out by: tegge

14 years agoFix several logic bugs in the previous IPv6 variable change and
hrs [Sat, 26 Sep 2009 18:59:00 +0000 (18:59 +0000)]
Fix several logic bugs in the previous IPv6 variable change and
re-add $ipv6_enable support for backward compatibility.  From
UPDATING:

 1. To use IPv6, simply define $ifconfig_IF_ipv6 like $ifconfig_IF
    for IPv4.  For aliases, $ifconfig_IF_aliasN should be used.
    Note that both variables need the "inet6" keyword at the head.

    Do not set $ipv6_network_interfaces manually if you do not
    understand what you are doing.  It is not needed in most cases.

    $ipv6_ifconfig_IF and $ipv6_ifconfig_IF_aliasN still work, but
    they are obsolete.

 2. $ipv6_enable is obsolete.  Use $ipv6_prefer and/or
    "inet6 accept_rtadv" keyword in ifconfig(8) instead.

    If you define $ipv6_enable=YES, it means $ipv6_prefer=YES and
    all configured interfaces have "inet6 accept_rtadv" in the
    $ifconfig_IF_ipv6.  These are for backward compatibility.

 3. A new variable $ipv6_prefer has been added.  If NO, IPv6
    functionality of interfaces with no corresponding
    $ifconfig_IF_ipv6 is disabled by using "inet6 ifdisabled" flag,
    and the default address selection policy of ip6addrctl(8)
    is the IPv4-preferred one (see rc.d/ip6addrctl for more details).
    Note that if you want to configure IPv6 functionality on the
    disabled interfaces after boot, first you need to clear the flag by
    using ifconfig(8) like:

         ifconfig em0 inet6 -ifdisabled

    If YES, the default address selection policy is set as
    IPv6-preferred.

    The default value of $ipv6_prefer is NO.

 4. If your system need to receive Router Advertisement messages,
    define "inet6 accept_rtadv" in $ifconfig_IF_ipv6.  The rc(8)
    scripts automatically invoke rtsol(8) when the interface becomes
    UP.  The Router Advertisement messages are used for SLAAC
    (State-Less Address AutoConfiguration).

14 years agoEnsure that tv_sec is between INT32_MIN and INT32_MAX, so ZFS won't object.
pjd [Sat, 26 Sep 2009 18:23:16 +0000 (18:23 +0000)]
Ensure that tv_sec is between INT32_MIN and INT32_MAX, so ZFS won't object.
This completes the fix from r185586.

PR: kern/139059
Reported by: Daniel Braniss <danny@cs.huji.ac.il>
Submitted by: Jaakko Heinonen <jh@saunalahti.fi>
Tested by: Daniel Braniss <danny@cs.huji.ac.il>
MFC after: 3 days

14 years agoMake malloc(3) superpage aware. Specifically, if getpagesizes(3) returns
alc [Sat, 26 Sep 2009 18:20:40 +0000 (18:20 +0000)]
Make malloc(3) superpage aware.  Specifically, if getpagesizes(3) returns
a large page size that is greater than malloc(3)'s default chunk size but
less than or equal to 4 MB, then increase the chunk size to match the large
page size.

Most often, using a chunk size that is less than the large page size is not
a problem.  However, consider a long-running application that allocates and
frees significant amounts of memory.  In particular, it frees enough memory
at times that some of that memory is munmap()ed.  Up until the first
munmap(), a 1MB chunk size is just fine; it's not a problem for the virtual
memory system.  Two adjacent 1MB chunks that are aligned on a 2MB boundary
will be promoted automatically to a superpage even though they were
allocated at different times.  The trouble begins with the munmap(),
releasing a 1MB chunk will trigger the demotion of the containing superpage,
leaving behind a half-used 2MB reservation.  Now comes the real problem.
Unfortunately, when the application needs to allocate more memory, and it
recycles the previously munmap()ed address range, the implementation of
mmap() won't be able to reuse the reservation.  Basically, the coalescing
rules in the virtual memory system don't allow this new range to combine
with its neighbor.  The effect being that superpage promotion will not
reoccur for this range of addresses until both 1MB chunks are freed at some
point in the future.

Reviewed by: jasone
MFC after: 3 weeks

14 years agoPromote the cpu_class local variable to global and expose it in md_var.h
rpaulo [Sat, 26 Sep 2009 16:37:23 +0000 (16:37 +0000)]
Promote the cpu_class local variable to global and expose it in md_var.h

Reviewed by: freebsd-arm

14 years agoAdd 256 color support.
ed [Sat, 26 Sep 2009 15:26:32 +0000 (15:26 +0000)]
Add 256 color support.

It is quite inconvenient that if an application for xterm uses 256 color
mode, text suddenly starts to blink (because of ;5; in the middle).
We'd better just implement 256 color mode and add a conversion routine
from 256 to 8 color mode, which doesn't seem to be too bad in practice.

Remapping colors is done quite simple. If one of the channels is most
actively represented, primary colors are used. If two channels are most
actively represented, secondary colors are used. If all three channels
are equal (gray), it picks between black and white.

Reported by: Paul B. Mahol <onemda gmail com>

14 years agoProperly get out of origin mode if the cursor has to move outside of it.
ed [Sat, 26 Sep 2009 15:07:11 +0000 (15:07 +0000)]
Properly get out of origin mode if the cursor has to move outside of it.

In some cases events may occur that move the cursor outside the
scrolling region while in origin mode, which is normally not possible.
Events like these include:

- Alignment test.
- Restore cursor.

Properly switch off origin mode in these cases.

MFC after: 1 month

14 years agoGet rid of now deprecated SCS wrappers.
ed [Sat, 26 Sep 2009 15:03:42 +0000 (15:03 +0000)]
Get rid of now deprecated SCS wrappers.

We always build SCS, even when processing 8-bit data. There is no reason
why we should be able to disable it now.

14 years agoMake the fuzzer a bit more useful by forcing 7-bit data into it.
ed [Sat, 26 Sep 2009 15:00:42 +0000 (15:00 +0000)]
Make the fuzzer a bit more useful by forcing 7-bit data into it.

Getting valid UTF-8 sequences is quite unlikely, so we'd better just
convert data to 7 bits and make it extra likely for escape sequences to
occur.

14 years agolindev(4) [1] is supposed to be a collection of linux-specific pseudo
bz [Sat, 26 Sep 2009 12:45:28 +0000 (12:45 +0000)]
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
MFC after: 6 weeks

14 years agoHandle cases where virtual (GFS) vnodes are referenced when doing forced
pjd [Sat, 26 Sep 2009 00:10:45 +0000 (00:10 +0000)]
Handle cases where virtual (GFS) vnodes are referenced when doing forced
unmount. In that case we cannot depend on the proper order of invalidating
vnodes, so we have to free resources when we have a chance.

PR: kern/139062
Reported by: trasz
MFC after: 3 days

14 years agoOn lookup error VFS expects *vpp to be set to NULL, be sure to do that.
pjd [Sat, 26 Sep 2009 00:08:44 +0000 (00:08 +0000)]
On lookup error VFS expects *vpp to be set to NULL, be sure to do that.

MFC after: 3 days

14 years agoUse traverse() function to find and return mount point's vnode instead of
pjd [Sat, 26 Sep 2009 00:07:14 +0000 (00:07 +0000)]
Use traverse() function to find and return mount point's vnode instead of
covered vnode when snapshot is already mounted.

MFC after: 3 days

14 years ago- Don't depend on value returned by gfs_*_inactive(), it doesn't work
pjd [Sat, 26 Sep 2009 00:04:30 +0000 (00:04 +0000)]
- Don't depend on value returned by gfs_*_inactive(), it doesn't work
  well with forced unmounts when GFS vnodes are referenced.
- Make other preparations to GFS for forced unmounts.

PR: kern/139062
Reported by: trasz
MFC after: 3 days

14 years agoWipe out mergeinfo.
des [Fri, 25 Sep 2009 23:14:43 +0000 (23:14 +0000)]
Wipe out mergeinfo.

14 years agoOther minor style issues.
des [Fri, 25 Sep 2009 23:03:24 +0000 (23:03 +0000)]
Other minor style issues.

14 years agoSlight style cleanup.
des [Fri, 25 Sep 2009 22:20:30 +0000 (22:20 +0000)]
Slight style cleanup.

14 years agoFix couple of style nits missed in the previous commit.
jkim [Fri, 25 Sep 2009 20:06:31 +0000 (20:06 +0000)]
Fix couple of style nits missed in the previous commit.

14 years ago- Use x86bios_offset() instead of BIOS_PADDRTOVADDR() macro.[1]
jkim [Fri, 25 Sep 2009 19:49:07 +0000 (19:49 +0000)]
- Use x86bios_offset() instead of BIOS_PADDRTOVADDR() macro.[1]
- Clear all registers before calling real mode interrupt handlers as we did
for dpms and vesa and re-enable the function as it should be fixed by this.
- Tidy up register access.  For example, when we call INT 0x15, AH=0xc0,
we used to initialize AX=0xc000 to clear AL at the same time but it is
very confusing.  We don't have to do this any more because we are explicitly
clearing all registers now.
- Check size of system configuration table although it is almost always 8.
This is to make sure we are not reading some random low physical memory.
Hopefully it is just zero in that case. :-)
- Fix some style nits and add more comments.

Submitted by: paradox (ddkprog yahoo com)[1]

14 years agoFletcher4 is not the default checksum algorithm.
pjd [Fri, 25 Sep 2009 18:24:21 +0000 (18:24 +0000)]
Fletcher4 is not the default checksum algorithm.

MFC after: 3 days

14 years agoSwitch to fletcher4 as the default checksum algorithm. Fletcher2 was proven to
pjd [Fri, 25 Sep 2009 18:19:50 +0000 (18:19 +0000)]
Switch to fletcher4 as the default checksum algorithm. Fletcher2 was proven to
be a bit weak and OpenSolaris also switched to fletcher4.

PR: kern/139072
Reported by: Daniel Grund <bugs@dgrund.de>
MFC after: 3 days

14 years agoReject some VESA graphics modes if the controller does not have enough
jkim [Fri, 25 Sep 2009 18:08:38 +0000 (18:08 +0000)]
Reject some VESA graphics modes if the controller does not have enough
memory to support them.  Some adapters have expansible memory slots but
video mode table is static.  In this case, unusable modes may be reported.

Submitted by: paradox (ddkprog yahoo com) (initial patch)

14 years ago- Reduce BIOS memory mapping. We want 1MB of physical memory, not 12MB[1].
jkim [Fri, 25 Sep 2009 17:56:32 +0000 (17:56 +0000)]
- Reduce BIOS memory mapping.  We want 1MB of physical memory, not 12MB[1].
- Remove CS and IP registers from x86bios.h.  They have no use for us.
- Adjust register dump to make it little bit more useful for debugging.

Submitted by: paradox (ddkprog yahoo com)[1] (initial version)

14 years agoMerge r194204 from amd64/i386:
marius [Fri, 25 Sep 2009 17:08:51 +0000 (17:08 +0000)]
Merge r194204 from amd64/i386:

Enable PRINTF_BUFR_SIZE by default.

PR: 139134
MFC after: 3 days

14 years agoAdd a new escape sequence to switch between cons25 and xterm.
ed [Fri, 25 Sep 2009 13:51:01 +0000 (13:51 +0000)]
Add a new escape sequence to switch between cons25 and xterm.

Just run this to switch to xterm:

printf '\e[=T'

If you get bored and want to switch back to cons25, run this:

printf '\e[=1T'

I can now send an email to the lists, asking whether people are
interested in trying the xterm emulator.

14 years agoConformance: ignore {delete,insert} line while outside the scrolling region.
ed [Fri, 25 Sep 2009 11:58:51 +0000 (11:58 +0000)]
Conformance: ignore {delete,insert} line while outside the scrolling region.

I noticed a small inconsistency in delete and insert line between xterm
and libteken. libteken allows these actions to happen while the cursor
is placed outside the scrolling region, while xterm does not.

This behaviour seems to be VT100-like. Confirmation:

http://www.vt100.net/docs/vt102-ug/chapter5.html
"This sequence is ignored when cursor is outside scrolling region."

MFC after: 1 month

14 years agoFix LINT build.
delphij [Fri, 25 Sep 2009 02:19:57 +0000 (02:19 +0000)]
Fix LINT build.

14 years agodon't report error if key was deleted.
davidxu [Fri, 25 Sep 2009 00:15:30 +0000 (00:15 +0000)]
don't report error if key was deleted.

PR: threads/135462

14 years agoIn function do_rw_wrlock, when a writer got an error and before returning,
davidxu [Fri, 25 Sep 2009 00:03:13 +0000 (00:03 +0000)]
In function do_rw_wrlock, when a writer got an error and before returning,
check if there are readers blocked by us via URWLOCK_WRITE_WAITERS flag,
and resume the readers. The error must be EAGAIN, otherwise there must
have memory problem, and nobody can rescue the buggy application.

The revision 197445 might be reverted.

14 years agoDump real mode registers under bootverbose to help debugging BIOS emulator.
jkim [Thu, 24 Sep 2009 22:42:35 +0000 (22:42 +0000)]
Dump real mode registers under bootverbose to help debugging BIOS emulator.

14 years agoAdd __unused.
ed [Thu, 24 Sep 2009 20:34:44 +0000 (20:34 +0000)]
Add __unused.

It turns out my previous commit does survive a buildkernel, but not
compilation of the individual test tools that use WARNS=6.

14 years agoMake SCS work in 8-bit mode.
ed [Thu, 24 Sep 2009 20:33:14 +0000 (20:33 +0000)]
Make SCS work in 8-bit mode.

This means we can finally do things like VT100 box drawing when using
Syscons (8-bit characters). As far as I know, the only remaining issue
is the absense of proper escape sequences for special keyboard
characters (cursor, F1 to F12, etc) and xterm emulation should be ready
for general use.

Enabling xterm would have the following advantages:

- Easier possible migration to Unicode. cons25 termcap entries are very
  8-bit centric. They use things like CP437 characters for box drawing,
  etc.

- Better support for SSH'ing to other operating systems/devices. Most
  switches use VT100-style admin interfaces.

- Reduced bandwidth, because applications can now use things like
  scrolling regions.

- You can finally use applications like dtach(1) on both the console and
  inside an xterm.

14 years agoInitialize registers to zero before calling the interrupt handlers inside
jkim [Thu, 24 Sep 2009 20:23:24 +0000 (20:23 +0000)]
Initialize registers to zero before calling the interrupt handlers inside
emulator as we did in r197424 for vesa.

Submitted by: paradox (ddkprog yahoo com)

14 years agoSome broken VESA BIOSes, e.g., IBM T23, return wrong value from
jkim [Thu, 24 Sep 2009 20:10:00 +0000 (20:10 +0000)]
Some broken VESA BIOSes, e.g., IBM T23, return wrong value from
vesa_bios_get_line_length() in graphics mode.  Always calculate the value
from known video info instead.

Submitted by: paradox (ddkprog yahoo com)

14 years agor197444 unnecessarily changed positions of these files. Re-sort.
jkim [Thu, 24 Sep 2009 19:42:56 +0000 (19:42 +0000)]
r197444 unnecessarily changed positions of these files.  Re-sort.

14 years ago- Use FreeBSD function naming convention.
jkim [Thu, 24 Sep 2009 19:24:42 +0000 (19:24 +0000)]
- Use FreeBSD function naming convention.
- Change x86biosCall() to more appropriate x86bios_intr().[1]

Discussed with: delphij, paradox (ddkprog yahoo com)
Submitted by: paradox (ddkprog yahoo com)[1]

14 years agoAlign Tx/Rx descriptors on 32 bytes boundary instead of PAGE_SIZE.
yongari [Thu, 24 Sep 2009 17:53:00 +0000 (17:53 +0000)]
Align Tx/Rx descriptors on 32 bytes boundary instead of PAGE_SIZE.
Also align setup descriptor on 32 bytes boundary. Tx buffer have no
alignment limitation so create dmamap without alignment
restriction[1]. Rx buffer still seems to require 4 bytes alignment
limitation but we can simply use MCLBYTES for size to map the
buffer instead of TULIP_DATA_PER_DESC as the buffer is allocated
with m_getcl(9).
de(4) supports up to TULIP_MAX_TXSEG segments for Tx buffers,
increase maximum dma segment size to TULIP_MAX_TXSEG * MCLBYTES.
While I'm here remove TULIP_DATA_PER_DESC as it is not used anymore.

This should fix de(4) breakage introduced after r176206.

Submitted by: jhb [1]
Reported by: WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp >
Tested by: WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp >,
Takahashi Yoshihiro < nyan <> jp dot freebsd dot org >

14 years agoDestroy dmamap in dma cleanup.
yongari [Thu, 24 Sep 2009 17:11:41 +0000 (17:11 +0000)]
Destroy dmamap in dma cleanup.

14 years agoConsistently use bus_addr_t.
yongari [Thu, 24 Sep 2009 17:07:04 +0000 (17:07 +0000)]
Consistently use bus_addr_t.

14 years agoDo not call BUS_DRIVER_ADDED() for detached buses (attach failed) on
mav [Thu, 24 Sep 2009 17:03:32 +0000 (17:03 +0000)]
Do not call BUS_DRIVER_ADDED() for detached buses (attach failed) on
driver load. This fixes crash on atapicam module load on systems,
where some ata channels (usually ata1) was probed, but failed to attach.

Reviewed by: jhb, imp
Tested by: many

14 years agoUse __NO_STRICT_ALIGNMENT to determine whether de(4) have to apply
yongari [Thu, 24 Sep 2009 16:57:35 +0000 (16:57 +0000)]
Use __NO_STRICT_ALIGNMENT to determine whether de(4) have to apply
alignment fixup code for received frames on strict alignment
architectures.

14 years agoRemove unnecessary locking from attach(). This fixes a LOR between the
jhb [Thu, 24 Sep 2009 16:51:56 +0000 (16:51 +0000)]
Remove unnecessary locking from attach().  This fixes a LOR between the
acpi_ibm lock and the sysctl lock.

MFC after: 3 days

14 years agoBefore calling vflush(FORCECLOSE) mark file system as unmounted so the
pjd [Thu, 24 Sep 2009 15:56:26 +0000 (15:56 +0000)]
Before calling vflush(FORCECLOSE) mark file system as unmounted so the
following vnops will fail. This is very important, because without this change
vnode could be reclaimed at any point, even if we increased usecount. The only
way to ensure that vnode won't be reclaimed was to lock it, which would be very
hard to do in ZFS without changing a lot of code. With this change simply
increasing usecount is enough to be sure vnode won't be reclaimed from under
us. To be precise it can still be reclaimed but we won't be able to see it,
because every try to enter ZFS through VFS will result in EIO.

The only function that cannot return EIO, because it is needed for vflush() is
zfs_root(). Introduce ZFS_ENTER_NOERROR() macro that only locks
z_teardown_lock and never returns EIO.

MFC after: 3 days

14 years agoClose race in zfs_zget(). We have to increase usecount first and then
pjd [Thu, 24 Sep 2009 15:49:15 +0000 (15:49 +0000)]
Close race in zfs_zget(). We have to increase usecount first and then
check for VI_DOOMED flag. Before this change vnode could be reclaimed
between checking for the flag and increasing usecount.

MFC after: 3 days

14 years agoAdd a backtrace to the "fpudna in kernel mode!" case, to help track down
emaste [Thu, 24 Sep 2009 14:26:42 +0000 (14:26 +0000)]
Add a backtrace to the "fpudna in kernel mode!" case, to help track down
where this comes from.

Reviewed by: bde

14 years agoUpdate the includes to two more levels of subdirs.
rpaulo [Thu, 24 Sep 2009 11:11:00 +0000 (11:11 +0000)]
Update the includes to two more levels of subdirs.

MFC after: 1 week

14 years agonumber of cleanups in i386 and amd64 pci md code
avg [Thu, 24 Sep 2009 07:11:23 +0000 (07:11 +0000)]
number of cleanups in i386 and amd64 pci md code

o introduce PCIE_REGMAX and use it instead of ad-hoc constant
o where 'reg' parameter/variable is not already unsigned, cast it to
  unsigned before comparison with maximum value to cut off negative
  values
o use PCI_SLOTMAX in several places where 31 or 32 were explicitly used
o drop redundant check of 'bytes' in i386 pciereg_cfgread() - valid
  values are already checked in the subsequent switch

Reviewed by: jhb
MFC after: 1 week

14 years agoDon't create more partitions than can fit in the table by checking
marcel [Thu, 24 Sep 2009 06:00:49 +0000 (06:00 +0000)]
Don't create more partitions than can fit in the table by checking
that the index is within bounds.

14 years agorwlock implemented from libthr need to fall through the 'hard path' and
attilio [Wed, 23 Sep 2009 21:38:57 +0000 (21:38 +0000)]
rwlock implemented from libthr need to fall through the 'hard path' and
query umtx also if the shared waiters bit is set on a shared lock.
The writer starvation avoidance technique, infact, can lead to shared
waiters on a shared lock which can bring to a missed wakeup and thus
to a deadlock if the right bit is not checked (a notable case is the
writers counterpart to be handled through expired timeouts).

Fix that by checking for the shared waiters bit also when unlocking the
shared locks.

That bug was causing a reported MySQL deadlock.
Many thanks go to Nick Esborn and his employer DesertNet which provided
time and machines to identify and fix this issue.

PR: thread/135673
Reported by: Nick Esborn <nick at desert dot net>
Tested by: Nick Esborn <nick at desert dot net>
Reviewed by: jeff

14 years agoMove sys/dev/x86bios to sys/compat/x86bios.
jkim [Wed, 23 Sep 2009 20:49:14 +0000 (20:49 +0000)]
Move sys/dev/x86bios to sys/compat/x86bios.

It may not be optimal but it is clearly better than the old place.

OK'ed by: delphij, paradox (ddkprog yahoo com)

14 years ago- Use spin lock instead of default mutex for safety. INT/IRET instructions
jkim [Wed, 23 Sep 2009 20:13:36 +0000 (20:13 +0000)]
- Use spin lock instead of default mutex for safety.  INT/IRET instructions
save/clear/restore flags but emulated flags have no effect on the host.
I believe BIOS writers never meant to run their code in emulated
environment with interrupt enabled. :-)
- Use memcpy(3) instead of copying individual members.  I believe struct
x86regs was intentionally copied from the first half of struct x86emu_regs
for this very purpose.
- Fix some style nits and consistencies.

Reviewed by: delphij, paradox (ddkprog yahoo com)

14 years agoReplace 'can not' with 'cannot' so that we use 'cannot' everywhere.
rpaulo [Wed, 23 Sep 2009 17:48:16 +0000 (17:48 +0000)]
Replace 'can not' with 'cannot' so that we use 'cannot' everywhere.

14 years agoExtract the code to find and map the MADT ACPI table during early kernel
jhb [Wed, 23 Sep 2009 15:42:35 +0000 (15:42 +0000)]
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.

14 years agoUninline an instance of STAILQ_FOREACH_SAFE().
jhb [Wed, 23 Sep 2009 15:39:54 +0000 (15:39 +0000)]
Uninline an instance of STAILQ_FOREACH_SAFE().

14 years agoUse %zu for size_t, not %zd.
emaste [Wed, 23 Sep 2009 15:32:59 +0000 (15:32 +0000)]
Use %zu for size_t, not %zd.

Submitted by: ru
MFC after: 1 week

14 years agoAdd cross-filesystem regression tests for ACLs.
trasz [Wed, 23 Sep 2009 15:12:20 +0000 (15:12 +0000)]
Add cross-filesystem regression tests for ACLs.

14 years agoIn VOP_SETACL(9) and VOP_GETACL(9), specifying wrong ACL type should result
trasz [Wed, 23 Sep 2009 15:09:34 +0000 (15:09 +0000)]
In VOP_SETACL(9) and VOP_GETACL(9), specifying wrong ACL type should result
in EINVAL, not EOPNOTSUPP.

14 years agoAdd ACL fuzzer. It's not used by the regression tests right now,
trasz [Wed, 23 Sep 2009 15:06:51 +0000 (15:06 +0000)]
Add ACL fuzzer.  It's not used by the regression tests right now,
but I'd prefert to have it here, so it won't get lost.

14 years agoImprove on r197334:
mlaier [Wed, 23 Sep 2009 14:48:13 +0000 (14:48 +0000)]
Improve on r197334:
Find the most recently merged svn revision, too. If we get a svn revision
that matches HEAD use rXXX=GIT otherwise use rXXX+GIT.

Submitted by: avg
MFC after: 3 days
X-MFC: not stable/8 before 8.0

14 years ago- Remove a bogus test: setsockopt() doesn't return a length, getsockopt()
jhb [Wed, 23 Sep 2009 14:23:09 +0000 (14:23 +0000)]
- Remove a bogus test: setsockopt() doesn't return a length, getsockopt()
  does.
- Use %z to printf a size_t to fix compile on 64-bit platforms.

14 years ago- Bump __FreeBSD_version to reflect the point when EVFILT_USER kevent filter
stas [Wed, 23 Sep 2009 12:33:32 +0000 (12:33 +0000)]
- Bump __FreeBSD_version to reflect the point when EVFILT_USER kevent filter
  has been implemented.

14 years agoDocument osrel node for procfs.
kib [Wed, 23 Sep 2009 12:10:13 +0000 (12:10 +0000)]
Document osrel node for procfs.

Approved by: des (procfs maintainer)
MFC after: 3 weeks

14 years agoAdd per-process osrel node to the procfs, to allow read and set p_osrel
kib [Wed, 23 Sep 2009 12:08:08 +0000 (12:08 +0000)]
Add per-process osrel node to the procfs, to allow read and set p_osrel
value for the process.

Approved by: des (procfs maintainer)
MFC after: 3 weeks

14 years agoRestore BSD behaviour - when creating new directory entry use parent directory
pjd [Wed, 23 Sep 2009 09:18:16 +0000 (09:18 +0000)]
Restore BSD behaviour - when creating new directory entry use parent directory
gid to set group ownership and not process gid.

This was overlooked during v6 -> v13 switch.

PR: kern/139076
Reported by: Sean Winn <sean@gothic.net.au>
MFC after: 3 days

14 years agoIn netstat -x, do not try to print out tcp timer status for udp sockets.
silby [Wed, 23 Sep 2009 05:32:33 +0000 (05:32 +0000)]
In netstat -x, do not try to print out tcp timer status for udp sockets.

14 years agoInitialize registers to zero before calling the interrupt handlers inside
delphij [Wed, 23 Sep 2009 02:45:02 +0000 (02:45 +0000)]
Initialize registers to zero before calling the interrupt handlers inside
emulator.  This fixes VESA related freeze observed on some systems.

Submitted by: paradox <ddkprog yahoo com>

14 years agoMFp4:
mav [Tue, 22 Sep 2009 22:23:52 +0000 (22:23 +0000)]
MFp4:
If on sense request device returns no sence, give up and return,
or we may loop forever.

14 years agoLock bus scan.
mav [Tue, 22 Sep 2009 22:20:43 +0000 (22:20 +0000)]
Lock bus scan.

14 years agoMFp4:
mav [Tue, 22 Sep 2009 22:17:14 +0000 (22:17 +0000)]
MFp4:
Reduce code duplication.

14 years agoTemporarily disable typematic retrieving code until we get a real fix,
delphij [Tue, 22 Sep 2009 20:12:10 +0000 (20:12 +0000)]
Temporarily disable typematic retrieving code until we get a real fix,
which currently causes hangs in some configurations.

Reported by: joel
Submitted by: swell.k at gmail.com

14 years agoThe elements in the component arrays may be direct Package objects rather
jhb [Tue, 22 Sep 2009 18:34:23 +0000 (18:34 +0000)]
The elements in the component arrays may be direct Package objects rather
than references to objects.  In that case, simply use the Package directly.

I think a recent change to ACPI-CA is causing the interpreter to
automatically expand these references.

Reported by: Olivier Smedts  olivier gid0 org
MFC after: 3 days

14 years agoNote the D3.03 mesh changes.
rpaulo [Tue, 22 Sep 2009 18:19:18 +0000 (18:19 +0000)]
Note the D3.03 mesh changes.

MFC after: 1 week

14 years agoUpdate 802.11s mesh support to draft 3.03. This includes a revised frame
rpaulo [Tue, 22 Sep 2009 18:18:14 +0000 (18:18 +0000)]
Update 802.11s mesh support to draft 3.03. This includes a revised frame
format for peering and changes to the PERR frames.
Note that this is incompatible with the previous code.

Reviewed by: sam
MFC after: 1 week

14 years agoReserve events for XScale.
rpaulo [Tue, 22 Sep 2009 17:45:28 +0000 (17:45 +0000)]
Reserve events for XScale.

Reviewed by: jkoshy, gnn
MFC after: 1 week

14 years agoRemoved unused empty directory.
delphij [Tue, 22 Sep 2009 16:59:15 +0000 (16:59 +0000)]
Removed unused empty directory.

Submitted by: b. f. <bf1783 googlemail com>

14 years ago- Split the logic to parse an SMAP entry out into a separate function on
jhb [Tue, 22 Sep 2009 16:51:00 +0000 (16:51 +0000)]
- 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.

PR: amd64/138220
Reported by: James R. Van Artsdalen  james of jrv org
MFC after: 3 days

14 years agoChange the command argument to ioctl routines to u_long to avoid
rdivacky [Tue, 22 Sep 2009 16:28:07 +0000 (16:28 +0000)]
Change the command argument to ioctl routines to u_long to avoid
truncating the command to 32bit on 64bit archs where int is 32bit
(ie. amd64).

Approved by: scottl
Approved by: ed (mentor, implicit)

14 years agoDon't build ufs_gjournal.c at all if UFS_GJOURNAL option is not given
rdivacky [Tue, 22 Sep 2009 16:22:05 +0000 (16:22 +0000)]
Don't build ufs_gjournal.c at all if UFS_GJOURNAL option is not given
instead of building an almost empty C file.

Approved by: pjd
Approved by: ed (mentor, implicit)

14 years agoChange unsigned foo to u_foo as required by style(9).
rdivacky [Tue, 22 Sep 2009 16:16:02 +0000 (16:16 +0000)]
Change unsigned foo to u_foo as required by style(9).

Requested by: bde
Approved by: ed (mentor)

14 years agoDon't reread the command register to see if enabling I/O or memory
jhb [Tue, 22 Sep 2009 15:43:03 +0000 (15:43 +0000)]
Don't reread the command register to see if enabling I/O or memory
decoding "took".  Other OS's that I checked do not do this and it breaks
some amdpm(4) devices.  Prior to 7.2 we did not honor the error returned
when this failed anyway, so this in effect restores previous behavior.

PR: kern/137668
Tested by: Aurelien Mere  aurelien.mere  amc-os.com
MFC after: 3 days

14 years agoAdd pieces of infrastructure required for NFSv4 ACL support in UFS.
trasz [Tue, 22 Sep 2009 15:15:03 +0000 (15:15 +0000)]
Add pieces of infrastructure required for NFSv4 ACL support in UFS.

Reviewed by: rwatson

14 years agoMove es137x.c and es137x.h to a 2-clause BSD license. Also move a few
joel [Tue, 22 Sep 2009 13:23:59 +0000 (13:23 +0000)]
Move es137x.c and es137x.h to a 2-clause BSD license.  Also move a few
comments.

Submitted by: Joachim Kuebart
Approved by: core, Russell Cattelan <cattelan@thebarn.com>

14 years agoThe ndis_scan function may be started after ndis vap have been destroyed
cokane [Tue, 22 Sep 2009 12:36:51 +0000 (12:36 +0000)]
The ndis_scan function may be started after ndis vap have been destroyed

PR: kern/138632
Submitted by: Paul B. Mahol <onemda at gmail.com>
MFC after: 3 days

14 years ago- Add missing bus_dmamap_sync(9) calls for the work DMA map. Previously
marius [Tue, 22 Sep 2009 11:47:21 +0000 (11:47 +0000)]
- Add missing bus_dmamap_sync(9) calls for the work DMA map. Previously
  the work area was totally unsynchronized which means this driver only
  had a chance of working on x86 when no bounce buffers were involved,
  which isn't that likely given that support for 64-bit DMA is currently
  broken throughout ata(4).
- Add necessary little-endian conversion of accesses to the work area,
  making this driver work on big-endian hosts. While at it, use the
  alignment-agnostic byte order encoders in order to be on the safe side.
- Clear the reserved member of the SG list entries in order to be on the
  safe side. [1]

Submitted by: yongari [1]
Reviewed by: yongari
MFC after: 3 days

14 years ago- According to Linux, the ALi M5451 can do 31-bit DMA instead of just
marius [Tue, 22 Sep 2009 11:38:45 +0000 (11:38 +0000)]
- According to Linux, the ALi M5451 can do 31-bit DMA instead of just
  30-bit like the reset of the controllers supported by this driver.
  Actually ALi M5451 can be setup up to generate 32-bit addresses by
  setting the 31st bit via the accompanying ISA bridge, which allows
  it to work in sparc64 machines whose IOMMU require at least 32-bit
  DMA. Even though other architectures would also benefit from 32-bit
  DMA, enabling this bit is limited to sparc64 as bus_dma(9) doesn't
  generally guarantee that a low address of BUS_SPACE_MAXADDR_32BIT
  results in a buffer in the 32-bit range.
- According to Tatsuo YOKOGAWA's ali(4), the the DMA transfer size of
  ALi M5451 is fixed to 64k and in fact using the default size of 4k
- The 4DWAVE DX and NX require the recording buffer to be 8-byte
  aligned so adjust the bus_dma_tag_create(9) accordingly.
- Unlike the rest of the controllers supported by this driver, the
  ALi M5451 only has 32 hardware channels instead of 64 so limit the
  loop in tr_intr() accordingly. [1]

Submitted by: yongari [1]
Reviewed by: yongari (superset of what is committed)
MFC after: 3 days

14 years agoUse an unsigned integer for storing the key code.
ed [Tue, 22 Sep 2009 11:29:11 +0000 (11:29 +0000)]
Use an unsigned integer for storing the key code.

It seems Clang breaks when checking for SPCLKEY, which is now
0x80000000. Using an unsigned integer fixes this. This is also
consistent with other pieces of kbd/syscons code, because these also use
u_int.

Submitted by: rdivacky

14 years agoHide x86bios stuff in i386/amd64 specific files as atkbdc would get
delphij [Tue, 22 Sep 2009 07:10:23 +0000 (07:10 +0000)]
Hide x86bios stuff in i386/amd64 specific files as atkbdc would get
these stuff into build.

14 years agoBuild x86bios only for i386/amd64 for now. More work is required
delphij [Mon, 21 Sep 2009 23:58:29 +0000 (23:58 +0000)]
Build x86bios only for i386/amd64 for now.  More work is required
to make these functional on other architectures, and the current
code breaks sparc64 and powerpc.

Spotted by: tinderbox via des

14 years agoImprove mxge watchdog routine's ability to reliably reset a failed NIC:
gallatin [Mon, 21 Sep 2009 20:16:10 +0000 (20:16 +0000)]
Improve mxge watchdog routine's ability to reliably reset a failed NIC:

- Mark the link as down, so if watchdog reset fails, link watching
    failover software can notice it
- Don't send MXGEFW_CMD_ETHERNET_DOWN if the NIC has been reset, it is
    not needed, and will fail on a freshly reset NIC.
- Ensure the transmit routines aren't attempting to PIO write to doorbells
    while the NIC is being reset.
- Download the correct f/w, rather than using the EEPROM f/w after reset.
- Export a count of the number of watchdog resets via sysctl
- Zero all f/w stats at reset.  This will lead to less confusing
    diagnostic output when investigating NIC failures.

MFC after: 3 days