Commit Graph

787 Commits

Author SHA1 Message Date
dsl
88aa2c71d3 Enable LINUX and LINUX32 emulation. 2007-12-21 18:31:12 +00:00
joerg
e9bc92e889 lock_stubs.S needs assym.h. 2007-12-21 16:23:05 +00:00
jmcneill
ebdccda407 Add thinkpad at acpi 2007-12-21 15:18:28 +00:00
ad
e16a661bf3 - Make __cpu_simple_lock and similar real functions and patch at runtime.
- Remove old x86 atomic ops.
- Drop text alignment back to 16 on i386 (really, this time).
- Minor cleanup.
2007-12-20 23:46:10 +00:00
ad
f28895c808 Remove GENERIC.MP config and enable SMP by default on amd64. 2007-12-20 23:32:24 +00:00
dsl
7e2790cf6f Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
    int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
2007-12-20 23:02:38 +00:00
ad
4f4f294aa3 Decode cmpxchg8b correctly. 2007-12-20 19:53:47 +00:00
joerg
870cffb0ab Add new IPI for saving CPU state explicitly, share high-level part of
ACPI wakeup code and teach it how to start the APs again. As a side
effect the CPU_START interface allows choosing between different
bootstrap codes more easily now.
2007-12-18 07:17:08 +00:00
riz
344b2782f7 Add drvctl(4) 2007-12-17 16:45:12 +00:00
joerg
dffe4b9c05 Use GENERIC for installation as well, just add the ramdisk hooks. 2007-12-17 13:48:18 +00:00
riz
1d7c0bc27f Add drvctl(4) 2007-12-17 04:36:16 +00:00
joerg
9ba317469f Move mapping of the real mode location for the ACPI wakeup code into a
separate function called from acpi_md_callback.
2007-12-15 11:26:40 +00:00
joerg
261292569c Steal some rope from innocent users and disallow ACPI suspend if more
than one CPU was found.
2007-12-15 09:15:37 +00:00
xtraeme
eb3500dc11 Fix previous with suggestion by cube: rather than checking for cpu_model[0]
check that cpu_vendor is CPUVENDOR_AMD.
2007-12-12 15:01:42 +00:00
xtraeme
a6ab4730a4 Check for the first 'D' letter in the cpu_model string for POWERNOW_K8,
so that it works in Dual Core Opterons (and maybe others).

Patch from Akihiko Taniguchi in PR port-amd64/37526.
2007-12-12 14:36:21 +00:00
jmcneill
9313b4bcb3 Disable apm@acpi on amd64, since we don't create /dev/apmctl, build apmd,
or provide machine/apmvar.h. Ok ad@
2007-12-11 04:22:46 +00:00
ad
8218ef4d43 Real hardware has been available for a long time now! 2007-12-10 21:48:20 +00:00
wiz
30df2bb21e Add acpiecdt and add a comment explaining it (from i386/GENERIC). 2007-12-10 17:44:33 +00:00
jmcneill
e099142b51 Revert previous, thanks wiz! 2007-12-10 12:35:27 +00:00
jmcneill
4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
xtraeme
383db93ca3 Enable arcmsr(4). 2007-12-07 10:13:22 +00:00
bouyer
287c4eac96 Remove MAXPHYS=32768 (coming from a too large cut-n-paste), it's not needed
for dom0 kernels.
2007-12-06 20:02:02 +00:00
ad
065b6ba2fb lockmgr -> mutex 2007-12-06 17:00:31 +00:00
ad
c519a6851b Correct argument shuffling in the string I/O functions. 2007-12-06 14:40:28 +00:00
xtraeme
67052f9b51 arc(4) -> arcmsr(4) 2007-12-05 00:19:40 +00:00
xtraeme
b5738c49b6 Enable arc(4). 2007-12-04 18:53:57 +00:00
ad
7546fcf0ad softintr_ret: fix it to work properly after yesterday's change to mi_switch. 2007-12-04 08:03:46 +00:00
joerg
e5784d23f1 Add a CPU local timer based on the LAPIC. This is consistently faster
than TSC, but doesn't suffer from SpeedStep as TSC does.

The default quality is higher than HPET for UP, but -100 for
MULTIPROCESSOR as it needs CPU local state which doesn't exist yet.
2007-12-03 22:17:27 +00:00
ad
395a384526 Merge from vmlocking. 2007-12-03 20:21:32 +00:00
ad
4b293a84e1 Interrupt handling changes, in discussion since February:
- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
2007-12-03 15:33:00 +00:00
dsl
cd39f2272a Improve the likelyhood of the 'oosyscall' code (ie that for system call entry
via a call gate for i386 netbsd 1.0 and ibcs2) doing the right thing.
Untested because I've failed to get an a.out netbsd 1.0 binary to load.
2007-12-02 21:43:11 +00:00
ad
7960b954d7 Don't clear ci_want_resched in MD code; it's done in mi_switch(). 2007-12-02 16:37:58 +00:00
kiyohara
a1297d6f3f Add bcsp(4). 2007-12-02 05:19:11 +00:00
jmcneill
ad3709398d aprintify 2007-12-01 16:59:13 +00:00
jmcneill
a0d3b0d7a8 aprintify 2007-12-01 14:35:51 +00:00
ad
0b8a0d143c Drop text alignment back to 16 - the usual size of blocks the instruction
decoder works with.
2007-11-29 22:03:48 +00:00
ad
32c745d42e __HAVE_ATOMIC64_OPS 2007-11-29 00:56:53 +00:00
ad
4517da3861 x86_mb_nop is now unused. 2007-11-28 18:19:20 +00:00
ad
a0b58b4601 Remove remaining CPUCLASS_386 tests. 2007-11-28 16:44:46 +00:00
ad
6def667f04 Use the new atomic ops. 2007-11-28 16:28:43 +00:00
ad
0cddf536c0 Hook in the atomic ops from libkern. 2007-11-28 15:26:00 +00:00
christos
c98098ca80 Add aligned(16) in savefpu like the i386 port has. Suggested by Matthias
Drochner.
2007-11-27 18:23:03 +00:00
christos
8f2e876039 Shuffle things around so that pcb_savefpu goes back to be aligned in a 16
bit boundary. Noted by Arto Huusko.
2007-11-27 15:49:48 +00:00
christos
759df5a6a0 make cr2 64 bits. Requested by fvdl. 2007-11-26 15:38:29 +00:00
christos
b6740bf65c preserve cr2 on pcb for the benefit of linux emulation. 2007-11-24 23:51:23 +00:00
bouyer
f76460d92e Make Xen profiling kernels work.
XXX assembly still needs to be fixed for non-Xen kernels.
2007-11-24 18:55:41 +00:00
bouyer
7ede1be847 Xen loads the symbol table 4 bytes after _end, not eight.
Now the kernel properly finds the symbol table.
2007-11-24 17:57:53 +00:00
bouyer
11d3f17479 Sync BSD_SYMTAB declaration with xeni386, pointed out by Christoph Egger 2007-11-23 15:38:52 +00:00
bouyer
b378f8b2cb Include opt_xen.h #ifdef _KERNEL_OPT instead of custom logic.
Thanks to Izumi Tsutsui for pointing me at _KERNEL_OPT
2007-11-23 15:38:06 +00:00
bouyer
5d7691aecb Fix bouyer-xenamd64 merge fallout:
we can #include "opt_xen.h" when
#if defined(_KERNEL) && !defined(_RUMPKERNEL) && !defined(_LKM),
#ifdef _KERNEL isn't enough.
2007-11-22 21:21:14 +00:00
bouyer
e221ac46f1 Reinclude machine/cpuvar.h lost in bouyer-xenamd64 merge; make GENERIC.MP
kernel build again.
2007-11-22 20:24:25 +00:00
bouyer
4264e84aeb only include opt_xen.h #ifdef _KERNEL 2007-11-22 17:38:34 +00:00
bouyer
4e54134323 Pull up the bouyer-xenamd64 branch to HEAD. This brings in amd64 support
to NetBSD/Xen, both Dom0 and DomU.
2007-11-22 16:16:40 +00:00
jnemeth
309fa09200 comment out com*/lpt* at acpi? as they cause these ports to move from
their traditional location and imminent changes in -current will cause
them to move back
2007-11-22 14:33:53 +00:00
xtraeme
f0927a591f Put back again softintr_init() that was removed in rev 1.67, this fixes
the panics that people reported on current-users.

Tested and verified by Greg Oster.
2007-11-20 23:10:49 +00:00
yamt
3a40ff100a put back IPL_IPI as it's still used. 2007-11-20 14:31:46 +00:00
ad
ce2527b4f4 IPL_IPI -> IPL_HIGH 2007-11-19 23:07:48 +00:00
ad
f73e8d8529 IPL_IPI -> IPL_HIGH 2007-11-19 19:02:20 +00:00
jnemeth
e67de88d89 PR/37404 - Rui-Xiang Guo -- sync phy list with GENERIC 2007-11-19 11:04:46 +00:00
skrll
74c813c4e9 s/proc/lwp/ in comment 2007-11-16 07:36:10 +00:00
ad
e4df9c1dd8 Disable TLB shootdown IPIs while in the debugger. Crashdumps may try to
use them, and all but one CPU is paused. Reported and tested by martin@.
2007-11-15 19:46:44 +00:00
ad
deae4f32c5 Remove support for 80386 level CPUs. PR port-i386/36163. 2007-11-15 19:18:32 +00:00
xtraeme
a73f1d379b Update for it(4) -> itesio(4) rename. 2007-11-15 12:58:28 +00:00
ad
88697952bb Clear the direction flag on entry to the kernel. 2007-11-14 11:09:49 +00:00
ad
61bbd00d33 In cpu_hatch(), recompute ci_tsc_freq instead of using the boot CPU's value. 2007-11-13 18:41:59 +00:00
ghen
f970d5d287 Add description for EST_FREQ_USERWRITE (from i386). 2007-11-13 16:33:54 +00:00
ad
6856a132b2 Merge cpu_need_resched() from vmlocking:
- Always do an aston(), even if not sending an IPI. May help with xine.
- Post asts on cpu_onproc, not ci_curlwp.
2007-11-12 19:02:26 +00:00
ad
1207625f42 - cpu_vendor was both an int and char[] on amd64 - fix it.
- Run the errata check/patch on all CPUs, not just the boot processor.
2007-11-12 18:44:42 +00:00
ad
51a2159851 Don't unconditionally clear the direction flag. The ABI says it must always
be clear when making a function call, and 'cld' takes about 50 clock cyles
on the P4.
2007-11-12 18:41:59 +00:00
jmcneill
7d666065e7 Enable pad(4) 2007-11-11 17:56:10 +00:00
ad
7135f4bde9 - When computing the TSC frequency, call i8254_delay() and not DELAY().
- Use atomics to adjust the pmap reference count, instead of taking locks.
- Implement I386_{SET,GET}_{FS,GS}BASE, allowing %fs and %gs to be used
  as per-thread registers. This is compatible with FreeBSD.
- Run patches after we have attached CPUs, since we then know if the
  system is uniprocessor or not. Eliminates a lot of #ifdef MULTIPROCESSOR
  and makes running MP kernels on UP systems cheaper.
- Patch out many of the 'lock' prefixes to nops if uniprocessor.
- Do a wbinvd after patching to ensure that the trace/instruction cache
  is up to date.
2007-11-10 20:06:23 +00:00
dsl
d13ff754f9 Don't intercept sys_syscall and sys___syscall here, just call the MI code. 2007-11-09 14:59:37 +00:00
xtraeme
4ba09b41c3 Remove System V semaphores and share memory options to set the limits:
SEMMNI, SEMMNS, SEMUME and SHMMAXPGS.

They can be tweaked via sysctl now. Ports that were setting values on
them weren't touched, I only removed the ones that were commented out.
2007-11-04 14:34:19 +00:00
dsl
97d76a5de4 Kill netbsd32_syscall_fancy and optimise other code paths.
Current gcc manages to compile this without spilling any locals onto the
stack.
2007-11-04 11:08:54 +00:00
dsl
d1041e432f Linux doesn't have a SYS_syscall system call (it is all done in libc), and
definitely doesn't have SYS___syscall.
Kill all the code - now matching i386/i386/linux_syscall.c
There is also no point using a switch statement (and it's unpredictable
jump indirect) to save a few memory copies.
2007-11-03 12:58:04 +00:00
dsl
979f6f87e5 Merge linux_syscall_fancy and linux_syscall_plain. 2007-11-03 12:21:20 +00:00
dsl
b4acb99fdd Remove now-redundant #if 2007-11-03 12:20:44 +00:00
dsl
22d623b6d6 Kill syscall_fancy().
With a the result of trace_is_enabled() cached in p->p_trace_enabled the
cost of 2 correctly predicted branches is insignificant.
Reorder prologue slightly, should reduce memory stalls.
2007-11-01 22:48:14 +00:00
dsl
2d1f4c35c9 Fallout from fixing the linux32 system calls to use the correct kernel
functions and parameter layouts.
2007-10-31 22:40:25 +00:00
xtraeme
c9ebd528c1 options<space><tab>FOO 2007-10-30 00:03:50 +00:00
ad
e7976c8a86 Mark cpu_info::ci_tlbstate volatile to ensure that the compiler doesn't
reorder accesses to it. It's updated from the TLB IPI handlers and we don't
block those, so the order in which things are read/updated is important.
2007-10-29 01:35:36 +00:00
xtraeme
1d390936f8 Enable "options INTEL_CORETEMP". 2007-10-29 00:47:16 +00:00
xtraeme
e3b08fdabe Add coretemp(4). A new driver for Intel Core's on-die thermal sensor,
available on Intel Core or newer CPUs.

Ported from FreeBSD. Tested by rmind on i386 and joerg on amd64.

Enabled with "options INTEL_CORETEMP".
2007-10-29 00:42:28 +00:00
dsl
9b2fcb3d05 Add (commented out) SYSCALL_COUNTS and SYSCALL_TIMES. 2007-10-28 18:39:38 +00:00
dsl
121ee101f7 Add support for the SYSCALL_STATS and SYSCALL_TIMES options. 2007-10-28 18:35:49 +00:00
dsl
b279dc62eb Instead of having 2 copies of the sycall entry code, reprocess the file
to generate syscall_plain() with #defines to remove the trace calls.
Join the club of making micro-optimisations to this code to speed up
benchmarks of empty system calls (eg getpid()):
- Use __predict_false() to get fewer branches in the 'normal' path.
- Just copy all the arguments from the stack frame to 'args', since the
  jump indirect for the switch statement is basically unpredicatable.
- Keep the (rather pointless) test for 0 arguments - just for higher
  benchmark scores.
NB system call timing are dominated by other factors! I measured getppid()
  as faster than getpid(), sometimes open("foo", -1) was also faster.
I also suspect that if trace_is_enabled(p) were a simple bit test (that
could be inlined), then the cost of the tests would be unmeasurable and
the syscall_plain/fancy fiasco could be expunged completely.
2007-10-27 22:56:41 +00:00
dsl
7cfa26e69a Remove some gratuitous differences between syscall_fancy and syscall_plain. 2007-10-27 18:41:57 +00:00
xtraeme
7e8be191f1 Share pcib(4) and amdpcib(4) between i386 and amd64; one copy is enough. 2007-10-26 22:17:13 +00:00
xtraeme
8129e894df Apply some KNF. 2007-10-26 21:58:17 +00:00
xtraeme
3338a139da - Share pchb(4) between i386 and amd64; one copy is enough for both.
- Move some of the x86 PCI devices into x86/pci/files.pci.
- Add more x86 stuff into x86/conf/files.x86.

ok joerg.
2007-10-26 21:49:50 +00:00
joerg
930e1f6e1d Match delay/DELAY on x86 with delay(9). It takes an unsigned int as
argument. Use this and replace the inline assembly (mul + div using the
64bit intermediate result) with normal 32bit multiplication and
division. The compiler can turn the division into a multiplication and
shift, making it even cheaper then the original assembly. For extreme
long delays, just use 64bit arithmetic.
2007-10-26 13:24:39 +00:00
ad
bccf777b72 Make ras_lookup() lockless. 2007-10-24 14:50:38 +00:00
joerg
bced6f4565 Reduce difference to i386 GENERIC:
- add some comments from that
- options SPACE TAB
- enable EST
- enable DDB and build w/ frame pointer by default
- enable ACPI devices
- include AGP
- include Cardbus and PCMCIA
- include Synaptics driver
- include atw, ipw, iwi, hme, rtw, txp
- include uep, stuirda, utoppy, ugensa

This makes GENERIC actually usable for laptops.
2007-10-24 07:09:09 +00:00
joerg
05911100fa cpufunc.S depends on assym.h. 2007-10-24 06:26:56 +00:00
njoly
a478f23b9e Add compat_linux and exec_linux_elf lkm support for amd64:
- Add needed COMPAT_OSSAUDIO to GENERIC.
- Add missing includes needed by linux_syscallargs.h.
- Add lkm building.
2007-10-19 18:52:09 +00:00
yamt
24a1632cb3 merge yamt-x86pmap branch.
- reduce differences between amd64 and i386.  notably, share pmap.c
  between them.  it makes several i386 pmap improvements available to
  amd64, including tlb shootdown reduction and bug fixes from Stephan Uphoff.
- implement deferred pmap switching for amd64.
- remove LARGEPAGES option.  always use large pages if available.
  also, make it work on amd64.
2007-10-18 15:28:31 +00:00
garbled
d974db0ada Merge the ppcoea-renovation branch to HEAD.
This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree.  Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches.  The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
2007-10-17 19:52:51 +00:00
joerg
19459bd736 Bump default size of the message buffer from 16 KB to 32 KB.
This is large enough that boot -v on most systems fits into the
message buffer, which makes it easier for debugging.
2007-10-13 14:46:54 +00:00
ad
972c6ae552 crit_enter/crit_exit are now available. 2007-10-12 13:38:08 +00:00
christos
18bad5abba busfunc depends on assym.h 2007-10-04 00:00:42 +00:00