John Baldwin [Tue, 15 Aug 2006 17:25:55 +0000 (17:25 +0000)]
- Remove unused sysvec variables from various syscalls.conf.
- Send the systrace_args files for all the compat ABIs to /dev/null for
now. Right now makesyscalls.sh generates a file with a hardcoded
function name, so it wouldn't work for any of the ABIs anyway. Probably
the function name should be configurable via a 'systracename' variable
and the functions should be stored in a function pointer in the sysvec
structure.
John Baldwin [Tue, 15 Aug 2006 17:09:32 +0000 (17:09 +0000)]
Add a new set of macros <prefix>_AUE_<syscallname> to sysproto.h that
map to the audit event associated with a specific system call. For
example, SYS_AUE___semctl would be set to AUE_SEMCTL in sys/sysproto.h.
Yaroslav Tykhiy [Tue, 15 Aug 2006 16:56:43 +0000 (16:56 +0000)]
Make it a tad easier to base other encapsulation schemes on this driver
by restoring the ifv_proto field in the vlan softc and putting it to use
this time. It's a good companion for ifv_encaplen, which has already been
used throughout this driver.
John Baldwin [Tue, 15 Aug 2006 16:44:18 +0000 (16:44 +0000)]
Rename 'show lockchain' to 'show locktree' and 'show threadchain' to
'show lockchain'. The churn is because I'm about to add a new
'show sleepchain' similar to 'show lockchain' for sleep locks (lockmgr and
sx) and 'show threadchain' was a bit ambiguous as both commands show
a chain of thread dependencies, 'lockchain' is for non-sleepable locks
(mtx and rw) and 'sleepchain' is for sleepable locks.
Olivier Houchard [Tue, 15 Aug 2006 16:43:07 +0000 (16:43 +0000)]
Ooops we need to include <machine/vmparam.h> to get the definition of
KERNBASE and VM_MAXUSER_ADDRESS.
Remove the useless include of opt_global.h, as noticed by netchild@ (the one
in arm/elf_trampoline.c is legit, because this file is compiled outside the
kernel, and doesn't use the standard CFLAGS).
Yaroslav Tykhiy [Tue, 15 Aug 2006 16:40:27 +0000 (16:40 +0000)]
Set IFF_DRV_RUNNING on vlan(4) once in vlan_config(),
not at many places after each call to vlan_config().
This is consistent with IFF_DRV_RUNNING being unset
in vlan_unconfig().
Remove the include of opt_global.h. It's included globally by a command
line switch. Other files which may make the same mistake (according to
fxr.watson.org) but aren't fixed in this commit (people with more clue
about those files should fix this):
- i386/xbox/xbox.c
- arm/arm/elf_trampoline.c
- arm/arm/mem.c
- Add the new files to the linux module.
- Prepare the modules for build on amd64, but don't build them there as
part of the kernel build yet. The code for the missing symbols on amd64
isn't committed and it may be solved differently.
Sponsored by: Google SoC 2006
Submitted by: rdivacky
Add the linux 2.6.x stuff (not used by default!):
- TLS - complete
- pid/tid mangling - complete
- thread area - complete
- futexes - complete with issues
- clone() extension - complete with some possible minor issues
- mq*/timer*/clock* stuff - complete but untested and the mq* stuff is
disabled when not build as part of the kernel with native FreeBSD mq*
support (module support for this will come later)
Tested with:
- linux-firefox - works, tested
- linux-opera - works, tested
- linux-realplay - doesnt work, issue with futexes
- linux-skype - doesnt work, issue with futexes
- linux-rt2-demo - works, tested
- linux-acroread - doesnt work, unknown reason (coredump) and sometimes
issue with futexes
- various unix utilities in linux-base-gentoo3 and linux-base-fc4:
everything tried worked
On amd64 not everything is supported like on i386, the catchup is planned for
later when the remaining bugs in the new functions are fixed.
To test this new stuff, you have to run
sysctl compat.linux.osrelease=2.6.16
to switch back use
sysctl compat.linux.osrelease=2.4.2
Don't switch while running a linux program, strange things may or may not
happen.
Sponsored by: Google SoC 2006
Submitted by: rdivacky
Some suggestions/help by: jhb, kib, manu@NetBSD.org, netchild
David Xu [Tue, 15 Aug 2006 12:45:51 +0000 (12:45 +0000)]
Because fuword on AMD64 returns 64bit long integer -1 on fault, clear
entire %rax to zero instead of only clearing %eax, otherwise it will
leave garbage data in upper 32 bits.
- Change process_exec function handlers prototype to include struct
image_params arg.
- Change struct image_params to include struct sysentvec pointer and
initialize it.
- Change all consumers of process_exit/process_exec eventhandlers to
new prototypes (includes splitting up into distinct exec/exit functions).
- Add eventhandler to userret.
Sponsored by: Google SoC 2006
Submitted by: rdivacky
Parts suggested by: jhb (on hackers@)
Pyun YongHyeon [Tue, 15 Aug 2006 07:37:41 +0000 (07:37 +0000)]
Add inverted amplifier sense quirks for Compaq Presario B3800
Reported by: Nick Withers < nick AT nickwithers DOT com >
Tested by: Nick Withers < nick AT nickwithers DOT com >
No objection from: ariff
MFC after: 1 week
Warner Losh [Mon, 14 Aug 2006 21:09:37 +0000 (21:09 +0000)]
Do not include ucom as a dependency line to enable inclusion of the
serial line usb drivers that depend on it. Instead, let the compile
fail rather than silently not including the driver. This is more in
line with how we handle things like mii.
# I'll note: a better system for coping with missing depends is needed,
# but this dependency is clearly backwards given our current flawed
# depend system.
John Baldwin [Mon, 14 Aug 2006 15:39:41 +0000 (15:39 +0000)]
Don't try to preserve PAT bits in pmap_enter(). We currently on pages that
aren't mapped via pmap_enter() (KVA). We will eventually support PAT bits
on user pages, but those will require some sort of MI caching mode stored
in the vm_page.
Ruslan Ermilov [Mon, 14 Aug 2006 15:35:43 +0000 (15:35 +0000)]
Fix alignment of RX bufs DMA map to be realistic. Maybe it works on
i386 (I don't know) but on amd64 at hand here, it paniced early at
boot.
(I'm pretty sure that PAGE_SIZE here was miscopied from another place
during porting, where in OpenBSD bus_dmamem_alloc() is used, but there
PAGE_SIZE means completely different thing.)
Don't use touch when what is really meant is :> (create an empty file, or
truncate it if it exists) or :>> (ensure the file exists, but don't change
it if it already does)
Dima Dorfman [Mon, 14 Aug 2006 08:21:27 +0000 (08:21 +0000)]
Improve the wording. Remove the appositive about strcmp, putting the
first sentence back to the way it was. Add a second sentence that
explains the case when strcmp is called.
Dima Dorfman [Mon, 14 Aug 2006 07:54:17 +0000 (07:54 +0000)]
Print packet loss figures with one decimal place. ping6 already does
this, and OpenBSD and NetBSD pings do it too. This is primarily useful
for comparing low levels of packet loss.
Alan Cox [Mon, 14 Aug 2006 06:15:16 +0000 (06:15 +0000)]
It's not entirely obvious that PGEX_I must be zero if no-execute is neither
supported nor enabled. Just to be sure, verify that no-execute is enabled
before passing VM_PROT_EXECUTE to vm_fault().
Matt Jacob [Mon, 14 Aug 2006 05:42:46 +0000 (05:42 +0000)]
Fix 2KLOGIN code to specify *ibits* (not *obits*) so that the
options field in register 10 will be deterministic, not random.
Correct the number of input bits for EXECUTE_FIRMWARE 0..1 to
0..2- the 2322 and 24XX cards use mailbox register 2 to specify
whether the f/w being executed is freshly loaded or not.
Correct the number of input bits for {READ,WRITE}_RAM_WORD_EXTENDED
so that register 8 gets picked up.
Fix the indexing and offset for the 2322 f/w download so that it
correctly puts the different code segments where they belong.
Move VERIFY_CHECKSUM to be the 'else' clause to 2322 f/w downloads-
the EXECUTE_FIRMWARE command for 2322 and 24XX cards will tell you
if the f/w checksum is incorrect and VERIFY_CHECKSUM only works for
RISC SRAM address < 64K so you can only do a VERIFY_CHECKSUM on the
first of the 3 f/w segments for the 2322.
Shorten the delay for the continuation mailbox commands- 1ms is
ridiculous (100us is more likely).
All of the more or less is really only for the 2322/6322 cards.
Pyun YongHyeon [Mon, 14 Aug 2006 02:21:26 +0000 (02:21 +0000)]
Make em(4) handle too many fragmented frame with m_defrag(9).
Previously em(4) requeued the failed mbuf chains from
bus_dmamap_load_mbuf_sg(9) failure to resend it later. However,
bus_dmamap_load_mbuf_sg(9) may never complete its request as the
fragmented frames can have more than EM_MAX_SCATTER segments.
To handle the above EFBIG case, defragment the frame with m_defrag(9)
and free the mbuf chain if it can't deframent the chain due to
resource shortage.
Pyun YongHyeon [Mon, 14 Aug 2006 01:50:54 +0000 (01:50 +0000)]
Overhaul Rx path to recover from mbuf cluster allocation failure.
o Create one more spare DMA map for Rx handler to recover from
bus_dmamap_load_mbuf_sg(9) failure.
o Make sure to update status bit in Rx descriptors even if we failed
to allocate a new buffer. Previously it resulted in stuck condition
and em_handle_rxtx task took up all available CPU cycles.
o Don't blindly unload DMA map. Reuse loaded DMA map if received
packet has errors. This would speed up Rx processing a bit under
heavy load as it does not need to reload DMA map in case of error.
(bus_dmamap_load_mbuf_sg(9) is the most expensive call in driver
context.)
o Update if_iqdrops counter if it can't allocate a mbuf cluster.
With this change it's now possible to see queue dropped packets
with netstat(1).
o Update mbuf_cluster_failed counter if fixup code failed to
allocate mbuf header.
o Return ENOBUFS instead of ENOMEM in case of Rx fixup failure.
o Make adapter->lmp NULL in case of Rx fixup failure. Strictly
specking it's not necessary for correct operation but it makes
the intention clear.
o Remove now unused dropped_pkts member in softc.
With these changes em(4) should survive mbuf cluster allocation
failure on Rx path.
Pyun YongHyeon [Mon, 14 Aug 2006 00:36:53 +0000 (00:36 +0000)]
Apply alignment fixup only when programmed frame size is greater than
MCLBYTES - ETHER_ALIGN. Previously it applied the alignment fixup code
for oversized frames which would result in reduced performance on
strict alignment archs.
Colin Percival [Sun, 13 Aug 2006 21:54:47 +0000 (21:54 +0000)]
Correctly handle the case in calloc(num, size) where
(size_t)(num * size) == 0
but both num and size are nonzero.
Reported by: Ilja van Sprundel
Approved by: jasone
Security: Integer overflow; calloc was allocating 1 byte in
response to a request for a multiple of 2^32 (or 2^64)
bytes instead of returning NULL.
Revert previous commit. Pre-Nehemiah C3 CPUs do have 3DNow!; it doesn't
show up in dmesg because identcpu.c only looks for it on Intel and AMD
processors.
Colin Percival [Sun, 13 Aug 2006 05:32:10 +0000 (05:32 +0000)]
Undefine __DATE__ in order to avoid placing a build timestamp into
/usr/sbin/{named, lwresd}. Note that POSIX / C99 doesn't technically
allow __DATE__ to be (un|re)defined, but gcc does what we mean anyway.
Alan Cox [Sun, 13 Aug 2006 00:11:09 +0000 (00:11 +0000)]
Reimplement the page's NOSYNC flag as an object-synchronized instead of a
page queues-synchronized flag. Reduce the scope of the page queues lock in
vm_fault() accordingly.
Move vm_fault()'s call to vm_object_set_writeable_dirty() outside of the
scope of the page queues lock. Reviewed by: tegge
Additionally, eliminate an unnecessary dereference in computing the
argument that is passed to vm_object_set_writeable_dirty().
Handle MSDOS file systems properly. Before the change file systems
created on Windows XP (and others maybe) were not detected.
We detected only those created with newfs_msdos(8).
I don't know where I got the idea that the VIA C3 has 3DNow!; it doesn't.
It does have MMX (though MMX support is reputed to be incomplete in early
generations), and later generations have SSE.
Warner Losh [Sat, 12 Aug 2006 09:06:55 +0000 (09:06 +0000)]
Batch of changes:
o when turning off the socket for a 16-bit card, write 0 to INTR register
rather than just tying to just clear the rest bit. this seems to fix
card insert detection after an eject on TI bridges (ricoh bridges work
either way, apparently). This is a MFp4.
o Cope better with TOPIC95 bridges on powerup. According to NetBSD driver,
these bridges don't set POWER_STATE, so cope accordingly in our power
code. They also need a little extra time to settle, so do that as well.
o It appears that we need to turn on/off one of the clocks to the card
when we power up/down that socket on a TOPIC97, also from NetBSD.
o TOPIC97 bridges need to specifically enable LV card support. Unconditionally
do this in the hopes that all laptops that have these chips support LV
voltages (they should, since they are required for CardBus).
o TOPIC register name regularization. Registers specific to models of TOPIC
are now called out as such.
Warner Losh [Sat, 12 Aug 2006 08:53:54 +0000 (08:53 +0000)]
The TOPIC97 and TOPIC100 seem to have a special register in the exca
space that enables low voltage operation (and maybe other stuff).
Enable the bits in this register so low voltage 16-bit cards may work.
Pyun YongHyeon [Sat, 12 Aug 2006 02:05:13 +0000 (02:05 +0000)]
Don't reset Tx threshold value whenever xl_init_locked() is called.
Instead the threshould is initialized in device attach. Later the
threshold could be increased in Tx underrun error and the new
threshold should be used in xl_init_locked().
Pyun YongHyeon [Sat, 12 Aug 2006 01:38:49 +0000 (01:38 +0000)]
Due to the poor PHY documentation from RealTek I can't sure but I
think the RealTek PHY needs driver to set RGEPHY_BMCR_AUTOEN bit of
RGEPHY_MII_BMCR register and proper ANAR register setting for manual
media type selection.
This fixes long standing manual media type selection bug in rgephy(4).
Reported by: Jelte Jansen <jelte AT NLnetLabs DOT nl>
Tested by: Jelte Jansen <jelte AT NLnetLabs DOT nl>
Thomas Quinot [Fri, 11 Aug 2006 21:44:53 +0000 (21:44 +0000)]
(sm_mon_1_svc): Fix debugging output: when establising a monitoring
request, correctly report the location (usually localhost) to which
a callback will be made when a notification is received for the
monitored host. Previsouly, the name of the monitored host was
reported instead.
Mohan Srinivasan [Fri, 11 Aug 2006 21:15:23 +0000 (21:15 +0000)]
Fixes an edge case bug in timewait handling where ticks rolling over causing
the timewait expiry to be exactly 0 corrupts the timewait queues (and that entry).
Reviewed by: silby
John Baldwin [Fri, 11 Aug 2006 19:22:57 +0000 (19:22 +0000)]
First pass at allowing memory to be mapped using cache modes other than
WB (write-back) on x86 via control bits in PTEs and PDEs (including making
use of the PAT MSR). Changes include:
- A new pmap_mapdev_attr() function for amd64 and i386 which takes an
additional parameter (relative to pmap_mapdev()) specifying the cache
mode for this mapping. Note that on amd64 only WB mappings are done with
the direct map, all other modes result in a private mapping.
- pmap_mapdev() on i386 and amd64 now defaults to using UC (uncached)
mappings rather than WB. Previously we relied on the BIOS setting up
MTRR's to enforce memio regions being treated as UC. This might make
hw.cbb_start_memory unnecessary in some cases now for example.
- A new pmap_mapbios()/pmap_unmapbios() API has been added to allow places
that used pmap_mapdev() to map non-device memory (such as ACPI tables)
to do so using WB as before.
- A new pmap_change_attr() function for amd64 and i386 that changes the
caching mode for a range of KVA.
Before using byte offset for IV creation, covert it to little endian.
This way one will be able to use provider encrypted on eg. i386 on
eg. sparc64. This doesn't really buy us much today, because UFS isn't
endian agnostic.
We retain backward compatibility by setting G_ELI_FLAG_NATIVE_BYTE_ORDER
flag on devices with version number less than 2 and not converting the
offset.
Reintroduce CSTD, which allows a Makefile to specify the precise dialect
of C in which the program or library is written.
Note that this is *not* intended to be used across the whole tree. It
is intended to be used for individual libraries or programs which use
specific language features which the compiler must know about in order
to produce correct warnings at high WARNS levels.
Yaroslav Tykhiy [Fri, 11 Aug 2006 17:09:27 +0000 (17:09 +0000)]
Optionally pad outgoing frames to the minimum of 60 bytes (excl. FCS)
before tagging them. This can help to work around brain-damage in some
switches that fail to pad a frame after untagging it if its length drops
below the minimum. This option is blessed by IEEE Std 802.1Q (2003 Ed.),
paragraph C.4.4.3.b. It's controlled by sysctl net.link.vlan.soft_pad.