[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 11/13] tests/vm: netbsd autoinstall, using seria
From: |
Kamil Rytarowski |
Subject: |
Re: [Qemu-devel] [PATCH 11/13] tests/vm: netbsd autoinstall, using serial console |
Date: |
Thu, 9 May 2019 19:01:39 +0200 |
User-agent: |
Mozilla/5.0 (X11; NetBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 |
On 09.05.2019 08:47, Gerd Hoffmann wrote:
> Hi,
>
>> I recommend to add one extra step into generated image:
>>
>> echo security.pax.mprotect.enabled=0 >> /etc/sysctl.conf
>
> Done.
>
Thanks! Once there will be PaX MPROTECT support in qemu, we can and
should drop it.
>> Alternatively (and preferably) enhance qemu to handle RWX allocation for
>> JIT on NetBSD.
>>
>> Example in libffi.
>>
>> https://github.com/libffi/libffi/commit/2bfcd29955c02b67fa10a68cc4200f6838181e0f
>
> So, from looking at the patch it seems you need two mappings of the same
> page, one writable and one executable.
> > Or, maybe it is also possible with one mapping which is writable first
> when you fill it with code, then gets flipped over to executable when
> you are done with the initialization and want use it.
>
> Is that correct?
>
If we need RWX in the same time we need double mapping (RW and RX). This
has been done in libffi.
If we can switch between RW and RX it's sufficient to use a single
mapping, however there is need to allocate a memory region with mmap(2)
using the PROT_MPROTECT() macro.
Example from the LLVM code:
https://github.com/llvm-mirror/llvm/blob/90dd07f5c5946a3d9d6861effe3291620c88c06f/lib/Support/Unix/Memory.inc#L99
> I suspect supporting that in tcg isn't exactly trivial.
> Does OpenBSD work the same way btw?
>
No. OpenBSD does not implement escape API.
There is need to pass "-z wxneeded" to the linker flags, but I'm not the
right person to test this or write a patch.
https://man.openbsd.org/ld
FreeBSD does not support W^X.
> cheers,
> Gerd
>
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH 13/13] tests/vm: ubuntu.i386: apt proxy setup, (continued)
- [Qemu-devel] [PATCH 08/13] tests/vm: serial console support helpers, Gerd Hoffmann, 2019/05/08
- [Qemu-devel] [PATCH 05/13] tests/vm: run test builds on snapshot, Gerd Hoffmann, 2019/05/08
- [Qemu-devel] [PATCH 06/13] tests/vm: add vm-boot-{ssh, serial}-<guest> targets, Gerd Hoffmann, 2019/05/08
- [Qemu-devel] [PATCH 10/13] tests/vm: freebsd autoinstall, using serial console, Gerd Hoffmann, 2019/05/08
- [Qemu-devel] [PATCH 11/13] tests/vm: netbsd autoinstall, using serial console, Gerd Hoffmann, 2019/05/08
[Qemu-devel] [PATCH 09/13] tests/vm: openbsd autoinstall, using serial console, Gerd Hoffmann, 2019/05/08
Re: [Qemu-devel] [PATCH 00/13] tests/vm: serial console autoinstall, misc fixes., Thomas Huth, 2019/05/09
Re: [Qemu-devel] [PATCH 00/13] tests/vm: serial console autoinstall, misc fixes., Kamil Rytarowski, 2019/05/09