[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdk1A-wvuNDaLokYu1oNPUV-ab24=NzdL5Sbh6QcV_vDMQ@mail.gmail.com>
Date: Thu, 3 Aug 2017 10:53:12 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Ard Biesheuvel <ard.biesheuvel@...aro.org>
Cc: zijun_hu <zijun_hu@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Greg Hackmann <ghackmann@...gle.com>,
Doug Anderson <dianders@...omium.org>,
Stephen Hines <srhines@...gle.com>,
Pirama Arumuga Nainar <pirama@...gle.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Mark Rutland <mark.rutland@....com>,
Laura Abbott <labbott@...hat.com>,
Oleksandr Andrushchenko <Oleksandr_Andrushchenko@...m.com>,
Alexander Popov <alex.popov@...ux.com>,
Neeraj Upadhyay <neeraju@...eaurora.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] arm64: avoid overflow in VA_START and PAGE_OFFSET
> Would
>
> #define VA_START (UL(0xffffffffffffffff) - (1 << VA_BITS) + 1)
>
> also work?
I think you'd have to wrap the 1 in a UL(), ex:
#define VA_START (UL(0xffffffffffffffff) - (UL(1) << VA_BITS) + 1)
Otherwise IIUC a integral literal (`1`) is treated as an int, which on
arm64 is LP64 making it 32b, where most configs set VA_BITS
to larger than 32b. Shifting by more than the width is undefined
behavior. And without it, I get compile errors.
I'll send v2 with your suggestion, thanks.
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists