From owner-freebsd-small Sun Apr 1 15:23:15 2001 Delivered-To: freebsd-small@freebsd.org Received: from mail.cruzio.com (dsl3i239.cruzio.com [205.179.211.239]) by hub.freebsd.org (Postfix) with ESMTP id 6C18837B71B; Sun, 1 Apr 2001 15:23:06 -0700 (PDT) (envelope-from brucem@mail.cruzio.com) Received: (from brucem@localhost) by mail.cruzio.com (8.11.3/8.11.3) id f31MC7u00385; Sun, 1 Apr 2001 15:12:07 -0700 (PDT) (envelope-from brucem) Date: Sun, 1 Apr 2001 15:12:07 -0700 (PDT) From: "Bruce R. Montague" Message-Id: <200104012212.f31MC7u00385@mail.cruzio.com> To: freebsd-hardware@freebsd.org, freebsd-small@freebsd.org Subject: movsl generic_bcopy hang using NSC GX Geode CPU Sender: owner-freebsd-small@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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-small" in the body of the message