Commit Graph

202 Commits

Author SHA1 Message Date
kmacy
277c74ca2b don't return directly to copyin and friends when we hit certain types of faults
this fixes the unkillable syscall in stress2
2006-12-16 02:40:19 +00:00
kmacy
c75a3f1632 workaround kernel malloc's brittleness
- don't shuffle phys_avail following kernel to the beginning if the
  range is less than what would remain in a 256MB page (248MB)
2006-12-12 03:50:06 +00:00
kmacy
143e23a6dc - provide a more informative panic if mdesc_update() fails
- handle some cases where the return value of mdesc_update() is not zero
  when it should be
2006-12-12 02:50:12 +00:00
kmacy
33b85a172a - remove vestigial reference to mra[i]
- partition phys_avail along 4GB boundaries as possible workaround for hardware
  problems causing watchdog panics
2006-12-12 01:16:17 +00:00
kmacy
7d690002f5 make size of pad non-zero so that trap-tracing code doesn't overwrite the
base of our stack
2006-12-11 04:50:25 +00:00
kmacy
ea902a65dc KTR entry contained invalid context reference - ifdef out 2006-12-10 18:09:44 +00:00
kmacy
8fa2bf4919 remove more uses of trap_conversion to get more meaningful trap messages
add a printf for when we fault on the direct area (should never happen)
2006-12-10 06:00:09 +00:00
kmacy
d60154cb65 better handle the case of hw.physmemstart being hw.physmem not being set,
previously we were acting as if physmem was being set when it was not
2006-12-10 04:14:29 +00:00
kmacy
5622035de6 Add hw.physmemstart loader variable to enable the user to specify the address
at which the kernel should start allocating physical memory. The primary
purpose of this is to test 64-bit cleanness of the data path by setting
hw.physmemstart=4G so that all physical allocations are above 4GB. AMD64
and i386/PAE could also benefit from having this option.
2006-12-10 01:52:46 +00:00
kmacy
a890a19a05 Fix handling of the hw.physmem loader variable use real_phys_avail[] which
is already bounded by hw.physmem to calculate phys_avail[] - previously only
real_phys_avail[] was being bound by hw.physmem so we were allocating memory
that wasn't mapped in the direct map
2006-12-09 23:11:30 +00:00
kmacy
70541a0d66 - remove restriction on OFW kernel allocations being 4M
- shuffle memory range following kernel to the beginning of phys_avail
- have the direct area use 256MB pages where possible
- remove dead code from the end of pmap_bootstrap
- have pmap_alloc_contig_pages check all memory ranges in phys_avail before
  giving up

- informal benchmarking indicates a ~5% speedup on buildworld
2006-12-09 05:22:22 +00:00
kmacy
2e7d84aa9d fix CID 1671 by freeing listp before exit from vnex_attach 2006-12-07 02:09:06 +00:00
kmacy
d581c84189 fix CID 1670 by freeing pointer listp before returning 2006-12-07 02:05:13 +00:00
kmacy
7158c24a11 fix CID 1672 by initializing variable clock 2006-12-07 02:04:25 +00:00
kmacy
7198793974 Fix CID 1669 by removing dead sf_buf code 2006-12-07 02:03:18 +00:00
julian
396ed947f6 Threading cleanup.. part 2 of several.
Make part of John Birrell's KSE patch permanent..
Specifically, remove:
Any reference of the ksegrp structure. This feature was
never fully utilised and made things overly complicated.
All code in the scheduler that tried to make threaded programs
fair to unthreaded programs.  Libpthread processes will already
do this to some extent and libthr processes already disable it.

Also:
Since this makes such a big change to the scheduler(s), take the opportunity
to rename some structures and elements that had to be moved anyhow.
This makes the code a lot more readable.

The ULE scheduler compiles again but I have no idea if it works.

The 4bsd scheduler still reqires a little cleaning and some functions that now do
ALMOST nothing will go away, but I thought I'd do that as a separate commit.

Tested by David Xu, and Dan Eischen using libthr and libpthread.
2006-12-06 06:34:57 +00:00
kmacy
0c7f6dfbd9 - separate out rounding memory ranges to 4M boundaries from OFW memory allocation bug workaround
- create real_phys_avail which includes all memory ranges to be added to the direct map
- merge in nucleus memory to real_phys_avail
- distinguish between tag VA and index VA in tsb_set_tte_real for cases where page_size != index_page_size
- clean up direct map loop
2006-12-04 19:35:40 +00:00
kmacy
03282658c5 recent changes have caused TRAP_TRACING to induce corruption
disable until the issue has been tracked down
2006-12-04 05:06:47 +00:00
jb
da35e3e55f Turn console printf buffering into a kernel option and only on
by default for sun4v where it is absolutely required.

This change moves the buffer from struct pcpu to the stack to avoid
using the critical section which created a LOR in a couple of cases
due to interaction with the tty code and kqueue. The LOR can't be
fixed with the critical section and the pcpu buffer can't be used
without the critical section.

Putting the buffer on the stack was my initial solution, but it was
pointed out that the stress on the stack might cause problems
depending on the call path. We don't have a way of creating tests
for those possible cases, so it's best to leave this as an option
for the time being. In time we may get enough data to enable this
option more generally.
2006-11-30 04:17:05 +00:00
kmacy
46355dc4e0 - add separate variable for enabling printing of ranges
- simplify handling of rounding phys_avail ranges to 4M boundaries (needed for all
  memory to be in the direct mapped area)
2006-11-29 19:31:23 +00:00
kmacy
1eddb5f0f6 - Explicitly name the fields in pcb that we use to store trap state for later
retrieval, rather than using pad
- save the fault address in sfar for use by the alignment fixup handler
- mask off the trap number, so the context id doesn't confuse the UT_MAX
  comparison

This change fixes alignment fixup handling which is needed for traceroute
to work in spite of its copious unaligned accesses
2006-11-29 05:18:19 +00:00
kmacy
4e25808d33 We no longer need to remap hardware trap numbers to sparc64 trap numbers
as this happens much earlier in trap handling.

The fact that we continued to do this when it was no longer necessary caused
breapoint to map to SIGILL as opposed to SIGTRAP :-(.
2006-11-29 04:52:51 +00:00
kmacy
4251f122f6 re-enable tte hash resize, corruption was caused by a missing htole32 in mpt_cam.c 2006-11-27 06:51:51 +00:00
kmacy
13ee52ce1e tte hash resizing may be causing errors when building - disable for now 2006-11-27 02:17:33 +00:00
kmacy
72cdc58ff4 Declare hypervisor system initiated reset function
as needed by the previous commit :-/
2006-11-26 22:47:52 +00:00
kmacy
9f7a442659 Fix "shutdown -r" and "shutdown -h"
- "shutdown -r" will reset the system
- "shutdown -h" will power off the system
We don't drop into OFW as newer versions of solaris don't do this either
2006-11-26 22:31:23 +00:00
kmacy
ad579686c6 - remove dead code
- revert a previous change to pmap_enter where we
  could skip invalidates on unmanaged pages
2006-11-26 07:54:44 +00:00
kmacy
d388f0af90 add interrupt cookie hypervisor functions 2006-11-26 04:37:49 +00:00
kmacy
224cafa6b0 The mountroot prompt will drop into ddb if we don't recognize error codes from
getchar correctly - we also need to check for HUP and BREAK
2006-11-25 06:29:46 +00:00
csjp
f3bb6f6787 Make sure we do not sleep while locks are held. Change the malloc(9)
flags from M_WAITOK to M_NOWAIT. This should not cause any problems
since the calling code appears to properly handle failed allocations.

Discussed with:	kmacy
2006-11-24 22:14:37 +00:00
kmacy
8a9570c484 kernel will not compile without genclock, thus move to DEFAULTS 2006-11-24 20:56:43 +00:00
kmacy
7101f38d9f - implement remaining pci functions
- fix build errors
2006-11-24 20:47:29 +00:00
kmacy
491108697b Implement mmu functions and cpu_mondo_send
fix some more kernel compile fallout
2006-11-24 18:50:56 +00:00
kmacy
f366379566 comment all remaining documented hypervisor functions except for msi
implement performance counter functions
2006-11-24 07:49:15 +00:00
kmacy
b7e47d0e9d document and comment all functions outside of MMU and MSI services
from those, implement all those whose arguments don't require save/restore
2006-11-24 07:11:24 +00:00
kmacy
2dc265a00d - Comment most of the remaining hypercalls in hcall.S
- implement hypercalls returning a single value
- start fixing the fallout of the recent changes needed to get
  the kernel compiling again
2006-11-24 05:27:49 +00:00
kmacy
807d0a4e41 add comments for cpu configuration hypervisor calls 2006-11-24 02:37:51 +00:00
kmacy
cceb584eb3 move CDDL licensed machine description support routine files to cddl directory
update files.sun4v accordingly
2006-11-24 01:56:46 +00:00
kmacy
9b41c97e91 Add in initial clean room implementation of hypervisor interfaces 2006-11-23 23:47:53 +00:00
kmacy
abe656e669 Remove system critical files with CDDL origin
with the plan being to create clean room versions
2006-11-23 21:22:06 +00:00
kmacy
c784eb28fd separate out legitimately CDDL code - optimized routines taken from
opensolaries
2006-11-23 19:58:06 +00:00
kmacy
c7bcd7c518 Add watchdog support 2006-11-23 04:59:29 +00:00
kmacy
e0820ca720 Add in missing hypercall numbers 2006-11-23 04:38:14 +00:00
kmacy
2f4f3d1714 re-name misnamed single character console interfaces
add in multi character console interfaces
2006-11-23 04:18:21 +00:00
kmacy
339d8fb4ec Add hypervisor interfaces for logical domain channels from the hypervisor API docs
remove bogus CDDL
2006-11-23 03:52:39 +00:00
kmacy
86dd766979 In contrast to the non-obvious and flexible nature of the optimized bcopy in t1_copy.S (which
shall retain its CDDL copyright, and thus likely be removed from GENERIC) I have removed the CDDL
from hcall.S because there is zero flexibility in the implementation of hypercalls as they derive
directly from the hypervisor interface which is not copyrighted (ironically the source for the
hypervisor itself is BSD licensed).

It is best to start any bikeshed about this as soon as possible.

Discussed with: bsdimp
2006-11-23 02:25:16 +00:00
kmacy
44a6c9cd90 Integrate, but do not enable support for dynamically resizing TSBs 2006-11-22 05:54:24 +00:00
kmacy
8ba312cbd0 pmap_track_modified has been removed from other architectures -
likewise remove from sun4v
2006-11-22 04:50:55 +00:00
kmacy
4fb247b873 reduce whining from LINT by removing another GPL sound driver 2006-11-22 04:35:58 +00:00
kmacy
145fcb3eff add support for resizing the the tte_hash of multi-threaded processes 2006-11-22 04:33:34 +00:00
kmacy
d014240b86 remove unused field from pcpu structure 2006-11-22 04:27:24 +00:00
kmacy
5dcf866a6d remove dead code from tsb.c
switch tsbscratch over to using order of number of pages as opposed to actual number of pages
switch tsb.c over to using wrappers for contig page allocation
2006-11-22 04:13:30 +00:00
kmacy
f90ba049fb move contiguous allocation and free routines from tte_hash.c into pmap.c 2006-11-22 03:35:37 +00:00
kmacy
e45c2b9efd Add tte_hash and tsb update handlers for handling tte_hash and tsb
resizing across cpus
2006-11-22 01:47:58 +00:00
kmacy
5ce0966852 Add mechanism to track TSB misses in tsb miss handler
Remove unused debug code
2006-11-22 00:18:22 +00:00
kmacy
c90204ebd7 remove unused fields
Approved by: scottl (standing in for mentor rwatson)
2006-11-18 19:23:37 +00:00
kmacy
8d093613dd eeprom has been removed from sun4v - remove from NOTES 2006-11-18 17:16:02 +00:00
kmacy
bb3d0a231a Remove two completely unused files
Reviewed by: jb (mentor rwatson)
2006-11-18 07:28:47 +00:00
kmacy
fcb26a8fe4 Remove two more duplicated files
Reviewed by: jb (mentor is rwatson)
2006-11-18 07:24:56 +00:00
kmacy
7a3167fc07 remove 13 (largely) redundant files and switch to the sparc64/sparc64 version
Reviewed by: jb (mentor rwatson)
2006-11-18 07:10:52 +00:00
kmacy
09e19ef30c Resize the hash table upwards if the number of collision entries is greater than 1/4 of the
total
it is possible that the resize threshold should be revised upwards

Approved by: scottl (standing in for mentor rwatson)
2006-11-16 07:50:33 +00:00
kmacy
6f35e53e01 Heavily re-factor tte_hash to remove redundant code
Add hash resizing support - doesn't quite work yet
2006-11-15 06:29:52 +00:00
kmacy
0cea6ebe6f add trap trace to tl1 trap 2006-11-15 03:53:27 +00:00
kmacy
5a8d897a3d add trap tracing to dev_mondo 2006-11-15 03:20:12 +00:00
kmacy
b5d64aeac0 add trap tracing to cpu mondo handler and tsb miss handler 2006-11-15 03:16:30 +00:00
ru
8beeb4382c Fix a comment. 2006-11-13 06:26:57 +00:00
csjp
3434de5c13 Enable syscall auditing for sun4v the arch by implementing the
AUDIT_SYSCALL_ENTER/EXIT macros.

Discussed with:	kmacy
2006-11-13 04:38:57 +00:00
kmacy
1ad3f70985 Add time-of-day support to sun4v 2006-11-13 01:02:18 +00:00
alc
6093953d36 Make pmap_enter() responsible for setting PG_WRITEABLE instead
of its caller.  (As a beneficial side-effect, a high-contention
acquisition of the page queues lock in vm_fault() is eliminated.)
2006-11-12 21:48:34 +00:00
kmacy
edb2ddd470 Support up to 4 nucleus mappings to workaround issue hit by jb@ when booted
off of CD
2006-11-12 01:21:15 +00:00
kmacy
9eefcf3161 MUTEX_PROFILING has been generalized to LOCK_PROFILING. We now profile
wait (time waited to acquire) and hold times for *all* kernel locks. If
the architecture has a system synchronized TSC, the profiling code will
use that - thereby minimizing profiling overhead. Large chunks of profiling
code have been moved out of line, the overhead measured on the T1 for when
it is compiled in but not enabled is < 1%.

Approved by: scottl (standing in for mentor rwatson)
Reviewed by: des and jhb
2006-11-11 03:18:07 +00:00
jb
0951c3f7a8 Enable ata and atapicd now those work on sun4v. 2006-11-09 08:49:13 +00:00
kmacy
6a11c108bf move panic_bad_hcall to its use site in support.S in attempt to un-break the
tinderbox
2006-11-08 22:16:05 +00:00
kmacy
1fb9f2a34b Fix for ithread interrupt handling. Don't reset the interrupt vector until
after the interrupt has been handled. Also move panic_bad_hcall to local to
avoid complaints from the linker on the tinderbox.

Approved by: scottl (substituting for mentor rwatson)
2006-11-08 22:09:58 +00:00
rwatson
10d0d9cf47 Sweep kernel replacing suser(9) calls with priv(9) calls, assigning
specific privilege names to a broad range of privileges.  These may
require some future tweaking.

Sponsored by:           nCircle Network Security, Inc.
Obtained from:          TrustedBSD Project
Discussed on:           arch@
Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri,
                        Alex Lyashkov <umka at sevcity dot net>,
                        Skip Ford <skip dot ford at verizon dot net>,
                        Antoine Brodin <antoine dot brodin at laposte dot net>
2006-11-06 13:42:10 +00:00
jb
0ba5da19a5 Remove the KDTRACE option again because of the complaints about having
it as a default.

For the record, the KDTRACE option caused _no_ additional source files
to be compiled in; certainly no CDDL source files. All it did was to
allow existing BSD licensed kernel files to include one or more CDDL
header files.

By removing this from DEFAULTS, the onus is on a kernel builder to add
the option to the kernel config, possibly by including GENERIC and
customising from there. It means that DTrace won't be a feature
available in FreeBSD by default, which is the way I intended it to be.

Without this option, you can't load the dtrace module (which contains
the dtrace device and the DTrace framework). This is equivalent to
requiring an option in a kernel config before you can load the linux
emulation module, for example.

I think it is a mistake to have DTrace ported to FreeBSD, but not
to have it available to everyone, all the time. The only exception
to this is the companies which distribute systems with FreeBSD embedded.
Those companies will customise their systems anyway. The KDTRACE
option was intended for them, and only them.
2006-11-04 23:50:12 +00:00
jb
f7bc0a87d6 Build in kernel support for loading DTrace modules by default. This
adds the hooks that DTrace modules register with, and adds a few functions
which have the dtrace_ prefix to allow the DTrace FBT (function boundary
trace) provider to avoid tracing because they are called from the DTtrace
probe context.

Unlike other forms of tracing and debug, DTrace support in the kernel
incurs negligible run-time cost.

I think the only reason why anyone wouldn't want to have kernel support
enabled for DTrace would be due to the license (CDDL) under which DTrace
is released.
2006-11-04 04:58:10 +00:00
kmacy
78fce1a4a6 - map hardware trap numbers to those used by by sparc64 for inter-compatibility
and to make user-level trap handlers work
- add new trap entry to trap table to enable fast fetching of floating point trap
  context
- remove unused debug code
- map unimplemented floating point trap to SIGFPE

Approved by: scottl (standing in for mentor rwatson)
2006-11-03 23:41:53 +00:00
jb
61e78b6cd4 The relocation definitions are now defined in the machine independent
elf_common.h so that one arch can identify relocations on another
arch.
2006-11-03 23:03:46 +00:00
kmacy
0f567528e7 Fix initialization sequence for console
Fix commenting convention slightly
Approved by: rwatson (mentor)
Reviewed by: jb
2006-11-03 07:29:09 +00:00
kmacy
5e83cb856a make sure physmem is initialized
add clarifying comments
Reviewed by: jb
Approved by: rwatson (mentor)
2006-11-03 07:27:55 +00:00
jb
09c57dd752 Add a low level function to write a string to the hypervisor
console directly.

Discussed with: kmacy
2006-11-03 06:31:56 +00:00
jb
24d04bdcf8 Spaces to tabs. (I shouldn't copy and paste from diff output to a terminal)
Noticed by: pjd
2006-11-01 21:33:17 +00:00
jb
53574c6ce0 Add the trap-trace function for the hypervisor. 2006-11-01 08:14:14 +00:00
marius
02d450964f In the replacement text of the __bswapN_const() macros encapsulate the
argument in parentheses so these macros are safe to use and invocations
with an expression as the argument like __bswap32_const(42 << 23 | 13)
work as expected. Additionally, mask all the individually shifted bytes
as appropriate so the bytes which exceed the width of the respective
__bswapN_const() macro in invocations like __bswap16_const(0xdead600d)
are ignored like it's the case with the corresponding __bswapN_var()
function.

MFC after:	3 days
2006-10-30 21:50:11 +00:00
jb
3a250c3e16 Add 'options KSE' to the kernel config DEFAULTS on all arches/machines
except sun4v.

This change makes the transition from a default to an option more
transparent and is an attempt to head off all the compliants that are
likely from people who don't read UPDATING, based on experience with
the io/mem change.

Submitted by:	scottl@
2006-10-26 22:05:25 +00:00
jb
f82c799735 Make KSE a kernel option, turned on by default in all GENERIC
kernel configs except sun4v (which doesn't process signals properly
with KSE).

Reviewed by:	davidxu@
2006-10-26 21:42:22 +00:00
ru
dcc4e06e70 Move "device splash" back to MI NOTES and "files", it's MI. 2006-10-23 13:23:14 +00:00
ru
5924f811d0 Mechanically kill redundant nodevice/nooption/nomakeoption, i.e.,
those that do not exist in MI NOTES or switched on/off in the MD
NOTES.
2006-10-23 09:45:22 +00:00
delphij
48a3918d59 Fix build: remove (now) unnecessary PG_BUSY check, it's handled by vm object locking. 2006-10-22 16:33:43 +00:00
jb
e6625779b4 Comment out a debug entry which doesn't compile. Needed to fix LINT. 2006-10-17 03:53:38 +00:00
davidxu
3aa8b1e2a0 rename casuptr to casuword. 2006-10-17 03:05:17 +00:00
jb
cbe057600d Comment out 'device isa'.
Add a lot of nodevice entries for things that depend on isa, kbd and
other PC-centric things.
2006-10-16 22:06:59 +00:00
jb
47f75c2b66 Ignore the uart device. 2006-10-13 21:55:30 +00:00
jb
edbbcce00c sun4v uses the sparc64 version of this file. 2006-10-13 21:30:18 +00:00
jb
ad383478c8 Attempt to fix the sun4v tinderbox build (which unhelpfully doesn't
report errors -- just warnings).

Submitted by: ru@
2006-10-13 09:55:17 +00:00
kmacy
9d0d526018 Fix console and update to new api.
The style changes are required as a result of the CONSOLE_DRIVER macro.

Approved by: rwatson (mentor)
2006-10-13 06:45:50 +00:00
kmacy
94d242076a This won't be needed. There is already userland infrastructure for fpu emulation
for sparc64.
2006-10-12 06:00:34 +00:00
ru
cf6d68f396 Fix CPU value. 2006-10-11 04:14:41 +00:00
kmacy
65e20bda09 kernel clean up to make the sun4v kernel build
Reviewed by: jmg
Approved by: rwatson (mentor)
2006-10-09 04:45:19 +00:00
simon
440a3866d6 - Remove SCHED_ULE from GENERIC to better avoid foot-shooting by
unsuspecting users.
- Add a comment in NOTES about experimental status of SCHED_ULE.
- Make warning about experimental status in sched_ule(4) a bit
  stronger.

Suggested and reviewed by:	dougb
Discussed on:			developers
MFC after:			3 days
2006-10-05 20:31:58 +00:00
kmacy
254e1d0b6b placate Grim Reaper with sun4v support 2006-10-05 06:14:28 +00:00