On Mon, Jan 30, 2017 at 11:49:34AM +0000, Peter Maydell wrote: > On 30 January 2017 at 02:47, Jose Ricardo Ziviani > <jos...@linux.vnet.ibm.com> wrote: > > Qemu linux-user doesn't fill uc_mcontext completely like full emul. does. > > For instance, uc->uc_mcontext.regs->nip is an invalid so this > > commit replaces it by uc->uc_mcontext.gp_regs[PT_NIP] > > It's not clear to me from this commit message whether this is > a bug in QEMU's userspace emulation which this is trying to work > around (in which case we should just fix it in QEMU), or a > bug in risu where we were incorrectly relying on something the > kernel doesn't actually guarantee. Which is it? > > Also, looking at the kernel source and headers as far > as I can see uc_context.regs is a pointer set up such that > uc->uc_mcontext.regs->nip is pointing at the same bit of > memory where uc->uc_mcontext.gp_regs[PT_NIP] is, > and the QEMU code does similar, so I don't see how you can > get two different values from the two things. > > (It is certainly the case that risu is quite good at exercising > odd corner cases of the signal handling code in QEMU which most > normal programs don't care about...)
Peter I just sent a patch "linux-user: fill target sigcontext struct accordingly" to fix it in QEMU. Please, forget this patchset, I'll reorganize it and send it later. Thank you Ziviani