Re: No such 386 instruction w/2.0.25

Richard Waltham (dormouse@farsrobt.demon.co.uk)
Sun, 17 Nov 1996 16:50:54 +0000 (GMT)


Hi Thomas

Use the patch below from David Dyck. IMHO the ONLY sensible answer to this
problem!

If you have a stable system piece meal upgrading of this that and the other
utility is asking for trouble.

The only sensible solution is the correct patch.

Richard

>
>
>
> I get the following error message when trying to compile 2.0.25:
>
> make[1]: Entering directory `/usr/src/linux/arch/i386/kernel'
> gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
> -fomit-frame-pointer -fno-strength-reduce -pipe -m486 -DCPU=486 -c
> -o time.o time.c
> {standard input}: Assembler messages:
> {standard input}:768: Error: no such 386 instruction: `rdmsr'
> {standard input}:770: Error: no such 386 instruction: `wrmsr'
> make[1]: *** [time.o] Error 1
> make: *** [linuxsubdirs] Error 2
> make[1]: Leaving directory `/usr/src/linux/arch/i386/kernel'
>

snip

> --
> Thomas Molesworth (thomas@bass.almac.co.uk)
>

Here is a patch that replaces the rdmsr and wrmsr
with the correct .byte instructions.

(I tested this by upgrading the assembler to correctly
the rdmsr/wrmsr instructions, and replaced the instructions
with .bytes, as defined in binutils/include/opcodes/i386.h,
and generated identical .o files)

I think that since just a few lines down in the same
source file is another pentium instruction using .byte,
we should not force everyone to upgrade assemblers
just for this one patch that was added in 2.0.25)

David Dyck

--- linux/arch/i386/kernel/time.c.new Sun Nov 10 20:29:11 1996
+++ linux/arch/i386/kernel/time.c Sun Nov 10 22:32:10 1996
@@ -471,9 +471,9 @@
if( x86_model == 0 ) {
/* turn on cycle counters during power down */
__asm__ __volatile__ (" movl $0x83, %%ecx \n \
- rdmsr \n \
+ .byte 0x0f,0x32 \n \
orl $1,%%eax \n \
- wrmsr \n "
+ .byte 0x0f,0x30 \n "
: : : "ax", "cx", "dx" );
udelay(500);
}

--
Richard Waltham   |                             dormouse@farsrobt.demon.co.uk
  At home in      |                                    Compuserve 100421.1276
Southampton UK    |     FAX + GTPN 050/066 The Board Room +44 (0) 1703 760099
--