emulators/qemu: use MAP_STACK in qemu_alloc_stack()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

emulators/qemu: use MAP_STACK in qemu_alloc_stack()

Sebastien Marie-3
Hi,

The following diff adds MAP_STACK on allocated memory used for stack.

(Please note a diff on the kernel is pending for completely let qemu to
run - see https://marc.info/?l=openbsd-tech&m=152389221205108&w=2)


While compiling the port, I also see the following notice at end of
configure:

        WARNING: SUPPORT FOR THIS HOST OS WILL GO AWAY IN FUTURE RELEASES!

        Host OS OpenBSD support is not currently maintained.
        The QEMU project intends to remove support for this host OS in
        a future release if nobody volunteers to maintain it and to
        provide a build host for our continuous integration setup.
        configure has succeeded and you can continue to build, but
        if you care about QEMU on this platform you should contact
        us upstream at [hidden email].

Should we be worried ?
--
Sebastien Marie


Index: Makefile
===================================================================
RCS file: /cvs/ports/emulators/qemu/Makefile,v
retrieving revision 1.176
diff -u -p -r1.176 Makefile
--- Makefile 16 Feb 2018 14:48:14 -0000 1.176
+++ Makefile 16 Apr 2018 17:56:36 -0000
@@ -7,6 +7,7 @@ ONLY_FOR_ARCHS= aarch64 amd64 arm i386 p
 COMMENT= multi system emulator
 
 DISTNAME= qemu-2.11.1
+REVISION= 0
 CATEGORIES= emulators
 MASTER_SITES= http://wiki.qemu.org/download/
 EXTRACT_SUFX= .tar.xz
Index: patches/patch-util_oslib-posix_c
===================================================================
RCS file: patches/patch-util_oslib-posix_c
diff -N patches/patch-util_oslib-posix_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-util_oslib-posix_c 16 Apr 2018 17:56:36 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+Pass MAP_STACK flag when allocating memory for stack usage.
+Index: util/oslib-posix.c
+--- util/oslib-posix.c.orig
++++ util/oslib-posix.c
+@@ -538,7 +538,7 @@ void *qemu_alloc_stack(size_t *sz)
+     *sz += pagesz;
+
+     ptr = mmap(NULL, *sz, PROT_READ | PROT_WRITE,
+-               MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
++               MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);
+     if (ptr == MAP_FAILED) {
+         perror("failed to allocate memory for stack");
+         abort();