[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87bm3add9f.fsf@concordia.ellerman.id.au>
Date: Sun, 17 Feb 2019 19:34:36 +1100
From: Michael Ellerman <mpe@...erman.id.au>
To: Segher Boessenkool <segher@...nel.crashing.org>,
Balbir Singh <bsingharora@...il.com>
Cc: erhard_f@...lbox.org, jack@...e.cz, linuxppc-dev@...abs.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
aneesh.kumar@...ux.vnet.ibm.com
Subject: Re: [PATCH] powerpc/64s: Fix possible corruption on big endian due to pgd/pud_present()
Segher Boessenkool <segher@...nel.crashing.org> writes:
> Hi all,
>
> On Sat, Feb 16, 2019 at 09:55:11PM +1100, Balbir Singh wrote:
>> On Thu, Feb 14, 2019 at 05:23:39PM +1100, Michael Ellerman wrote:
>> > In v4.20 we changed our pgd/pud_present() to check for _PAGE_PRESENT
>> > rather than just checking that the value is non-zero, e.g.:
>> >
>> > static inline int pgd_present(pgd_t pgd)
>> > {
>> > - return !pgd_none(pgd);
>> > + return (pgd_raw(pgd) & cpu_to_be64(_PAGE_PRESENT));
>> > }
>> >
>> > Unfortunately this is broken on big endian, as the result of the
>> > bitwise && is truncated to int, which is always zero because
>
> (Bitwise "&" of course).
Thanks, I fixed that up.
cheers
Powered by blists - more mailing lists