Subject: port-i386/8505: Some cyrix CPUs can be locked solid from userland
To: None <gnats-bugs@gnats.netbsd.org>
From: None <dave@dtsp.co.nz>
List: netbsd-bugs
Date: 09/28/1999 05:12:01
>Number:         8505
>Category:       port-i386
>Synopsis:       Some cyrix CPUs can be locked solid from userland
>Confidential:   no
>Severity:       critical
>Priority:       low
>Responsible:    port-i386-maintainer (NetBSD/i386 Portmaster)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 28 04:50:01 1999
>Last-Modified:
>Originator:     Dave Sainty
>Organization:
Dynamic Technology Services and Products Ltd (NZ)
>Release:        current, 19990926
>Environment:
>Description:
	It is possible to bring the system to a complete standstill with
	userland code on a system based on older cyrix chips.

	This is actually a very old known bug I happened to chance apon whilst
	sifting through very old bugtraq posts.

	Newer Cyrix chips are not affected.  I have a 300 and a 166 here, the
	166 is affected, but the 300 is unscathed.

>How-To-Repeat:
	static unsigned char c[4];
	main()
	{
	asm ("movl      $_c, %ebx\n\t"
	"again: xchgl   (%ebx), %eax\n\t"
        "movl   %eax, %edx\n\t"
        "jmp    again\n\t");
	}

	compile, execute and either ctrl-C or reboot, whichever is appropriate
	:)

>Fix:
	According to one post, under Linux, "set6x86 -p 0xc1 -s 0x10" fixes
	the problem.  Gosh! :)

	If this is the case, it would seem sensible to include this
	initialisation (whatever it does - but it is obviously simple) as part
	of the chip specific system initialisation for affected chips.

	Sorry, no implementation... yet...
>Audit-Trail:
>Unformatted:
System: NetBSD tequila.dave.dtsp.co.nz 1.4K NetBSD 1.4K (TEQUILA) #7: Fri Sep 17 23:43:58 NZST 1999 dave@tequila.dave.dtsp.co.nz:/vol/tequila/userB/u2/NetBSD-current/src/sys/arch/i386/compile/TEQUILA i386