linux-mips
[Top] [All Lists]

Re: c17a6554 broke 64BIT_PHYS_ADDR for 32 bit systems

To: Thomas Lange <thomas@corelatus.se>
Subject: Re: c17a6554 broke 64BIT_PHYS_ADDR for 32 bit systems
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Tue, 23 Apr 2013 17:14:16 +0200
Cc: Ralf Baechle <ralf@linux-mips.org>, Linux MIPS Mailing List <linux-mips@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=zMlRVKNQAuIJFAdRndSyw3mQT5SUX82fq8Ft4GR3U6I=; b=vMsRZ5clA+BEBjs8RVtEpXqQWklJ9gtU/uuaBsqF32IOF18N8Y0jOnB5QNS2JYWLAK eJ7Fidcg6e8e6z3ZCnGxx27TzjPIgVtQDiwnDNHJ0MMbGeLngbElNCNi3zzriECqWtWi wkYbrnEiuF0lQvKuW6EgmiaBSOZEaBcSs19Hlo2QRRipv8gkBSwYmdzirYOGwXV6Af8v d6Ujq913aZR2F6o9bDYzeFuysKfiHchXGjjk2YdLiFJy4yjucc/a54NfChUztuojmxmU dp7tUs6Taz3iva/3N11tYnp8ciUZ++QiXJKSkzohxRxjHC9yqxELJxl6cveFyS2QF1tv M2LQ==
In-reply-to: <516EE5E4.1010605@corelatus.se>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <516EE5E4.1010605@corelatus.se>
Sender: linux-mips-bounce@linux-mips.org
On Wed, Apr 17, 2013 at 8:11 PM, Thomas Lange <thomas@corelatus.se> wrote:
> commit c17a6554 unintentionally(?) modified the PAGE_MASK type
> from (int) to (long unsigned int).
>
> This breaks ioremap (and possibly more) when using 64BIT_PHYS_ADDR on
> 32 bit systems.
> Example of failing code from ioremap.c:
>
>         phys_addr &= PAGE_MASK;
>
> Since phys_addr is 64 bit (unsigned long long) when 64BIT_PHYS_ADDR and
> PAGE_MASK is 32bit (long unsigned int), the upper 32 bits will always
> be zeroed which is not what we want/expect.
>
> The code above works if PAGE_MASK is a _signed_ 32bit int though.
>
> Some possible fixes:
>
> A) Simply revert the commit. Makes ioremap work again, but then PAGE_MASK
>    is a signed int. Do we really want a mask that is 'signed'?

Already fixed, cfr. https://lkml.org/lkml/2013/4/22/518

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

<Prev in Thread] Current Thread [Next in Thread>