Commit Graph

507 Commits

Author SHA1 Message Date
xtraeme 6f9427240c Change the description to 'coreN' rather than 'cpuN', which seems to
be more correct.
2007-12-21 01:10:54 +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
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 163e94a67e 64-bit atomic ops for i386. 2007-12-20 01:27:24 +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
joerg 1dfe814354 Don't call acpi_md_sleep_init on Xen, it doesn't support ACPI sleep
anyway.
2007-12-17 14:11:12 +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 bcf2c96639 For now, remove the attempts to shutdown other CPUs and bring them back
online. It runs into issues in the pmap code and will handled
differently. This allows sysctl -w machdep.sleep_state=3 to at least
recover into a working system again.
2007-12-15 09:18:59 +00:00
bouyer a4bffcd44a Reorder some operations for better handling of failures in
xpq_update_foreign(). Note that this also affects native operations, but it
shoulnd't cause problems even for SMP system. Proposed on port-amd64@ and
port-i386@

Don't invalidate the recursive PTE entry in user pmap when switching from
kernel to userland on Xen/amd64. This effectively means that a userland
process can read its own page tables (no write, of course) on Xen/amd64, but
it shouldn't cause security issue (discussed on tech-kern@ some time ago).
This makes NetBSD Xen/amd64 more than 10x faster
building pkgsrc/pkgtools/digest
2007-12-13 21:22:15 +00:00
jmcneill 645fe8c342 Try not to pass garbage to pci_make_tag; workaround for odd ACPI DSDTs.
Fixes kern/37527.
2007-12-12 23:33:22 +00:00
lukem 5f235cda5e MAKEVERBOSE support 2007-12-11 13:56:50 +00:00
xtraeme 273ccc1066 Remove useless returns at the end of void functions. 2007-12-09 21:14:26 +00:00
jmcneill 6dc665045d How did these get lost? 2007-12-09 20:32:17 +00:00
jmcneill 4c1d81b2b5 Merge jmcneill-pm branch. 2007-12-09 20:27:42 +00:00
ad be36918dcb Use sys/atomic instead of __asm(). 2007-12-09 15:35:15 +00:00
ad f7576cd670 Use the new memory barriers. 2007-12-09 15:33:13 +00:00
ad 36fb43dbdb Use atomic_cas_ulong(). 2007-12-09 15:32:27 +00:00
ad 56c1b0074f Minor correction to previous. 2007-12-09 15:31:03 +00:00
ad dd24075295 - pmap_reactivate: save an atomic op if possible.
- pmap_tlb_shootdown: use atomic ops instead of _lock_cas().
2007-12-09 15:29:53 +00:00
xtraeme d77a6c713d Print the informational messages after all checks have been done,
and while I'm here change some of those to be aprint_debug(). Also
use __func__ rather than __FUNCTION__.
2007-12-07 20:33:27 +00:00
ad 5921ed7cda Share cpu_intr_p() with xen. Why xen has its own intr.c is a mystery. 2007-12-06 13:58:38 +00:00
ad 83caeda725 - Fix the locking around the i8254. Values for the TSC clock and lapic
delay function were wildly inaccurate due to multiple CPUs competing
  in DELAY() during calibration, confusing the clock chip.
- Use i8254_delay() explictly in a few more places.
2007-12-04 16:05:34 +00:00
joerg d84e0831f3 Revert last commit which added externs that never get defined anywhere.
At least lapic_get_timecount conflicts with the newly added lapic TC.
2007-12-03 23:29:26 +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 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
rumble f06a64e97b Fix two minor bugs:
1) If ODCM is disabled (ODCM_ENABLE not set), clockmod_getstate() should
    return the maximum level (7), not the lowest (0), as the levels are
    defined as duty cycles where the highest implies no ODCM. Now sysctl
    machdep.clockmod.current doesn't lie upon init.

 2) Make the sysctl handler ensure that no disabled levels are permitted.
    Previously, a level disabled due to errata could be passed to
    clockmod_setstate(), which would search through the state array,
    skipping the unusable value. Consequently our index would be out of
    range and badness could ensue.

Okay'd by xtraeme@.
2007-12-02 22:44:57 +00:00
ad 6a310e099d Back out part of patch that got merged accidentally. 2007-12-02 20:34:41 +00:00
ad 3ce0f72397 Use atomics to adjust ci_flags. 2007-12-02 19:33:31 +00:00
jmcneill e501c34199 SILENCE! I kill you! 2007-12-02 06:51:52 +00:00
ad 4e780c2f88 Shh 2007-12-01 16:45:35 +00:00
jmcneill a0d3b0d7a8 aprintify 2007-12-01 14:35:51 +00:00
jmcneill 1b940a02fa aprintify 2007-12-01 06:05:18 +00:00
jmcneill 4fbe23fdd0 aprintify 2007-12-01 04:50:50 +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
pooka 61e8303e9d Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start.  In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
2007-11-26 19:01:26 +00:00
markd 80601465c6 Add Intel Q35/G33/Q33 bridges. 2007-11-24 02:18:48 +00:00
bouyer 62b95d1250 Put back part of revision 1.1.4.8: the L4 page has to be pinned as L4
before before being mapped by APDP_PDE.
2007-11-23 16:33:25 +00:00
xtraeme 2c375380d5 tcotimer_setmode: convert seconds to ticks after the value has been
checked with the limits. We can use now the max timeout value on ICH6
or newer (i.e 613 seconds and not the half of it as previously).
2007-11-23 11:21:14 +00:00
xtraeme 54d41c7770 Use the returned value of xc_unicast() on xc_wait(), that will wait
for completion on the CPU running the xcall thread.

Tested on a 8-way Xeon by Greg Oster.
2007-11-22 16:27:06 +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
yamt 38d5e34116 make kmutex_t and krwlock_t smaller by killing lock id.
ok'ed by Andrew Doran.
2007-11-21 10:19:06 +00:00
ad 2795528241 #include <sys/atomic.h> instead of local prototypes. 2007-11-18 18:09:10 +00:00
xtraeme 31962fc6e5 Extend the envsys2 API (one more time, sorry) as defined in:
http://mail-index.netbsd.org/tech-kern/2007/11/09/0001.html

sysmon_envsys_create() and sysmon_envsys_destroy() were added to
create/destroy sysmon_envsys objects (and its TAILQ/LIST for sensors/events).

sysmon_envsys_sensor_attach() and sysmon_envsys_sensor_detach() were
added to attach/detach sensors to a specified sysmon_envsys device.

The events framework is now per device and configurable via the
ENVSYS_SETDICTIONARY ioctl or /etc/envsys.conf and envstat(8).

Update all users and documentation to reflect these changes.
2007-11-16 08:00:11 +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
ad 9014362808 - Remove I486_CPU, I586_CPU, I686_CPU options. They buy us nothing and
clutter the code significantly.
- Remove pccons.
2007-11-14 17:54:56 +00:00
joerg 64dcc1f587 Merge from jmcneill-pm:
Add some more defines from the spec. Remove some old ones not
existing in the current Intel Architecture Guide. Use some more
understandable names.

ANSIfy and use uintXX_t to hurt my eyes less.

Further improve readability by exploiting __HAVE_TIMECOUNTER as
invariance on x86 platforms.
2007-11-14 15:54:22 +00:00