Re: [Qemu-devel] [PATCH 16/32] ppc: Rework NIP updates vs. exception generation

2016-07-26 Thread Benjamin Herrenschmidt
On Wed, 2016-07-27 at 12:19 +1000, David Gibson wrote: > twi etc will generally resume from the next instruction if they trap, > yes?  In which case I'm a bit confused by the nip - 4.  But possibly I > just haven't correctly followed all the nip update logic changed by > this patch. >From the ISA

Re: [Qemu-devel] [PATCH 16/32] ppc: Rework NIP updates vs. exception generation

2016-07-26 Thread Benjamin Herrenschmidt
On Wed, 2016-07-27 at 12:19 +1000, David Gibson wrote: > On Wed, Jul 27, 2016 at 08:21:10AM +1000, Benjamin Herrenschmidt > wrote: > > > > We make env->nip almost always point to the faulting instruction, > > thus avoiding a mess of "store_current" vs "store_next" in the > > exception handling. Th

Re: [Qemu-devel] [PATCH 16/32] ppc: Rework NIP updates vs. exception generation

2016-07-26 Thread David Gibson
On Wed, Jul 27, 2016 at 08:21:10AM +1000, Benjamin Herrenschmidt wrote: > We make env->nip almost always point to the faulting instruction, > thus avoiding a mess of "store_current" vs "store_next" in the > exception handling. The syscall exception knows to move the PC by > 4 and that's really abou

[Qemu-devel] [PATCH 16/32] ppc: Rework NIP updates vs. exception generation

2016-07-26 Thread Benjamin Herrenschmidt
We make env->nip almost always point to the faulting instruction, thus avoiding a mess of "store_current" vs "store_next" in the exception handling. The syscall exception knows to move the PC by 4 and that's really about it. This actually fixes a number of cases where the translator was setting en