On 13 June 2016 at 15:45, Daniel P. Berrange <berra...@redhat.com> wrote: > On Mon, Jun 13, 2016 at 03:11:08PM +0100, Peter Maydell wrote: >> QEMU currently allocates coroutine stacks with a plain g_malloc(), >> which makes them r/w but not exec. That's a bug in QEMU which we >> should fix (though I'm not sure how best to identify the required >> permissions for stacks). It's a bit unhelpful of the kernel to >> assume an executable stack and not give a useful diagnostic or >> failure mode if it's not true, though. > > I'd suggest we just #ifdef the code base on architecture, on that basis > all platforms except mips are probably happy with non-exec stack.
Have they really all got rid of signal handler trampolines? (Also, probably breaks running QEMU under QEMU linux-user, because our linux-user code still assumes trampolines generally :-)) > eg, just change the g_malloc(size) to > > mmap(0, size, > #ifdef (TARGET_MIPS) This wants to be per *host*, not per target. > /* FP emulation in linux requires executable stack */ > PROT_READ | PROT_WRITE | PROT_EXEC, > #else > PROT_READ | PROT_WRITE, > #endif > MAP_PRIVATE | MAP_ANONYMOUS, > -1, 0); I have a definite dislike of architecture-ifdef ladders if we can possibly avoid them. (We have too many already.) thanks -- PMM