Commit Graph

723 Commits

Author SHA1 Message Date
yamt
b860f867c0 use device_xname. 2008-01-04 15:44:58 +00:00
he
46a379e692 Declare sysbeepdetach(), and protect a small additional section
with #if (NPCPPI > 0).
2008-01-03 21:30:16 +00:00
dyoung
69d7a3e831 Support detachment of pchb(4) and sysbeep(4). 2008-01-03 04:50:19 +00:00
yamt
03539d901d pmap_extract_ma:
- TRUE/FALSE -> true/false
	- (P == FALSE) -> (!P)
2008-01-02 17:33:08 +00:00
yamt
41f847fb03 make pmap_pv_cache static. 2008-01-02 12:31:32 +00:00
yamt
d450c78d16 g/c pv_page stuffs. 2008-01-02 12:30:30 +00:00
ad
4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
yamt
48a1e4c2c1 a simple performance monitor based profiler, inspired from linux oprofile. 2008-01-01 21:28:37 +00:00
yamt
cfb66876d1 try to detect processor resource sharing topologies. ie. package/core/smt IDs. 2008-01-01 20:32:10 +00:00
yamt
e550a539ee add x86_cpuid2, which can specify ecx register. 2008-01-01 12:51:08 +00:00
joerg
02d07b4e9d Remove delaytab and just compute the reminder directly. This requires
two muls and a shift, which needs at most 2ms on a 25MHz i386 and should
end up as fast as delay(1) was before due to using a reminder of 2.
Discussed with ad@.
2007-12-28 14:05:22 +00:00
yamt
2cbcb46f49 - share idt entry allocation code among x86.
- introduce a function to reserve an idt entry and use it instead of
  manipulating idt_allocmap directly.
- rename idt to xen_idt for amd64 xen.  add missing #ifdef XEN.
2007-12-26 11:51:10 +00:00
perry
b6a2ef7569 Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
2007-12-25 18:33:32 +00:00
joerg
9a98cd19ff Add initial version of calling VGA POST from vga_resume. This is the
equivalent to "vbetool post" using x86emu in the kernel.
2007-12-25 14:22:25 +00:00
xtraeme
4bb97c0a3e After comments from joerg@, backout previous and use 'cpuN'. 2007-12-21 21:36:22 +00:00
drochner
200f66ee6b define the SSSE3 feature flag bit and print out all known bits 2007-12-21 14:57:22 +00:00
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
ad
a8bd124ebf cpu_hatch: change lapic initialization order. 2007-11-14 14:59:28 +00:00
ad
cf96d257bf Use i8254_delay(). 2007-11-14 14:50:33 +00:00
ad
1e3209066c +LAPIC_DLMODE_EXTINT 2007-11-14 14:45:50 +00:00
joerg
fa98d432c4 Force all interrupts to notify the primary CPU's APIC by default,
independent on what the BIOS programmed the IOAPIC for.
2007-11-13 21:45:40 +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
ad
a8a8de7393 When running uniprocessor, patch _kernel_lock() and _kernel_unlock() to
do nothing more than "nop; ret".
2007-11-13 18:38:58 +00:00
joerg
0bed2981dc Add Intel 82965PM bridge from jmcneill-pm. 2007-11-12 19:40:49 +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
7d979d5024 pmap_load: pmap_reference() can no longer block. 2007-11-11 01:30:55 +00:00
ad
7aaa70d105 fsbase/gsbase:
- Fix a few bugs with it, in particular fork/exec handling.
- Store the descriptors in the PCB, not in the LWP.
2007-11-10 23:04:28 +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
ad
ceb9d03641 __cpu_simple_locks really should be simple, otherwise they can cause
problems for e.g. profiling.
2007-11-07 16:02:27 +00:00
ad
d18c6ca4de Merge from vmlocking:
- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.
2007-11-07 00:23:13 +00:00
jnemeth
d7d1da9b0d PR/37201 - Yasushi Oshima -- Intel 82965G chipset support 2007-10-30 12:20:03 +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
joerg
b6c45f0dfa More debugging reveals that the U7600 really wants to use the same
voltage for different frequencies. The fake table can be computed as
driven by the frequency here as well, but don't recompute the voltage as
it would result in an underflow.

Fix argument order in a debug message to match the format string.
2007-10-28 15:15:35 +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
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
joerg
1b3b209f70 Remove code that was never meant to hit the tree in first place. 2007-10-24 10:12:34 +00:00
joerg
25f1319b9a Before faking up a state table, make sure that neither frequency nor
voltage difference is 0. This avoids a divide by zero.
2007-10-24 06:21:32 +00:00
pavel
99f7676452 The control registers (notably CR3 and CR4) are 64-bit on amd64 (see
"AMD64 Architecture Programmer's Manual"). Declare the variables
holding them as vaddr_t, otherwise the upper bits are lost.

(CR0 is actually 64-bit too, but the upper bits are unused, so I am
not changing it now.)

Should fix the reboot caused by X11. From Arto Huusko in
PR port-amd64/37043.
2007-10-19 21:34:56 +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
joerg
02ed2a3988 Add ioapic_dump_raw, which dumps the full IOAPIC register set. 2007-10-17 21:18:18 +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
bc08b9a85d Make the check for a working RNG a bit more aggressive. Try to read
10 samples and bail out if there was a timeout to get either of those
within 10ms or if they are all 0xff. Both are good indicators of a
missing RNG.
2007-10-16 22:53:11 +00:00
joerg
926fafca19 Exploit that only Intel devices are matched and all devices do the same.
This saves two levels of indentation for the main body, making it more
readable. Don't hide the error for disabling the RNG under DIAGNOSTIC,
verbose is enough. Use aprint_*_dev.
2007-10-16 22:29:08 +00:00
ad
972c6ae552 crit_enter/crit_exit are now available. 2007-10-12 13:38:08 +00:00
joerg
7f7035433f Install the default entries for the non-ISA interrupts as masked as
intended. Report by Christoph Egger.
2007-10-10 13:58:15 +00:00
joerg
0c403c87a2 Merge intr.c (1.29.8.2) and ioapic.c (1.19.8.5) changes from jmcneill-pm:
Always write entries to all IOAPIC pins. The first 16 pins are
threated as ISA IRQs by default, the others like PCI IRQs. This avoids
inconsistencies based on incomplete BIOS setups. This resulted in early
ACPI SCI notifications to be lost, effectively breaking the Embedded
Controller on cold start on many notebooks.

Don't special case the IOAPIC setup between ioapic_attach and
ioapic_enable, always setup the correct redirections. Depend on
splhigh/disable_intr to stop interrupts and don't keep them masked in
the IOAPIC. This avoids unacknowleged edge interrupts and fixing the problem
of broken PS/2 keyboard when hitting keys during early boot.
2007-10-07 14:23:42 +00:00
xtraeme
8b2678bd7e Use a two clause license for all the code I contributed.
The envsys code will be changed later.
2007-10-06 07:21:02 +00:00
joerg
f4fa1c68c7 Merge from mpacpi.h 1.4.32.1, acpi_machdep.c 1.13.22.5 and
mpacpi.c 1.48.12.2 from jmcneill-pm:

Don't process the MADT and modify the interrupt config at one moment and
later trying to figure out if an entry was overriden and matches the
ACPI SCI. This is brain-dead and breaks in various situations.

Just check for each ISA override entry, if it matches the SCI. If it
does, remember it and use it for the interrupt setup. If there's no such
override assume that it is not changed, but override the polarity and
level from ISA settings to PCI settings.
2007-10-06 04:39:10 +00:00
joerg
a544202cb5 Merge from jmcneill-pm: Close a small race in the IOAPIC setup.
When changing the redirection entry for an interrupt, write the
high 32bit first. The low 32bit contain the mask bit and removing
that before setting the destionation ID can lead to lost interrupts.
2007-10-06 04:37:06 +00:00
veego
0a0c1ae8c2 Add a debug printf (aprint_debug) when a erratum was patched. 2007-10-03 14:51:47 +00:00
ad
a06455d0e5 Now that the bootblocks are the same, share loadfile_machdep.h between
amd64 and i386.
2007-10-01 20:31:41 +00:00
joerg
c77ff03fed The ACPI SCI override is relative to the Source of the MADT entry,
so use bus_pin for the comparision. Tested by reinoud@.
2007-09-30 19:08:17 +00:00
ad
29d22f406e Update copyright. 2007-09-26 23:48:37 +00:00
ad
8c77c157eb Make it build in userspace again. 2007-09-26 20:59:59 +00:00
ad
9c412e0cbf x86 changes for pcc and LKMs.
- Replace most inline assembly with proper functions. As a side effect
  this reduces the size of amd64 GENERIC by about 120kB, and i386 by a
  smaller amount. Nearly all of the inlines did something slow, or something
  that does not need to be fast.
- Make curcpu() and curlwp functions proper, unless __GNUC__ && _KERNEL.
  In that case make them inlines. Makes curlwp LKM and preemption safe.
- Make bus_space and bus_dma more LKM friendly.
- Share a few more files between the ports.
- Other minor changes.
2007-09-26 19:48:34 +00:00
bouyer
ed46965916 Don't attach ipmi if GETID failed. From Nicolas Joly. 2007-09-23 19:17:51 +00:00
ragge
e515d580df i386 -> __i386__ 2007-09-16 18:37:34 +00:00
skrll
2d9c4abfb1 Always provide __cpu_simple_lock_{set,clear}.
Fixes LOCKDEBUG kernel builds.
2007-09-11 21:01:40 +00:00
skrll
9fdaf800d9 Merge nick-csl-alignment. 2007-09-10 11:34:05 +00:00
cube
c725329722 Remove 3rd clause and my name from all the licences which were only in my
name.
2007-09-10 10:35:51 +00:00
xtraeme
b1d137e8f4 Improve some comments. 2007-09-03 03:35:00 +00:00
ober
2689a1e1e8 Attach to ICH8M LPC.
Tested watchdog and it works.
ok xtraeme@
2007-09-01 21:52:06 +00:00
ad
68ee7ce6f5 amd64 doesn't have opt_noredzone.h. Just test DIAGNOSTIC instead. 2007-08-30 11:32:09 +00:00
ad
fbb58ada61 Merge most x86 changes from the vmlocking branch, except the threaded soft
interrupt stuff. This is mostly comprised of changes to the pmap modules to
work on multiprocessor systems without kernel_lock, and changes to speed up
tlb shootdowns.
2007-08-29 23:38:01 +00:00
dyoung
cdffb92c2f Add interrupt stack "red zones". Reserve and unmap the virtual
pages immediately above and below the x86 interrupt stack so that
both an overgrown interrupt stack and other faults produce a page
fault trap.  Condition this on the historical option NOREDZONE,
for now.
2007-08-29 22:21:51 +00:00
dyoung
ecfdd24019 Use __arraycount(). 2007-08-29 22:14:00 +00:00
xtraeme
ef90294f8c Attach to the ICH9 LPC Interface Bridges. The datasheet doesn't mention
any difference in the TCO part (compared to ICH[678]).
2007-08-29 12:54:05 +00:00
xtraeme
8f56f00890 Fix typo in rev 1.26: alldev -> alldevs. 2007-08-27 14:41:03 +00:00
xtraeme
c463a1309e Fix the $NetBSD$ tag in __KERNEL_RCSID(). 2007-08-27 14:39:19 +00:00
dyoung
c778648a34 Use TAILQ_FOREACH(). 2007-08-27 14:35:09 +00:00
xtraeme
031bec6d2c Some changes for the ichlpcib driver:
- Moved to x86/pci, so that EM64T systems running NetBSD/amd64 can use it.
- Added support for the TCO on ICH6 or newer chipsets, adapted from
  FreeBSD.
- Added timecounter support for the power management timer, adapted from
  OpenBSD.
- Plus some misc/cosmetic changes.

Thanks to yukonbob on irc@freenode for testing the TCO part on ICH4-M.
Tested by me with ICH7 too.
2007-08-26 16:49:47 +00:00
briggs
b53262281a Check for duplicate sensor names in the IPMI table. If a duplicate name
is found, try to make it unique by appending a count (1-99) to the sensor
description (truncating, if necessary).  This takes my Dell PowerEdge 1800
from:
        Temp:     40.000 degC
  VRD 1 Temp:     35.000 degC
  VRD 0 Temp:     39.000 degC
 Planar Temp:     35.000 degC
Ambient Temp:     20.000 degC
       Fan 2:       1500 RPM
       Fan 1:       1425 RPM
CMOS Battery:      3.057 V
   Intrusion:         ON
     Status :         ON

to:
       Temp3:     40.000 degC
       Temp2:     40.000 degC
  VRD 1 Temp:     35.000 degC
  VRD 0 Temp:     39.000 degC
 Planar Temp:     35.000 degC
Ambient Temp:     20.000 degC
       Temp1:     41.000 degC
        Temp:     43.000 degC
       Fan 2:       1500 RPM
       Fan 1:       1425 RPM
CMOS Battery:      3.057 V
   Intrusion:         ON
    Status 1:         ON
     Status :         ON
2007-08-13 18:32:22 +00:00
joerg
1c929a1104 Print the polarity and trigger flags as well. Can help with debugging
on fancy notebooks.
2007-08-10 14:34:56 +00:00
ad
eb5991fdda x86_ipi: don't wait for the IPI to go, unless DIAGNOSTIC. If it doesn't go,
the system is going to fail regardless.
2007-08-07 11:28:26 +00:00
ad
4f5723ab5d Add a couple more calls to pmap_update(). 2007-08-07 11:25:40 +00:00
simonb
3696d5ed67 If an EST frequency table isn't found, fake one up by interpolating
values from the high/low voltages and frequencies.  Replaces the old
method of using the lower and upper frequencies only.
2007-08-06 03:38:49 +00:00
mjf
a1e23633a9 Remove newline from format string of aprint_normal.
Thanks to pooka@ for pointing it out.
2007-07-22 23:45:50 +00:00
mjf
58b2412ea3 s/aprintf_normal/aprint_normal 2007-07-19 14:07:10 +00:00
mjf
ce43347321 Change printf to aprintf_normal and add a newline as requested by Christoph Egger on port-xen. 2007-07-19 13:31:26 +00:00
njoly
03ccc07594 Display RDTSCP bit on AMD processors (Read Serialized TSC Pair).
ok by xtraeme
2007-07-11 11:56:36 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
tsutsui
69dbd2e45e Move x86 common cpu_counter functions into <x86/cpu_counter.h>. 2007-07-07 17:38:26 +00:00
bouyer
7135c1aad2 Start with all sensors in ENVSYS_SINVALID state, and switch to ENVSYS_SVALID
(or other, depending on result) once the sensor has been read.
This way envstat(8) won't show sensors which have not yet their correct value.
2007-07-04 17:36:17 +00:00
xtraeme
d3cbee92fb ipmi_sensor_status: if state is ok return ENVSYS_SVALID and not
ENVSYS_WARN_OK, the latter is deprecated on envsys2.
2007-07-03 23:13:12 +00:00
briggs
c42d6c37ad Use PRIx64 for a 64-bit quantity instead of llx in a debug print. 2007-07-03 22:58:07 +00:00
christos
2d14013f2c Support for VIA Esther (From FreeBSD) 2007-07-03 17:07:54 +00:00
xtraeme
dcbea1b1dc - On Intrusion sensors, if something is not ok return a critical event.
- On Power Supply sensors:
	* if power supply is not installed, return a critical event.
	* if power supply is installed but not powered on, return a
	  warnover event.
2007-07-02 15:29:47 +00:00
xtraeme
41fe337f40 Add support for the VIA C7-M and Eden processors in the
Enhanced Speedstep driver.

Tested by Heron Gallegos <gallegos at csxxi dot net dot mx>
2007-07-01 20:12:35 +00:00
xtraeme
da3f163bd2 Imported envsys 2, a brief description of the new features:
(Part 2: drivers)

* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
  and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
  sysmon_power(9) and powerd(8), that means there is no 32 bytes event
  size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.

Tested by:

blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
2007-07-01 07:37:12 +00:00
dyoung
1ee8f4a418 Extract common code from i386, xen, and sparc64, creating
config_handle_wedges() and read_disk_sectors().  On x86, handle_wedges()
is a thin wrapper for config_handle_wedges().  Share opendisk()
across architectures.

Add kernel code in support of specifying a root partition by wedge
name.  E.g., root specifications "wedge:wd0a", "wedge:David's Root
Volume" are possible.  (Patches for config(1) coming soon.)

In support of moving disks between architectures (esp. i386 <->
evbmips), I've written a routine convertdisklabel() that ensures
that the raw partition is at RAW_DISK by following these steps:

        0 If we have read a disklabel that has a RAW_PART with
          p_offset == 0 and p_size != 0, then use that raw partition.

        1 If we have read a disklabel that has both partitions 'c'
          and 'd', and RAW_PART has p_offset != 0 or p_size == 0,
          but the other partition is suitable for a raw partition
          (p_offset == 0, p_size != 0), then swap the two partitions
          and use the new raw partition.

        2 If the architecture's raw partition is 'd', and if there
          is no partition 'd', but there is a partition 'c' that
          is suitable for a raw partition, then copy partition 'c'
          to partition 'd'.

        3 Determine the drive's last sector, using either the
          d_secperunit the drive reported, or by guessing (0x1fffffff).
          If we cannot read the drive's last sector, then fail.

        4 If we have read a disklabel that has no partition slot
          RAW_PART, then create a partition RAW_PART.  Make it span
          the whole drive.

        5 If there are fewer than MAXPARTITIONS partitions,
          then "slide" the unsuitable raw partition RAW_PART, and
          subsequent partitions, into partition slots RAW_PART+1
          and subsequent slots.  Create a raw partition at RAW_PART.
          Make it span the whole drive.

The convertdisklabel() procedure can probably stand to be simplified,
but it ought to deal with all but an extraordinarily broken disklabel,
now.

i386: compiled and tested, sparc64: compiled, evbmips: compiled.
2007-06-24 01:43:34 +00:00
dsl
b4e499e58b Split x86_set/get_ldt() so they are callable with kernel buffers.
For linux emulation code.
2007-06-23 15:22:18 +00:00
xtraeme
dfa04859c6 Add four missing bits for CPUID2_FLAGS, from FreeBSD. 2007-06-04 16:21:29 +00:00
xtraeme
699c85af09 Make the Enhanced Speedstep driver available for i386 and amd64.
To use it on EM64T CPUs supporting the EST CPUID feature. Note that
some CPUs still don't work with this driver, like Xeon or Pentium 4.

Move the p[34]_get_bus_clock functions into its own file,
intel_busclock.c and remove this code from i386/identcpu.c.

Tested on i386 by myself and amd64 by Tonerre.
2007-06-03 19:32:26 +00:00
yamt
f03010953f merge yamt-idlelwp branch. asked by core@. some ports still needs work.
from doc/BRANCHES:

	idle lwp, and some changes depending on it.

	1. separate context switching and thread scheduling.
	   (cf. gmcgarry_ctxsw)
	2. implement idle lwp.
	3. clean up related MD/MI interfaces.
	4. make scheduler(s) modular.
2007-05-17 14:51:11 +00:00
xtraeme
efc6c2a0b8 cosmetic: use a single line for the global vars of same type. 2007-05-15 14:29:36 +00:00
christos
219dcac37d Fix compilation when NIOAPIC == 0 2007-04-28 14:51:58 +00:00
ad
9e3116ecc8 Fix error in previous. 2007-04-16 19:25:04 +00:00
ad
10c8708a61 + x86/sysarch.h 2007-04-16 19:16:36 +00:00
ad
8aefa8aa0c Share the sysarch stuff between the x86 ports. PR kern/36046. 2007-04-16 19:12:17 +00:00
bouyer
3b515a1a65 Fix previous: don't AcpiOsFree() twice if the device is valid. 2007-04-10 12:15:27 +00:00
bouyer
5673f3baf8 Properly skip inactive devices; avoids a panic in pci_make_tag() later.
Thanks to cube@ for the idea.
An ACPI kernel can now boot on a poweredge 2950.
2007-04-08 21:35:21 +00:00
xtraeme
613ec69fb1 k8_powernow_destroy: free k8pnow_current_state rather than cstate,
and remove the global cstate struct.
2007-04-05 21:23:43 +00:00
rmind
f49599932b k8_powernow_init_main: Initialize k8pnow_current_state. 2007-04-04 02:56:25 +00:00
rmind
0dbab2d2b2 clockmod_sysctl_helper: For the sake of clarity - avoid magic number.
No functional change.
2007-04-04 01:50:15 +00:00
xtraeme
02e5ad5584 Initialize msr_read explicitly to avoid a hang, from FUKUMUTO Atsushi. 2007-04-03 07:56:08 +00:00
tls
ff577890f0 Revert revision 1.6: with a -current GENERIC.MP kernel we cannot reproduce
the TLB shootdown IPI storms on any of the machines in question.
2007-03-25 20:49:05 +00:00
xtraeme
aeee45c69c Explicitly initialize msr. 2007-03-25 02:44:29 +00:00
xtraeme
8340d8f47f typo. 2007-03-25 02:41:53 +00:00
xtraeme
8cd29f0e64 Add another member to struct cpu_msr_broadcast, msr_read that will
enable the rdmsr call in msr_write_ipi(), so that when it's not
defined we don't read it before writing; disabled in powernow_k8
and enabled in the others.
2007-03-25 02:27:16 +00:00
xtraeme
0a3943cb24 * Remove the WRITE_FIDVID macro from powernow.h and use it in in the
powernow_k8 driver (much better than undeffing and write it again).
* Fix the WRITE_FIDVID macro, I changed it to use the third argument
  for the bitmask, but it's not correct.

Last change should fix the problem reported by FUKUMOTO Atsushi.
2007-03-24 15:35:15 +00:00
xtraeme
bd90d620b9 Add missing $ in the RCS ID. 2007-03-21 23:24:58 +00:00
xtraeme
5b08a540fa static'ify. 2007-03-21 22:52:14 +00:00
xtraeme
4535c92912 Remove the MSR read IPI handler from X86_IPI_NAMES and use the
correct number in X86_NIPI.
2007-03-21 22:23:15 +00:00
xtraeme
ef049074f2 Remove unneeded headers. 2007-03-21 21:56:52 +00:00
xtraeme
6e5117d74f typo 2007-03-21 18:28:26 +00:00
xtraeme
6ae05af027 - Remove ci_msr_rvalue, it's not useful anymore as yamt@ pointed out.
- Remove completely debug from msr_ipifuncs, now it's known to work.
2007-03-21 18:20:59 +00:00
xtraeme
14d38361d8 Disable debug. 2007-03-21 06:50:36 +00:00
xtraeme
bfde31a42f Remove the MSR read IPI handler, there won't be any driver that will
use it, and we can see if the values are ok in the CPUs in the write
operation.

Suggested by YAMAMOTO Takashi.
2007-03-21 06:36:42 +00:00
xtraeme
91829be711 There's no need to use MSR_CPU_BROADCAST_READ in clockmod_getstate(),
because clockmod_setstate() will do it for us.
2007-03-21 05:27:49 +00:00
xtraeme
00974998e3 Use the CPUID2STEPPING macro. 2007-03-21 04:17:59 +00:00
xtraeme
5da15c6409 Do not use cpu_id and cpu_feature, they are not available for i386
(or have different types), use CPUID.
2007-03-21 04:01:59 +00:00
xtraeme
545c3b7ca9 Don't build msr_ipifuncs on Xen, fixes the build with XEN2_DOM0. 2007-03-21 00:16:52 +00:00
xtraeme
28050fc1b5 Driver for Intel Thermal Monitor (feature TM) On-Demand Clock
Modulation.

This works by changing the duty cycle of the clock modulation,
and saves power and helps to not increase the temperature by
software.

Adapted from OpenBSD/FreeBSD's p4tcc.

To enable it one must use "options INTEL_ONDEMAND_CLOCKMOD".

Tested by me in UP and SMP, ok'ed by Matthew R. Green.
2007-03-20 21:22:03 +00:00
xtraeme
4b852b5e23 Use the new MSR IPI handlers to make it work properly with SMP. 2007-03-20 21:13:06 +00:00
xtraeme
32b7185652 MSR read and write IPI handlers for x86. A MSR will be read or written
in all CPUs available in the system. This adds another member
to struct cpu_info, ci_msr_rvalue; it will contain the value of the MSR
in a previous operation.

Tested with clockmod in UP and SMP by me, tested with est in SMP
by Daniel Carosone and Michael Van Elst.

Ok'ed by Andrew Doran and Matthew R. Green.
2007-03-20 21:07:38 +00:00
drochner
2d9e04fc35 Import DRM drivers, brought into shape by Yorick Hardy, posted to tech-x11.
Minor modifications by me:
-use an mi device major number
-(coarsly) divided into pci card specific and less specific parts, moved
 the latter to dev/drm
-renamed autoconf attributes to reflect this
Todo:
-adapt all card frontends but i915 to drm include file location
-review the mtrr change
-make the change to agp_i810.c coexist with the fix for buggy VESA
 BIOSes which is commented out temporarily
-RCS IDs etc style stuff
-LKM support (rescan support for vga)
-test
2007-03-20 18:05:25 +00:00
xtraeme
5dbf7fbdf5 Forgot to initialize cstate, make it global and static. Fixes
build problem with the LKM.
2007-03-18 14:30:54 +00:00
xtraeme
0959735d30 Fix previous, sync prototypes and missing curcpu(). 2007-03-18 07:56:01 +00:00
xtraeme
90872da93f Don't write same code when there's an error, just use the goto
statement.
2007-03-18 07:40:29 +00:00
xtraeme
3599c78870 Fix mem leak in k8_powernow_destroy, when it's called multiple times.
Found by mrg@.

Also, make sure they have data before trying to free them.
2007-03-18 07:23:53 +00:00
xtraeme
efd5228a6f There's no need to run est_init or k8_powernow_init on each CPU.
Just run it once (in the first cpu probed) with the RUN_ONCE(9)
framework.

Change the argument of est_init and k8_powernow_init to void, we don't
need cpu_info * anymore.

Suggested by tls@ and mrg@.
2007-03-18 07:21:40 +00:00
xtraeme
5ec1f7a202 Change k8_powernow_init to accept a struct cpu_info * as argument,
so that in the informative messages it prints the correct cpu
and not curcpu().

This fixes the first part of PR kern/35676.
2007-03-18 04:41:03 +00:00
xtraeme
3f5d332ca6 Ok... there were people really angry with this, backing it out. 2007-03-15 00:28:57 +00:00
xtraeme
76460a0e78 Add a driver for the Pentium 4 and later models with feature TM
(Thermal Monitor).

This driver will throttle the CPU clock modulation, saving some
power, also known as ODMC (On Demand Modulation Clock).

The processor can change from 12.5% to 100% (there are two erratas,
so two levels might be skipped in the worst case).

If supported, you'll see the following sysctl sub-tree:

machdep.p4tcc.throttling.target: CPU Clock throttling state (0 = lowest, 7 highest)
machdep.p4tcc.throttling.current: current CPU throttling state
machdep.p4tcc.throttling.available: list of CPU Clock throttling states

machdep.p4tcc.throttling.target = 2
machdep.p4tcc.throttling.current = 2
machdep.p4tcc.throttling.available = 7 6 5 4 3 2

Adapted from OpenBSD/FreeBSD.
2007-03-15 00:03:24 +00:00
ad
b119e95aab Include sys/simplelock.h, not lock.h. 2007-03-12 18:34:22 +00:00
christos
b127b0cff4 more caddr_t lossage 2007-03-11 18:37:46 +00:00
yamt
a36286ca6a multiple inclusion protection. 2007-03-06 12:32:46 +00:00
drochner
d880082522 clean up how cpus and ioapics are attached at the mainbus:
Seperate "cpubus" and "ioapicbus" -- while they share a common "address
space" (the apic id), the kernel doesn't use this fact. There are different
data passed to cpus and apics, which caused some ugly polymorphism. This
also saves the special "submatch" functions needed to distingush cpus
and ioapics for autoconf. (And it makes that "apid" locators wired
in the kernel configuration are honored now; this allows one to dumb down
an mp box to singleprocessor by userconfig.)
Print "apid" locators in the buses "print" function "as everyone does",
so the per-port cpu drivers don't need to do it.
Being here, constify "struct cpu_functions" and g/c the unused MP_PICMODE
flag.
2007-03-05 16:50:59 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
yamt
71380e5a2f check_pa_acc: don't bother to use KAUTH_MACHDEP_UNMANAGEDMEM
if the address is known.
no functional changes, unless listeners do some kind of logging.
2007-03-01 11:49:26 +00:00
matt
2d58947dff Add missing initializer for _tag_needs_count 2007-02-22 04:58:26 +00:00
thorpej
712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
mrg
4410329b87 add a pair of new bus_dma(9) functions:
int _bus_dmatag_subregion(bus_dma_tag_t tag,
				  bus_addr_t min_addr,
				  bus_addr_t max_addr,
				  bus_dma_tag_t *newtag,
				  int flags)
	void _bus_dmatag_destroy(bus_dma_tag_t tag)

that allow a (normally broken/limited) device to restrict the bus address
range it can talk to.  this is used by bce(4) to limit DMA addresses to
1GB range, the maximum the chip can address.

all this is from Yorick Hardy <yhardy@uj.ac.za> with input from several
people on tech-kern.

XXX: bus_dma(9) needs an update still.
2007-02-21 20:41:23 +00:00
daniel
c339e55881 Add an opencrypto provider for the AES xcrypt instructions found on VIA
C5P and later cores (also known as 'ACE', which is part of the VIA PadLock
security engine). Ported from OpenBSD.

Reviewed on tech-crypto and port-i386, no objections to commiting this.
2007-02-17 00:28:23 +00:00
ad
3363855a4a Remove spllowersoftclock() and CLKF_BASEPRI(), and always dispatch callouts
via a soft interrupt. In the near future, softclock will be run from process
context.
2007-02-16 02:53:43 +00:00
ad
087fdb9080 Count the number of CPUs at boot and stash in 'ncpu'. Eventually should
have each CPU register at attach, so we can figure out the topology for
the scheduler.
2007-02-15 20:32:47 +00:00
ad
c2c74a2fbe Don't establish an interrupt handler at IPL_VM, use IPL_TTY instead. 2007-02-15 18:18:21 +00:00
ad
9abeea588a Replace some uses of lockmgr() / simplelocks. 2007-02-15 15:40:50 +00:00
ad
5df226f2ad NSPR builds seem to choke on 'inline'. Replace it with __inline. 2007-02-10 16:19:39 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
jmcneill
d6775f8b6c On Xbox, disallow pci_conf_read/pci_conf_write calls for bus 0 device 0
functions 1 and 2.
2007-02-06 03:13:37 +00:00
ad
fb574ffdbf The TLB flush filter workaround causes TLB shootdown storms on our build
machines. Disable it for now until that problem is solved.
2007-02-05 21:05:45 +00:00
christos
b5b1a9d57c Merge the int bit with the high fraction bit. Add constants/macros
needed by gdtoa.
2007-02-02 23:07:44 +00:00
rpaulo
f8716dbbb5 Don't panic with "lazy bum". I have a machine that can boot multiuser
and run on SMP with this panic commented out.
No replies on tech-kern about this.
2007-01-26 12:44:50 +00:00
hubertf
142c2a33ba Remove duplicate #includes, patch contributed in private mail
by Slava Semushin <slava.semushin@gmail.com>.

To verify that no nasty side effects of duplicate includes (or their
removal) have an effect here, I've compiled an i386/ALL kernel with
and without the patch, and the only difference in the resulting .o
files was in shifted line numbers in some assert() calls.
The comparison of the .o files was based on the output of "objdump -D".

Thanks to martin@ for the input on testing.
2007-01-24 13:08:11 +00:00
christos
ae8983cebf PR/35430: Izumi Tsutsui: Identify amd64 CPU on NetBSD/i386 2007-01-16 15:43:44 +00:00
ad
d0a255a895 On second thought, implement x86_pause() as a regular function. The small
delay from the call is useful for spinlock backoff.
2007-01-14 14:03:00 +00:00
ad
c1e9dad747 x86_errata: correct the definition of MSR_HWCR and re-enable. Problem
noted and debugged by Murray Armfield (murray at river-styx.org).
2007-01-11 17:24:30 +00:00
jmcneill
afcfbdad8b On the Xbox, prevent scanning past the first device on bus 1. 2007-01-05 17:53:53 +00:00
jmcneill
e619988ed2 Allow xboxfb to attach and initialize the display early in the boot process. 2007-01-05 04:13:09 +00:00
jmcneill
fa9fc940ce xboxfb is a possible candidate for the console screen, from Andrew Gillham 2007-01-05 02:39:50 +00:00
ad
8ca9bfb9b5 - Don't print any specifics unless booted with -d.
- Disable for now, at least one model of CPU throws a GPF.
2007-01-02 16:57:54 +00:00
ad
e3603e4e86 Cut size of tables slighty. 2007-01-01 21:03:26 +00:00
ad
75b6baf536 Oops, issue a warning only once. 2007-01-01 21:00:13 +00:00
ad
fb7fd24980 Report on and where possible, try to work around some of the known errata
for Athlon 64 and Opteron processors. Tested briefly by cube@ and elad@.
2007-01-01 20:56:58 +00:00
ad
e96fca7884 Define ipl_t as uint8_t so that it can be packed into a word with a lock
byte. Ok yamt@.
2006-12-26 15:22:44 +00:00
elad
504c71d9fe Make machdep scope architecture-agnostic by removing all arch-specific
requests and centralizing them all. The result is that some of these
are not used on some architectures, but the documentation was updated
to reflect that.
2006-12-26 10:43:43 +00:00
yamt
8bf7662829 merge yamt-splraiseipl branch.
- finish implementing splraiseipl (and makeiplcookie).
	  http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
	- complete workqueue(9) and fix its ipl problem, which is reported
	  to cause audio skipping.
	- fix netbt (at least compilation problems) for some ports.
	- fix PR/33218.
2006-12-21 15:55:21 +00:00
christos
03f66b5764 Moved from i386/pci/agp_machdep.c; from Blair Sadewitz 2006-12-18 12:11:33 +00:00
ad
f48eb2511b __cpu_simple_unlock(): add a note about memory ordering and why this is
correct, contrary to Intel's documentation.
2006-12-18 07:34:42 +00:00
yamt
98cfc473c8 - pass intrframe by-pointer, not by-value.
- make i386 and xen use per-cpu interrupt stack.

xen part is reviewed by Manuel Bouyer.
2006-12-08 15:05:18 +00:00
elad
4b316db1d1 Introduce KAUTH_REQ_MACHDEP_{ALPHA,X86}_UNMANAGEDMEM to handle access
to unmanaged memory.

These are the last two securelevel references in the MD code.
2006-11-22 12:12:51 +00:00
christos
168cd830d2 __unused removal on arguments; approved by core. 2006-11-16 01:32:37 +00:00
christos
eeedf4b2c2 convert variable allocation to constant. 2006-11-10 18:15:12 +00:00
elad
eddfaaf54c Move i386/amd64 common code (check_pa_acc()) to x86.
I didn't know what header to put the prototype in, so it's both in
i386/mem.c and amd64/mem.c; probably can be moved later.

Tested on amd64, assumed working on i386. :)

yamt@ okay
2006-10-30 00:41:26 +00:00
hannken
a92696acd1 More __unused (NPCPPI == 0 case). 2006-10-13 10:09:36 +00:00
dogcow
64d163c11c de-__Pify, ANSIfy, and add __unused where necessary. 2006-10-12 19:28:47 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
cube
886e1e7f71 Fix thinko about CPUID(0x80000000). 2006-10-08 15:51:30 +00:00
dogcow
1d235c3fdc add initializers so gcc stops whining. 2006-10-06 03:52:53 +00:00
yamt
199c49bccb handle_wedges: fix a typo. (NOCREAD -> NOCRED) 2006-10-06 02:29:08 +00:00
martin
fab4ae4892 I can not test this right now, but the equivalent change was needed on
sparc64 to make root on raid shutdown cleanly: after using opendisk()
and querying wedges, we need to VOP_CLOSE() the resulting vnode.
2006-10-05 22:43:35 +00:00
cube
c72f004e7c Rework the way PowerNow! and Cool'n'Quiet features are detected and
displayed, to make the code much simpler and easier to follow.  Also, use
bitmask_printf() to make output consistent with other stuff.  Use
CPUID2FAMILY() where appropriate.
2006-10-04 13:18:10 +00:00
bouyer
020e3d1ae1 Add ipmi(4) driver, from OpenBSD. This requires SMBios support, so add
SMBios detection and mapping to bios32.c, also from OpenBSD (for now this
is only compiled in if ipmi(4) is configured). The sensors and watchdog are
accessible though envsys(4).
Works on i386; some work is needed on amd64 to access the BIOS. It would
eventually work on Xen if the SMBios is accessible (to be tested).
2006-10-01 18:37:54 +00:00
martin
ebaf1420c5 If using NLAPIC, we better include lapic.h. Pointed out by Kurt Schreiner
on current-users.
2006-09-29 11:18:44 +00:00
bouyer
e2d271e26c - make it possible to have ACPI without IOAPIC and/or LAPIC
- make it possible for machine-specific code to provide custom R/W routines
  in its i82093*.h headers
- always initialize sc->sc_pins[pin], even in the !ioapic_cold case.
No objections on port-i386 and port-amd64.
2006-09-28 18:01:24 +00:00
cube
4a5ad09e72 This is again that time of the millenium where we have to crank up a few
static limits to meet modern bloat requirements.

VM_PHYSSEG_MAX needs it to run on Intel's D946GZIS motherboard, as reported
by rix on #NetBSD-code on freenode.  This has a consequence on the initial
number of possible extent allocations for iomem_ex, so increase that value
too.

While there, clarify the action to be taken when VM_PHYSSEG_MAX is maxed
out.

Do that on both amd64 and i386 because the causes, the effects and the code
are mostly the same.
2006-09-27 17:10:34 +00:00
xtraeme
6308f92920 Protect opt_powernow_k7.h with ifdef i386, I forget that it's only
available on i386...
2006-09-23 18:43:56 +00:00
fvdl
807fde634b While the low-level trigger and polarity values are the same for
ACPI and MPS, the ACPICA values are different. Convert them,
so that we get the right values into the ioapic.
2006-09-23 17:16:38 +00:00
fvdl
437e91d597 Check for the bad irq0 override quirk. 2006-09-23 17:08:43 +00:00
xtraeme
5e0b4be127 Do not use the TSC in POWERNOW_K[78] case (same behaviour than
enhanced speedstep), closes PR port-amd64/34550.
2006-09-23 16:18:06 +00:00
gdamore
229365fda3 Use common todr_settime_ymdhms/gettime_ymdhms.
While here, fix an incorrect test for timeset (that's in kern_todr already),
and an incorrect to time_second (instead of using the date passed in).
2006-09-07 00:18:50 +00:00
gdamore
a37acb1b52 Remove unused todr_setcal/todr_getcal and all the assorted stub
implementations.
2006-09-04 23:45:30 +00:00
perry
e2420ca184 Undo static declaration on gettick -- lapic.c uses it.
Pointed out by Geoff Wing (mason at primenet.com.au)
2006-09-04 03:07:52 +00:00
perry
225449e795 switch to a common clock.c 2006-09-04 02:16:03 +00:00
christos
0b7c79ac7b add missing initializers 2006-09-03 07:00:48 +00:00
xtraeme
7658c6d89f Update the enhanced speedstep driver and sync the code with OpenBSD:
est.c:

* Use a quintuplet (vendor, MHz_hi, mV_hi, MHz_lo, mV_lo } to match
  CPUs more correctly than parsing the brand string.
* Add support for a bunch of models.
* Create a fake table on the fly if the CPU is unknown (there's no
  table for it) with the current/highest/lowest frequency.

specialreg.h:

* Add some MSRs needed to get the bus clock value.

identcpu.c:

* Add functions specific to Pentium III, Pentium M and Pentium 4 to
  get the bus clock value.

Note that the new fake table code from Simon Burge is not included on
this commit.

Ok'ed by simonb and dogcow.
2006-09-03 06:49:57 +00:00
christos
d5d864694f avoid empty else. 2006-09-03 04:55:30 +00:00
xtraeme
1d143cb5ae - Remove k8pnow_read_pending_wait() and use a macro that _always_
will wait for the bit pending wait to be cleared. When this bit is
  cleared the CPU is ready to enter to new processor state. [1]
- Remove useless comments.
- Sync boot messages with est.c

[1] Macro taken from FreeBSD.

And new changes tested by elad.
2006-09-02 11:00:52 +00:00