Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1207052

Re: enabling libgcc for 64-bit divisions, was Re: PROBLEM: XFS on ARM corruption 'Structure needs cl

From Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: enabling libgcc for 64-bit divisions, was Re: PROBLEM: XFS on ARM corruption 'Structure needs cl
Date 2015-08-13 20:30 +0200
Message-ID <pX5qh-2R4-3@gated-at.bofh.it> (permalink)
References <pX3ya-92-27@gated-at.bofh.it> <pX5gC-2FH-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Aug 13, 2015 at 11:18 AM, George Spelvin <linux@horizon.com> wrote:
>
> On x86, the case that msword >= divsor causes a divide exception
> (divide ba generalization of divide by zero), so it's tempting
> to do the same sort of "assume no trap and fix up in the handler"
> trick as <asm/uaccess.h>.

That would be horrible. One of the reasonably common cases of do_div()
is for printing out numbers. And they are often in the 4G+ range..

> One function that would cover a significant number of use cases
> (but not all, damn it) would be
>
> rem = do_mul_div(x, mul,_div)

Yes. That might be worth introducing. Not to replace do_div(), but as
a "32-bit only" interface to a somewhat common situation.

                Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: enabling libgcc for 64-bit divisions, was Re: PROBLEM: XFS on ARM corruption 'Structure needs cl "George Spelvin" <linux@horizon.com> - 2015-08-13 08:20 +0200
  Re: enabling libgcc for 64-bit divisions, was Re: PROBLEM: XFS on ARM  corruption 'Structure needs cl Linus Torvalds <torvalds@linux-foundation.org> - 2015-08-13 18:30 +0200
    Re: enabling libgcc for 64-bit divisions, was Re: PROBLEM: XFS on ARM corruption 'Structure needs cl "George Spelvin" <linux@horizon.com> - 2015-08-13 20:20 +0200
      Re: enabling libgcc for 64-bit divisions, was Re: PROBLEM: XFS on ARM  corruption 'Structure needs cl Linus Torvalds <torvalds@linux-foundation.org> - 2015-08-13 20:30 +0200
        Re: enabling libgcc for 64-bit divisions, was Re: PROBLEM: XFS on ARM corruption 'Structure needs cl "George Spelvin" <linux@horizon.com> - 2015-08-13 21:10 +0200

csiph-web