On Thu, Jul 11, 2002 at 02:46:24AM -0600, Eric Anholt wrote:
 > A while ago I added the stuff to the config/cf/* to enable USE_SSE_ASM
 > on FreeBSD, but today found that it wasn't enabled on my athlon.  I
 > added the proper sysctl check for it, but it still wasn't enabled.  It
 > turns out the Athlon's extended CPUID function has most of the same
 > feature bits as the standard CPUID features function, but it doesn't
 > ever enable the SSE bit.  I've made a patch that ORs in the bit from the
 > standard function, enabling SSE on new Athlons.  It's attached.

A better fix would be to actually enable SSE before FreeBSD does its
feature flag detection. Linux does the following very early on..

            /* Bit 15 of Athlon specific MSR 15, needs to be 0
             * to enable SSE on Palomino/Morgan CPU's.
             * If the BIOS didn't enable it already, enable it
             * here.
             */
            if (c->x86_model == 6 || c->x86_model == 7) {
                if (!cpu_has(c, X86_FEATURE_XMM)) {
                    printk(KERN_INFO "Enabling disabled K7/SSE Support.\n");
                    rdmsr(MSR_K7_HWCR, l, h);
                    l &= ~0x00008000;
                    wrmsr(MSR_K7_HWCR, l, h);
                    set_bit(X86_FEATURE_XMM, c->x86_capability);
                }
            }

Seems some BIOSen didn't enable this magical bit. Your patch is just
doing the FreeBSD equivalent of the set_bit() call above, which is
fine for anything that parses those flags, but breaks any userspace
that does its own cpuid() calls to find out cpu capabilities.

        Dave

-- 
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Gadgets, caffeine, t-shirts, fun stuff.
http://thinkgeek.com/sf
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to