[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fd6b84ae605c652f652c25e3b8f3e234b82edd8e.camel@linux.ibm.com>
Date: Thu, 20 Feb 2020 18:53:04 -0300
From: Leonardo Bras <leonardo@...ux.ibm.com>
To: christophe.leroy@....fr, benh@...nel.crashing.org,
paulus@...ba.org, mpe@...erman.id.au
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] powerpc/8xx: Fix clearing of bits 20-23 in ITLB miss
On Tue, 2020-02-11 at 01:28 -0300, Leonardo Bras wrote:
> Looks a valid change.
> rlwimi r10, r10, 0, 0x0f00 means:
> r10 = ((r10 << 0) & 0x0f00) | (r10 & ~0x0f00) which ends up being
> r10 = r10
>
> On ISA, rlwinm is recommended for clearing high order bits.
> rlwinm r10, r10, 0, ~0x0f00 means:
> r10 = (r10 << 0) & ~0x0f00
>
> Which does exactly what the comments suggests.
>
> FWIW:
> Reviwed-by: Leonardo Bras <leonardo@...ux.ibm.com>
Sorry, I just realized the above was not very clear on my part.
What I meant to say was:
I think your change is correct, as it correctly fixes this line.
I would suggest adding the text bellow to your commit message, making
it easier to understand why rlwimi is not the right instruction clear
bytes 20-23, and why rlwinm is.
The current instruction can be translated to C as:
rlwimi r10, r10, 0, 0x0f00
r10 = ((r10 << 0) & 0x0f00) | (r10 & ~0x0f00) ->
r10 = (r10 & 0x0f00) | (r10 & ~0x0f00) ->
r10 = r10
The new proposed instruction can be translated to C as:
rlwinm r10, r10, 0, ~0x0f00 ->
r10 = (r10 << 0) & ~0x0f00
Which clears bits 20-23 as comment on code states.
Best regards,
Leonardo Bras
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists