public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Winischhofer <thomas@winischhofer.net>
To: Andrea Arcangeli <andrea@suse.de>
Cc: Eyal Lebedinsky <eyal@eyal.emu.id.au>, linux-kernel@vger.kernel.org
Subject: Re: 2.4.23pre6aa2 - some problems [with patches]
Date: Sun, 05 Oct 2003 13:02:36 +0200	[thread overview]
Message-ID: <3F7FFA4C.3020004@winischhofer.net> (raw)
In-Reply-To: <20031005104008.GC1561@velociraptor.random>

Andrea Arcangeli wrote:
>>depmod: *** Unresolved symbols in
>>/lib/modules/2.4.23-pre6-aa2/kernel/drivers/vi
>>deo/sis/sisfb.o
>>depmod:         __floatsidf
>>depmod:         __divdf3
>>depmod:         __fixunsdfsi
>>depmod:         __muldf3
>>depmod:         __adddf3
> 
> 
> those drivers are buggy, and had always been buggy, it's just that you
> couldn't notice it before. I added an option in my new tree to catch
> those longstanding bugs. They *must* not compile. Driver
> authors can audit their 2.4 drivers by grabbing my tree or by applying
> this patch alone:
> 
> 	http://www.us.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.23pre6aa2/9999900_soft-float-1
> 
> see drivers/video/sis/init.c:
> 
>       divider = (sr2b & 0x80) ? 2.0 : 1.0;
>       postscalar = (sr2c & 0x80) ?
>               ( (((sr2c >> 5) & 0x03) == 0x02) ? 6.0 : 8.0) : (((sr2c >> 5) & 0x03) + 1.0);
>       num = (sr2b & 0x7f) + 1.0;
>       denum = (sr2c & 0x1f) + 1.0;
> 
> there would be a slight chance to find false positives too, but those
> aren't false positives, there's no fpu save at all there.
> 
> 
> Ironically all the float numbers seems to end with .0, I fixed it a bit
> but I've no idea if I catched all them, so Eyal, you can try to apply
> this patch and follow the code to see if you can spot more of these
> longstanding bugs (those could corrupt the fpu state and segfault
> userspace at the very least):
> 
> --- xx/drivers/video/sis/init.c.~1~	2003-10-02 00:09:44.000000000 +0200
> +++ xx/drivers/video/sis/init.c	2003-10-05 12:36:03.000000000 +0200
> @@ -3940,11 +3940,11 @@ SiSBuildBuiltInModeList(ScrnInfoPtr pScr
>        sr2b = pSiS->SiS_Pr->SiS_VCLKData[vclkindex].SR2B;
>        sr2c = pSiS->SiS_Pr->SiS_VCLKData[vclkindex].SR2C;
>  
> -      divider = (sr2b & 0x80) ? 2.0 : 1.0;
> +      divider = (sr2b & 0x80) ? 2 : 1;
>        postscalar = (sr2c & 0x80) ?
> -              ( (((sr2c >> 5) & 0x03) == 0x02) ? 6.0 : 8.0) : (((sr2c >> 5) & 0x03) + 1.0);
> -      num = (sr2b & 0x7f) + 1.0;
> -      denum = (sr2c & 0x1f) + 1.0;
> +              ( (((sr2c >> 5) & 0x03) == 0x02) ? 6 : 8) : (((sr2c >> 5) & 0x03) + 1);
> +      num = (sr2b & 0x7f) + 1;
> +      denum = (sr2c & 0x1f) + 1;
>  
>  #ifdef TWDEBUG
>        xf86DrvMsg(0, X_INFO, "------------\n");
> 

That part of init.c doesn't get compiled in the linux kernel, it's for 
XFree86. I think the xf86DrvMsg statement should make that clear...

Thomas

-- 
Thomas Winischhofer
Vienna/Austria
thomas AT winischhofer DOT net          http://www.winischhofer.net/
twini AT xfree86 DOT org


  reply	other threads:[~2003-10-05 11:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-04 10:57 2.4.23pre6aa2 Andrea Arcangeli
2003-10-04 15:38 ` 2.4.23pre6aa2 - some problems [with patches] Eyal Lebedinsky
2003-10-05 10:40   ` Andrea Arcangeli
2003-10-05 11:02     ` Thomas Winischhofer [this message]
2003-10-06  0:43     ` Eyal Lebedinsky
2003-10-06  0:55     ` Eyal Lebedinsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F7FFA4C.3020004@winischhofer.net \
    --to=thomas@winischhofer.net \
    --cc=andrea@suse.de \
    --cc=eyal@eyal.emu.id.au \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox