Jake Burkholder [Sun, 18 Nov 2001 04:35:09 +0000 (04:35 +0000)]
Catch up to jmpbuf changes. Define offsets used from assmebly language
in another file so that it is easy to see what they are and keep them in
sync with the headers (grafted from the kernel generated assym.s).
Jake Burkholder [Sun, 18 Nov 2001 04:00:22 +0000 (04:00 +0000)]
1. Split fp.h into fp.h and fsr.h so that the latter can be included
in asm files.
2. Temporarily cause subnormal operands in floating point operations
to be treated as zeros so that comlpetion of the operation does not
need to be emulated.
3. Catch fp_exception_other and correctly skip over the unfinished
instruction, but basically ignore them. Emulating the instruction
is not yet supported.
4. Zero td_retval[1] as well in syscall().
Jake Burkholder [Sun, 18 Nov 2001 03:41:12 +0000 (03:41 +0000)]
1. Remove kdbframe. Bad idea.
2. Add a TF_DONE macro, which fiddles a trapframe to make the retry on
return from traps act like a done (advance past the trapping
instruction instead of re-executing).
3. Flush the windows before entering the debugger, since it is no
longer done in the breakpoint trap vector.
4. Print a warning if trace <pid> is attempted, it is not yet implemented.
5. Print traps better and decode system calls in traces.
Jake Burkholder [Sun, 18 Nov 2001 03:28:28 +0000 (03:28 +0000)]
1. Convert the tstate saved in the pcb to a pstate and test for PSTATE_PEF
to determine if a process is using floating point. in order to avoid
sign extending a 13 bit immediate.
2. We don't need to context switch cwp anymore, it is better to just
fiddle the save tstate on return from traps. See exception.s 1.10
and 1.12.
3. Completely remove pcb_cwp.
4. Implement vmapbuf, vunmapbuf and vm_fault_quick. Completely remove
TODOs from vm_machdep.c (yay!).
Jake Burkholder [Sun, 18 Nov 2001 03:02:53 +0000 (03:02 +0000)]
1. Remove bootinfo and just pass loader metadata to the kernel.
2. Remove mcontext.mc_sp, it is redundant. Adjust spare space to make
ucontext_t a nice size.
3. Raise pil in the debugger.
Jake Burkholder [Sun, 18 Nov 2001 02:47:26 +0000 (02:47 +0000)]
1. Implement ascopyto() and ascopyfrom() for copying to an alternate address
space from kernel space and from an alternate address space to kernel
space.
2. Remove the unused and unprototyped physcopy() and physzero() and replace
with the more versatile ascopy() and aszero(), inspired by the above.
These can be used to copy and zero physical pages of memory without mapping
them into kernel space first.
3. Use magic numbers for the offsets in the jmpbuf structure like other
platforms.
4. Use SET.
Jake Burkholder [Sun, 18 Nov 2001 02:33:37 +0000 (02:33 +0000)]
1. Fix a bug where the offsets of the alignment and mmu fault recorvery code
in the window trap vectors were mixed up. All this did is cause unnecesary
traps and look wierd in traces. Superfluous traps happen a lot in normal
operation, so we are rather good at recovering from them.
2. Store the arguments for a ktr trace in the right place.
3. Use a generic trap vector for breakpoints. It should not be special.
4. Save the frame pointer in the trap frame for kernel traps if DDB is compiled
in, otherwsie we don't save the out registers for kernel traps and stack
traces can't go through nested traps.
5. Apply the same fix to the return from kernel mode trap code as for user
mode traps. Ensure that the window we're returning to is the same one
that we restore to by fiddling the cwp in the saved tstate. This requires
that we transfer the values loaded from the trap frame into alternate
globals before restore-ing, but doing so is not very expensive and not
worth worrying about. Not changing the saved cwp can result in the register
values magically changing on return from traps if we happen to have slept
and the windows don't work out exactly the same. Fix the trace just before
the retry to account for different register usage.
6. Use a SET macro for loading address constants rather than a variation of
set and setx. set only works for 32 bit constants, while setx works for
64 bit constants as well, but produces bloated code when unnecessary.
Gas always generates the canonical 2 register, 6 instruction form, even
when it could be optimized; set uses 1 register and 2 instructions. At
the moment we assume that the kernel binary is below 4GB so set is
always sufficient, but the macro allows it to be configured. Note that
this has nothing to do with 32 vs. 64 bit address space, it only applies
to addresses of symbols which are known at compile/link time.
Ian Dowse [Sun, 18 Nov 2001 00:47:45 +0000 (00:47 +0000)]
Remove a sentence from the BUGS section that claims non page-aligned
offsets don't work. It should really be documented that the returned
pointer can be in the middle of a fully-valid page when the offset
is not page-aligned, but I couldn't come up with suitable wording.
Ian Dowse [Sat, 17 Nov 2001 23:48:21 +0000 (23:48 +0000)]
Fix a large number of -Wall, -Wformat and -W compiler warnings.
These were mainly missing casts or wrong format strings in printf
statements, but there were also missing includes, unused variables,
functions and arguments.
The choice of `long' vs `int' still seems almost random in a lot
of places though.
Ian Dowse [Sat, 17 Nov 2001 22:46:36 +0000 (22:46 +0000)]
Give a more useful diagnostic when an extraneous hard link to a
directory is encountered. This includes the full path of the
directory that will be removed if the user answers "y" to the
"REMOVE?" question.
smmsp - sendmail 8.12 operates as a set-group-ID binary (instead of
set-user-ID). This new user/group will be used for command line
submissions. UID/GID 25 is suggested in the sendmail documentation and has
been adopted by other operating systems such as OpenBSD and Solaris 9.
mailnull - The default value for DefaultUser is now set to the uid and gid
of the first existing user mailnull, sendmail, or daemon that has a
non-zero uid. If none of these exist, sendmail reverts back to the old
behavior of using uid 1 and gid 1. Currently FreeBSD uses daemon for
DefaultUser but I would prefer not to use an account used by other
programs, hence the addition of mailnull. UID/GID 26 has been chosen for
this user.
This was discussed on -arch on October 18-19, 2001.
Matt Jacob [Sat, 17 Nov 2001 18:26:00 +0000 (18:26 +0000)]
Be very generous with timeouts for synchronize cache. We may wait a very long
time in the cases where it really sends the drive out to lunch, but it also
allows us to catch very wierd edge cases of strange drives that might take
a very long time (emulated disk drives over a network, e.g.).
Matthew Dillon [Sat, 17 Nov 2001 03:07:11 +0000 (03:07 +0000)]
Give struct socket structures a ref counting interface similar to
vnodes. This will hopefully serve as a base from which we can
expand the MP code. We currently do not attempt to obtain any
mutex or SX locks, but the door is open to add them when we nail
down exactly how that part of it is going to work.
Peter Wemm [Sat, 17 Nov 2001 01:38:32 +0000 (01:38 +0000)]
Start bringing i386/pmap.c into line with cleanups that were done to
alpha pmap. In particular -
- pd_entry_t and pt_entry_t are now u_int32_t instead of a pointer.
This is to enable cleaner PAE and x86-64 support down the track sor
that we can change the pd_entry_t/pt_entry_t types to 64 bit entities.
- Terminate "unsigned *ptep, pte" with extreme prejudice and use the
correct pt_entry_t/pd_entry_t types.
- Various other cosmetic changes to match cleanups elsewhere.
- This eliminates a boatload of casts.
- use VM_MAXUSER_ADDRESS in place of UPT_MIN_ADDRESS in a couple of places
where we're testing user address space limits. Assuming the page tables
start directly after the end of user space is not a safe assumption.
There is still more to go.
Jonathan Lemon [Sat, 17 Nov 2001 00:40:48 +0000 (00:40 +0000)]
When laying out objects in a ZONE_INTERRUPT zone, allow them to cross
a page boundary, since we've already allocated all our contiguous kva
space up front. This eliminates some memory wastage, and allows us to
actually reach the # of objects were specified in the zinit() call.
Peter Wemm [Sat, 17 Nov 2001 00:26:57 +0000 (00:26 +0000)]
utime/stime.tv_sec are elapsed times, not relative to 1970. We can
safely print them as longs. Even if ^T overflows after a process
has accumulated 68 years of user or system time, it is no big deal.
Ian Dowse [Fri, 16 Nov 2001 22:13:44 +0000 (22:13 +0000)]
Give a sensible error message when the filesystem to be dumped is
not listed in /etc/fstab. Previously, the user would be greeted
with "DUMP: bad sblock magic number" when dump tried to parse
the directory contents as an FFS filesystem.
PR: bin/12789
Submitted by: Bob Willcox <bob@pmr.com>
John Baldwin [Fri, 16 Nov 2001 18:33:19 +0000 (18:33 +0000)]
Axe SMP support, the ses device, and the atapifd device from the kern.flp
boot kernel so it fits again. This actually gives us quite a bit of
breathing room, so some more ethernet drivers might be turned on now in a
later commit.
Robert Watson [Fri, 16 Nov 2001 16:49:21 +0000 (16:49 +0000)]
o Allow rarpd to accept an additional '-t directory' argument, specifying
an alternative to /tftpboot. This is useful it you're using tftpd
with an alternative root (using -s), and would like rarpd to respond
selectively to RARP requests using the same criteria as tftp.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
Robert Watson [Fri, 16 Nov 2001 05:09:45 +0000 (05:09 +0000)]
o Reflect repo-copy of extattr.[c3] from libutil to libc, moving
extattr namespace routines to the libc/posix1e directory. While
the extattr calls are not strictly POSIX.1e, POSIX.1e wasn't
strictly ever approved, so I think that's OK.
Robert Watson [Fri, 16 Nov 2001 04:39:16 +0000 (04:39 +0000)]
o Add support for a 'nocheckmail' capability, which (if true) prevents
the 'You have mail.' check. This is useful for sites that rely on
remote mail access, rather than a local mail spool. Due to the
behavior of login_getcapbool(), the negated form is required so as
to have appropriate results.
o This behavior may have to be independently added to sshd due to
redundant implementation.
Peter Wemm [Fri, 16 Nov 2001 02:41:31 +0000 (02:41 +0000)]
Merge another missing part of i386/pmap.c rev 1.220. Dont blindly clear
the PG_BUSY flag without using the code that wakes up something else that
may be sleeping on it.
Robert Watson [Fri, 16 Nov 2001 02:40:09 +0000 (02:40 +0000)]
Although the 'bool' type is referenced in the list of capabilities, it
is not defined in the capability type list. Provide a definition for
'bool', if a slightly less than elegant one. Note that this definition
does not include the complete scope of available behavior defined
in cgetcap(3), and could probably be improved.
Peter Wemm [Fri, 16 Nov 2001 02:28:33 +0000 (02:28 +0000)]
Merge rev 1.264 from i386/pmap.c (tegge via alfred):
Protect against an infinite loop when prefaulting pages. This can
happen when the vm system maps past the end of an object or tries
to map a zero length object, the pmap layer misses the fact that
offsets wrap into negative numbers and we get stuck.
Peter Wemm [Fri, 16 Nov 2001 02:25:29 +0000 (02:25 +0000)]
Merge rev 1.202 from i386/pmap.c (back in 1998 by John Dyson):
Make flushing dirty pages work correctly on filesystems that
unexpectedly do not complete writes even with sync I/O requests.
This should help the behavior of mmaped files when using
softupdates (and perhaps in other circumstances also.)
Peter Wemm [Fri, 16 Nov 2001 02:17:18 +0000 (02:17 +0000)]
Converge/fix some debug code (#if 0'ed on alpha, but whatever)
- use NPTEPG/NPDEPG instead of magic 1024 (important for PAE)
- use pt_entry_t instead of unsigned (important for PAE)
- use vm_offset_t instead of unsigned for va's (important for x86-64)
Peter Wemm [Fri, 16 Nov 2001 01:56:34 +0000 (01:56 +0000)]
As part of a general cleanup and reconvergence of related pmap code,
start tidying up some loose ends. The DEBUG_VA stuff has long since
passed its use-by date. It wasn't used on ia64 but got cut/pasted there.
Maxim Sobolev [Thu, 15 Nov 2001 23:01:29 +0000 (23:01 +0000)]
Allow bit 21 of EFLAGS register (PSL_ID) be changed in the use-mode without
ill effects. This should fix problems threaded programs are having with
auto-detecting CPU type.
Reported by: Joe Clarke <marcus@marcuscom.com>
Tested by: Joe Clarke <marcus@marcuscom.com>
Reviewed by: jhb
MFC after: 1 week
Robert Watson [Thu, 15 Nov 2001 22:50:06 +0000 (22:50 +0000)]
o extattrctl initattr, when pre-allocating store for extended attributes,
computed a a chunksize that didn't include the extended attribute
header. This was a non-fatal error, in that it was just writing out
zeros anyway, but did have the effect of not pre-allocating the
right amount of disk space. This fix calculates chunksize to include
the attribute header.
Robert Watson [Thu, 15 Nov 2001 19:28:49 +0000 (19:28 +0000)]
o Rely on /dev/snp* permissions, rather than using suser() in snpopen()
to prevent inappropriate use of the snoop device. This means that,
with appropriate chmod'ing, arbitrary users may make use of the snoop
device.
src/sys/dev/an/if_an_pccard.c rev 1.10 change requires to include
"card_if.h" but Makefile doesn't know about this file. Without this,
kernel build will fail at this driver.