do_fast_gettimeoffset and 6x86MX: oops

Andre Derrick Balsa (andrewbalsa@usa.net.nospam)
Mon, 03 Nov 1997 03:49:30 +0100


Hi there,

Problem
=======

I am having a repeatable oops with do_fast_gettimeoffset on my 6x86MX,
kernels 2.0.29, 0.30 and 0.31 (same oops):

Nov 2 20:33:26 dns1 kernel: divide error: 0000
Nov 2 20:33:26 dns1 kernel: CPU: 0
Nov 2 20:33:26 dns1 kernel: EIP: 0010:[do_fast_gettimeoffset+82/120]
Nov 2 20:33:26 dns1 kernel: EFLAGS: 00010046
Nov 2 20:33:26 dns1 kernel: eax: 00000000 ebx: fdaa90b0 ecx:
000026d1 edx: 00002710
Nov 2 20:33:26 dns1 kernel: esi: 0d50d434 edi: 00000000 ebp:
bffffba4 esp: 0171cf88
Nov 2 20:33:26 dns1 kernel: ds: 0018 es: 0018 fs: 002b gs: 002b
ss: 0018
Nov 2 20:33:26 dns1 kernel: Process innd (pid: 401, process nr: 34,
stackpage=0171c000)
Nov 2 20:33:26 dns1 kernel: Stack: 0171cfb0 00000246 bffffce8 0010f60e
bffffbc4 00000000 0011659c 0171cfb0
Nov 2 20:33:26 dns1 kernel: 017f8810 080678f8 345cd586 0009e0e9
0010a5bd bffffbc4 00000000 0000000f
Nov 2 20:33:26 dns1 kernel: 080678f8 bffffce8 bffffba4 ffffffda
0000002b 4009002b 4009002b 0000002b
Nov 2 20:33:26 dns1 kernel: Call Trace: [do_gettimeofday+34/68]
[sys_gettimeofday+44/112] [system_call+85/124]
Nov 2 20:33:26 dns1 kernel: Code: f7 f1 a3 40 43 1a 00 89 c3 0f 31 31
d2 29 f0 f7 e3 81 fa 0f

This happens once every 2 hours for the various processes that call
do_gettimeofday.

Solution
========

A small modification to time.c seems to cure the problem: I disabled the
test for the Pentium time stamp counter (in the time_init function), and
so do_slow_gettimeoffset is used instead of do_fast_gettimeoffset.

It's a one-liner:
/* if (x86_capability & 16) { */
if (0) {

Somehow, even though the 6x86MX reports having a timestamp counter,
something in do_fast_gettimeoffset triggers a divide by 0 error. If a
Cyrix patch eventually makes it into the kernel, perhaps this issue
should be investigated?

I haven't looked at kernel 2.1.x.

On another note:

do_gettimeofday returns without re-enabling interrupts, can anybody
explain why this is so (I know it's this way on purpose, I just want to
understand)?

Cheers,
==============================================
Andrew Derrick Balsa
andrewbalsa@usa.net
==============================================