* [Qemu-devel] Emulation without RWX
@ 2017-06-13 11:54 Antonio Groza
2017-06-13 12:44 ` Peter Maydell
0 siblings, 1 reply; 3+ messages in thread
From: Antonio Groza @ 2017-06-13 11:54 UTC (permalink / raw)
To: qemu-devel
Hello, i am trying to emulate x86 on a platform that won't allow me to map
memory pages as RWX(Apple's iOS) and i was wondering if there was any way
of running qemu without doing that. I've had a brief look at your
documentation and it looks like you are transpiling between 2 different
instruction sets and i don't know how that would be possible without a rwx
page.
Sorry for wasting your time with stupid questions,
-Antonio
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] Emulation without RWX
2017-06-13 11:54 [Qemu-devel] Emulation without RWX Antonio Groza
@ 2017-06-13 12:44 ` Peter Maydell
2017-06-13 13:23 ` Kamil Rytarowski
0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2017-06-13 12:44 UTC (permalink / raw)
To: Antonio Groza; +Cc: QEMU Developers
On 13 June 2017 at 12:54, Antonio Groza <antoniogroza@gmail.com> wrote:
> Hello, i am trying to emulate x86 on a platform that won't allow me to map
> memory pages as RWX(Apple's iOS) and i was wondering if there was any way
> of running qemu without doing that. I've had a brief look at your
> documentation and it looks like you are transpiling between 2 different
> instruction sets and i don't know how that would be possible without a rwx
> page.
It's certainly possible in theory -- you'd just need to be more
careful than we are currently about mapping the memory RW when
writing or patching code and then R-X when executing. (Now we're
multithreaded this is probably trickier than when we only had
a single thread, though.) But we don't do it currently and it
would require (possibly complicated) code changes to do it.
thanks
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] Emulation without RWX
2017-06-13 12:44 ` Peter Maydell
@ 2017-06-13 13:23 ` Kamil Rytarowski
0 siblings, 0 replies; 3+ messages in thread
From: Kamil Rytarowski @ 2017-06-13 13:23 UTC (permalink / raw)
To: Peter Maydell, Antonio Groza; +Cc: QEMU Developers
[-- Attachment #1: Type: text/plain, Size: 1374 bytes --]
On 13.06.2017 14:44, Peter Maydell wrote:
> On 13 June 2017 at 12:54, Antonio Groza <antoniogroza@gmail.com> wrote:
>> Hello, i am trying to emulate x86 on a platform that won't allow me to map
>> memory pages as RWX(Apple's iOS) and i was wondering if there was any way
>> of running qemu without doing that. I've had a brief look at your
>> documentation and it looks like you are transpiling between 2 different
>> instruction sets and i don't know how that would be possible without a rwx
>> page.
>
> It's certainly possible in theory -- you'd just need to be more
> careful than we are currently about mapping the memory RW when
> writing or patching code and then R-X when executing. (Now we're
> multithreaded this is probably trickier than when we only had
> a single thread, though.) But we don't do it currently and it
> would require (possibly complicated) code changes to do it.
>
> thanks
> -- PMM
>
MacOSX and NetBSD both have this RWX MPROTECT restriction and both have
option to relax it on per-page basis.
Example code inspiration is in LLVM's: Memory::AllocateRWX
(llvm/lib/Support/Unix/Memory.inc). [NetBSD code is still pending
upstream in review]
Proper PaX MPROTECT is not about toggling RW-RX memory region, as once a
memory page was allocated with W mode, it won't in regular circumstances
mapped to X anymore.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-13 13:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-13 11:54 [Qemu-devel] Emulation without RWX Antonio Groza
2017-06-13 12:44 ` Peter Maydell
2017-06-13 13:23 ` Kamil Rytarowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).