Re: powerpc/64s: Fix compiler store ordering to SLB shadow area

2018-06-04 Thread Michael Ellerman
On Wed, 2018-05-30 at 10:31:22 UTC, Nicholas Piggin wrote: > The stores to update the SLB shadow area must be made as they appear > in the C code, so that the hypervisor does not see an entry with > mismatched vsid and esid. Use WRITE_ONCE for this. > > GCC has been observed to elide the first

Re: [PATCH] powerpc/64s: Fix compiler store ordering to SLB shadow area

2018-06-01 Thread Segher Boessenkool
On Fri, Jun 01, 2018 at 08:52:27AM +1000, Nicholas Piggin wrote: > On Fri, 01 Jun 2018 00:22:21 +1000 > Michael Ellerman wrote: > > Nicholas Piggin writes: > > > - p->save_area[index].esid = 0; > > > - p->save_area[index].vsid = cpu_to_be64(mk_vsid_data(ea, ssize, flags)); > > > -

Re: [PATCH] powerpc/64s: Fix compiler store ordering to SLB shadow area

2018-06-01 Thread Michael Ellerman
Nicholas Piggin writes: > On Fri, 01 Jun 2018 00:22:21 +1000 > Michael Ellerman wrote: >> Nicholas Piggin writes: >> > The stores to update the SLB shadow area must be made as they appear >> > in the C code, so that the hypervisor does not see an entry with >> > mismatched vsid and esid. Use

Re: [PATCH] powerpc/64s: Fix compiler store ordering to SLB shadow area

2018-05-31 Thread Nicholas Piggin
On Fri, 01 Jun 2018 00:22:21 +1000 Michael Ellerman wrote: > Nicholas Piggin writes: > > > The stores to update the SLB shadow area must be made as they appear > > in the C code, so that the hypervisor does not see an entry with > > mismatched vsid and esid. Use WRITE_ONCE for this. > > > >

Re: [PATCH] powerpc/64s: Fix compiler store ordering to SLB shadow area

2018-05-31 Thread Michael Ellerman
Nicholas Piggin writes: > The stores to update the SLB shadow area must be made as they appear > in the C code, so that the hypervisor does not see an entry with > mismatched vsid and esid. Use WRITE_ONCE for this. > > GCC has been observed to elide the first store to esid in the update, > which

[PATCH] powerpc/64s: Fix compiler store ordering to SLB shadow area

2018-05-30 Thread Nicholas Piggin
The stores to update the SLB shadow area must be made as they appear in the C code, so that the hypervisor does not see an entry with mismatched vsid and esid. Use WRITE_ONCE for this. GCC has been observed to elide the first store to esid in the update, which means that if the hypervisor