Date: Sun, 1 Apr 2001 15:12:07 -0700 (PDT) From: "Bruce R. Montague" <brucem@mail.cruzio.com> To: freebsd-hardware@freebsd.org, freebsd-small@freebsd.org Subject: movsl generic_bcopy hang using NSC GX Geode CPU Message-ID: <200104012212.f31MC7u00385@mail.cruzio.com>
next in thread | raw e-mail | index | archive | help
System hangs on "rep movsl" in "generic_bcopy()" in "i386/i386/support.s" using NSC Geode (586) CPU. Not sure exactly what list is most appropriate, "hardware" and "small" seemed best. Using: OS: custom picoBSD (not one of the standard PICOBSD conf files) built on latest 4.3 RC cvsupped as of this weekend (end of March 2001). Problem has been completely solid over last month using 4.3 Beta, don't know about earlier versions. Hardware: NatSemi Geode GX 8.1 CPU (300 Mhz) on a National Semiconductor Centaurus "reference/development" motherboard (aka a Geode SP4GX00). PicoBSD must be built with a "cpu I586_CPU" option to run on this board. Problem: Pressing backspace (or delete, or cntrl-H) on the console with even number of text characters on the display line hangs the CPU. System/network otherwise runs fine. Backspace when using telnet into the system always works fine. Problem has never been reproduced under any other circumstances except console backspace with even number of cmd-line (or display-line) chars. The machine hangs on the "rep movsl" instruction in "generic_bcopy" (called via "bcopy_toio()" in syscons code "sc_vtb_copy()/scvtb.c" to scroll screen image). The code-block _will_ work if the equivalent "rep movsb" code is used instead of a movsl, _OR_ the unmodified "rep movsl" can be made to work if an immediately prior byte-wise scan has been made of the movsl source/dest buffers (just a for-loop *p++ before the "bcopy_toio()". The code path is routinely used w/o problems; when the "backspace-on-odd" problem occurs the input arguments appear `normal' although I have not attempted to check related buffer alloc/memory mapping... both the "from" and "to" addresses are often word (not longword) aligned, apparently without ill effect (the CR0 Alignment Check bit is set on in "locore.s" at system init and stays on). On an ASUS Pentium III motherboard this problem does not occur with the "same" picoBSD system (identical except built with cpu "I686_CPU"). I have not been able to detect any machine/interrupt activity after this instruction, but I am only using a post-code board (don't have a logic analyzer or ICE). This all suggests a mid--rep-instruction fault-failure scenario...? But... any additional advice, hints, directions, configs I've probably missed, etc., most welcome. I'm just going to live with the work-around for just know instead of chase it all the way down, maybe later... Work-around Fix: In routine "ENTRY(generic_bcopy)" in "i386/i386/support.s" remove the movsl longword copy optimization and just let the "rep movsb" do it all: ------------------------------- --- old_support.s Sun Apr 1 14:19:07 2001 +++ support.s Sun Apr 1 14:54:45 2001 @@ -450,12 +450,14 @@ cmpl %ecx,%eax /* overlapping && src < dst? */ jb 1f +#if 0 shrl $2,%ecx /* copy by 32-bit words */ cld /* nope, copy forwards */ rep movsl movl 20(%esp),%ecx andl $3,%ecx /* any bytes left? */ +#endif rep movsb popl %edi ------------------------------- Advice, insight, and help most appreciated! - bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hardware" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104012212.f31MC7u00385>