Thread (3 messages) 3 messages, 3 authors, 2017-02-01

Re: [PATCH] powerpc/mm/hash: Properly mask the ESID bits when building proto-VSID

flat view

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-01-30 04:44:54

"Aneesh Kumar K.V" [off-list ref] writes:
proto-vsid is built using both mmu context id and ESID. We should not have
overlapping bits between those. That will result in us having vsid
collision. With the current code we missed masking the top bits of effective
address. This implies for kernel address we ended up using the top 4 bits
as part of proto-vsid, which is wrong. For the kernel we should have the
below mapping

0xf000000000000000 -> 0x7ffff  (19 bits context + 6 bits ESID ).

Without the patch we endup with
0xf000000000000000 ->  0xf7ffff (0x7ffff | 0xf00000)
As discussed offline, this is missing the << 6.

Which means we end up with:

  ea         = 0xf000000000000000
  context    = 0x7ffff 
  proto_vsid = (0x7ffff << 6 | 0xf000000000000000 >> 40)
             = (0x1ffffc0 | 0xf00000)
             =  0x1ffffc0

ie. the proto-vsid is not affected by the extra bits. Same is true for
the 0xc/d/e regions.

So there is no bug here, as long as we use the current mapping from
kernel EA to context ID.

I'll merge this into next.

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help