Commit Graph

376 Commits

Author SHA1 Message Date
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