File: README

package info (click to toggle)
set6x86 1.5-8
  • links: PTS
  • area: main
  • in suites: woody
  • size: 164 kB
  • ctags: 50
  • sloc: ansic: 461; makefile: 51; sh: 49
file content (354 lines) | stat: -rw-r--r-- 12,448 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354

			set6x86 / get6x86 / 6x86_reg
			----------------------------

Please read through this file before attempting to use the programs in this
package. 
It might save you a few crashes.

Description
-----------

Set6x86 and get6x86 are two programs that allow you to poke and peek into
the Cyrix/IBM/SGS-Thomson 6x86 CPU's configuration registers. 6x86_reg will
display register contents in human-readable format. The short source
test_bug is a demo program for the 6x86 "coma" bug.

Cyrix CPUs
----------

Cyrix 6x86 CPU's are Intel Pentium-like performance CPUs, but at a lower
cost than their Intel parts. Cyrix has adopted a CPU rating that refers to
"equivalent Pentium performance in Windows applications" for their CPUs.

A Cyrix-6x86 P133+ for example is clocked at only 110 MHz, although it
performs as good as a Pentium 133 (hence the "P133+" rating). The "+" is a
marketing gadget: it is supposed to point out that it's even a little better
than a P133 on the Winstone benchmark.

6x86 CPUs come at a significantly lower price than their equivalent Intel
cousins. The only downsides are:

	- a lack of support from several motherboard vendors and software vendors
	  (most CPU identification programs, Linux 2.0's /proc/cpuinfo
	  included, report a 486 CPU instead of a Cyrix 6x86). A short patch
          is available from http://www.tux.org/~balsa/linux/cyrix that
          solves this kernel shortcoming.
	  
	- Floating point performance is not as good as a Pentium. Depending
	  on the benchmark, 15 to 50% lower FPU performance can be expected.

	- This baby needs HUGE amounts of power. People used to make fun of
	  the newest Digital chip, the Alpha, a few years ago, because it
	  needed over 20 Watts of power. Well, this one too. Depending on
	  the clock speed, up to 24 Watts of power is dissipated from the
	  package!

	  Anyone familiar with hardware design can tell you that keeping
	  that under control is not a simple task. That is also the main
	  reason why so many people flush newsgroups with messages that the
	  6x86 CPU's are bad, don't run Win95, crash all the time,...
	  
	  Do you really think those companies would even _risk_ making a CPU
	  that is not as compatible as possible? The only thing they didn't
	  replicate was the ominous Pentium FPU bug ;-)

          On the other hand Cyrix 6x86 CPUs suffer from another bug, called
          the 6x86 "coma" bug. The short program test_bug is an example of
          how this bug affects 6x86 CPUs.
	  
	  The _real_ reason for crashes and system hangs in most cases is
	  either a temperature problem, or a digital timing problem (the
	  latter being caused by the former in many cases). Poorly cooled
	  CPU's tend to go beyond their specified ratings. Most CPUs are
	  only guaranteed to work up to 70 degrees Celsius, and with 24
	  Watts to sweat out from such a small surface, that's _very_ easily
	  exceeded.


Why this program?
-----------------

For fun, mostly.

But also for some pretty darn good reasons. Most motherboards (mine, a
Chaintech board based on the Intel Triton II chipset) support 6x86 CPUs, but
not as well-tested and well-set-up as Pentium CPUs.

The 6x86 has a set of configuration registers that allows one to do a lot of
things, like specifying non-cacheable memory areas (important for e.g.
graphics cards), I/O delays, cache write policy (WB/WT), and also to enable
an automatic standby mode where a CPU "halt" instruction cuts down power by
a factor of 70 (from 5.8 Amps to 83 milli-Amps for the P133+).

Since most computers do nothing most of the time, this would be useful to
enable.

Linux uses the halt instruction when it has nothing better to do, so
enabling this feature will _not_ hurt performance: the CPU controls the
powering-down of specific internal parts by hardware-control, so there's no
software intervention needed for explicitly re-enabling a powered-down part.

However, some Linux users have reported that their systems would hang if
this feature was enabled and some bus-mastering Ethernet cards were used, in
some specific circumstances and only with some motherboards/chipset/BIOS
combinations! So even this seemingly inocuous feature should be tested on
individual systems.


Benefits?
---------

Apart from the obvious environmental reasons, there's also the temperature
problem that is reduced substantially.

If you're on a P133+ and programming like hell, or reading mail, or most of
the other things you do in Linux (or any other OS for that matter), the CPU
is doing nothing 99% of the time (just take an occasional look at the system
load meter).

When not set for automatic power-down, the CPU will _always_ draw its full
24 Watts of power. With this feature enabled, power consumption drops to
near-zero most of the time.

While I'm typing this doc, my CPU is (again) 99% idle, so now the CPU uses
only 0.3 Watts instead. That's one _hundreth_ of its full juice.

No need to say that most thermal problems are history. 

In fact, I had _lots_ of spurious core dumps and "signal 11" messages from GCC
on my system, and I always suspected temperature problems. With auto-suspend
mode on, I haven't had a single core dump since (but I haven't done a lot of
testing either).

This convinced me that I will have to provide better cooling for the CPU.


DANGER!!!
---------

Of course, you're fiddling with the guts of your CPU, while it's running. So
don't blame me if you accidently set the wrong register and your machine
hangs.

In other words, let's use the Paul Gortmaker (?) disclaimer:

	"If it breaks, you get to keep the pieces"
	

LITERATURE
----------

This package is completely useless without the proper docs from Cyrix and/or
IBM. I explicitly didn't include any description of the 6x86 config
registers because I didn't want to risk distributing faulty information.

Cyrix's WWW site (www.cyrix.com) and their FTP site (ftp.cyrix.com) contain
all the stuff you need. For ftp, all the files are in the "6x86" directory.

You need _at least_

	6X-ABDB.PDF   (361748 bytes)
	
which is the abbreviated data book, and contains a description of all the
registers you can tamper with (starting at page 18).

The full data book is

	6X-DBOOK.PDF  (2039298 bytes)

For the 5x86, the Cyrix FTP/WWW site may contain equivalent doumentation
(not checked).

Here's a list of WWW sites known to carry information on 6x86 CPUs:

  http://www.cyrix.com
  http://www.chips.ibm.com/products/x86/
  http://www.tux.org/~balsa/linux/cyrix/index.html
  http://www.alternativecpu.com


EXAMPLE:
--------

The power-saving option described above is controlled by register 0xC2, bit
3 of the configuration registers. Thus, 

	get6x86 0xC2

will display (on my system -- "your mileage may vary"):

	Cyrix 6x86 config register, index 194 (=0xc2) contains 128 (=0x80 =b10000000)

Note that bit 3 is set to zero, so the suspend-on-halt mode is disabled.

Typing

	set6x86 0xC2 0x88
	
will set bit #3 of that register, thus enabling the auto-suspend mode.


Simpler is to use the "-s" or "-c" options. These use the data byte on the
command line as a set/clear mask instead of raw data to program into the
register.

So the above can be made much more simple by just typing

	set6x86 0xC2 -s 0x08

This will read register 0xC2, and "set" bits using the mask given (0x08).

The "-s" does a logical "OR" of the original register data and the mask
data, and programs it back into the register, whilst the "-c" option will do
a logical "AND" with the inverse of the mask (0xF7 in this case).


The included rc.cyrix file enables a few performance-related thingies on the
Cyrix 6x86 CPU. Copy it to the /etc/rc.d directory, and call it from e.g.
rc.local (also included is a new rc.6x86MX for 6x86MX owners).

It is a good example of the use of set6x86 to set various different Cyrix 6x86
registers. It does a bit of everything.

6x86_reg
--------

This little tool dumps most relevant 6x86 registers in human-readable
format. It will also correctly identify the 6x86 model and revision, report
bogoMIPS ratings, and dump the more complex ARRs (Address Region Registers).
These are the registers where the different memory regions are set up and
how they are handled (e.g. if they're cached or if any other special
function is enabled for them).

Running it may reveal something like the output below:

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
6x86 (Classic/L/MX) Register Dump utility

6x86 DIR0: 0x52	2.5X core/bus clock ratio
     DIR1: 0x4	6x86MX Rev. 1.4

Wait a moment...
Calculated BogoMIPS:	185.12
Kernel BogoMIPS:	186.78

6x86 CCR0: 0x2	NC1 set (address region 640Kb-1Mb non-cacheable)
     CCR1: 0x92	NO_LOCK set
     CCR2: 0x88	SUSP_HLT set (low power suspend mode enabled)
     CCR3: 0x10
     CCR4: 0x87	no I/O recovery time
     CCR5: 0x21	allocate cache lines on write misses

6x86 Address Region Register dump:
  ARR0: address = 0xA0000 , size = 128 KB
    RCR = 0x9 : not cached, write gathering
  ARR1: address = 0xC0000 , size = 256 KB
    RCR = 0x1 : not cached
  ARR2: disabled
  ARR3: address = 0xA8000 , size = 32 KB
    RCR = 0x9 : not cached, write gathering
  ARR4: disabled
  ARR5: disabled
  ARR6: address = 0xE0000000 , size = 4 MB
    RCR = 0x9 : not cached, write gathering
  ARR7: address = 0x0 , size = 32 MB
    RCR = 0x9 : cached, write gathering
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This saves you a lot of fingering through the 6x86 data book :-)


BogoMIPS
--------

First of all you must understand that bogoMIPS are _not_ meant as a measure
of performance, but rather as an indicator that the 6x86 registers and the
BIOS settings for the chipset on your motherboard are correctly set.

That said, we can look at the three possible outcomes of running 6x86_reg:

1) The calculated bogoMIPS and the kernel bogoMIPS reading from
/proc/cpuinfo are approx. equal (+/- 1 bogoMIPS). This is the normal case on
a "quiet" system.

Note that on 6x86 family CPUs, bogoMIPS are approximately equal to the CPU
core clock rate.

For example:
	- a 6x86 PR166 should have a bogoMIPS rating of approx. 133, since
          its core will run at 133MHz (2 x 66.66MHz).

	- a 6x86MX PR233 at 187.5MHz (2.5 x 75MHz) should have a bogoMIPS
          rating of approx. 187.5.

2) The calculated bogoMIPS is much higher (> 10-15%) than the kernel
bogoMIPS. This indicates that your BIOS is not setting the 6x86 registers or
the chipset parameters for the L2 cache correctly, and that set6x86 has
remedied to this. Adjust your BIOS CMOS settings and/or upgrade the BIOS
flash EEPROM.

3) The calculated bogoMIPS is lower than the /proc/cpuinfo kernel reading:
your system load is impairing the bogoMIPS calculation done by 6x86_reg.


Fun?
----

You might even be able to _hear_ the difference!

Most computer power supplies only compensate higher power demands on the +5V
rail, resulting in an increase on the +12V rail when +5V power demand goes
up.

The CPU draws from the +5V rail, but the CPU fan uses +12V, so when the CPU
draws more power (due to CPU load), the CPU cooling fan will run a little
faster with higher supply voltages. The significant power consumption drop
when the CPU goes into power-suspend mode might cause a noticeable change in
the pitch of the buzzing fan sound!

On my system, I can now HEAR how busy it is...


The 6x86 Coma bug
-----------------

Compile and run the short bug demo program as a "normal" user (but unmount all
file systems before running it). Type Control-C to try and regain control:
nothing happens, right? Your 6x86 CPU is in "coma" mode. :-(

The 6x86 CPU effectively gets locked in an infinite loop, executing
back-to-back locked cycles and consequently unable to service any
interrupts, including attempts by root to kill the process. This is by all
means a serious security flaw in a multiuser OS like Linux.

This bug affects all 6x86 family CPUs.

Solution: enable the NO_LOCK bit with set6x86.


Support
-------

None. Your own intelligence and common sense should be enough. You may want
to take a look at the 6x86/Linux mini-HOWTO site for further info/updates:
http://www.tux.org/~balsa/linux/cyrix


DOS
---

DOS support was removed starting at version 1.4.


Author
------

Koen Gadeyne, koen.gadeyne@barco.com (please contact the maintainer below
first) 


New maintainer
--------------
Thanks Koen! I'll do my best with this "hot potato" :-)
Andrew D. Balsa, andrewbalsa@usa.net