[PATCH] gcc 7: replacement for "new" for types of special alignment

2017-07-12 Thread Nadav Har'El
OSv has various types which have special alignment requirements - e.g., some objects are aligned to cache-line size for performance, some objects are aligned because of processor requirements (e.g., fpu state needs to be 64-byte aligned) or ABI requirements (stacks need to be 16-byte aligned).

[PATCH v2] cloud-init: support standard ISO images

2017-07-12 Thread Justin Cinkelj
In 56c6195b252b127c7fe90cb9fa46c370b384b51a was added option for reading configuration file from a secondary disk. This is so-called NoCloud configuration method, see also http://cloudinit.readthedocs.io/en/0.7.9/topics/datasources/nocloud.html. Due to missing ISO filesystem support, a custom disk

[PATCH 1/2] boot.S: Increase main() stack size

2017-07-12 Thread Nadav Har'El
We use "init_stack_top" as the end of the stack for loader.cc's premain() and main() functions (all other threads will allocate their stacks dynamically). A size of 4*4096 = 16384 bytes was reserved for this stack, but we actually use more (main() puts a sched::thread object on the stack and its

[PATCH 2/2] Remove unused interrupt stack

2017-07-12 Thread Nadav Har'El
In boot.S we reserved 40960 bytes for an "interrupt stack" that is not actually used anywhere since almost the start of OSv (see commit da6ba16dbd182517e4c889f806cd9ce57151). So get rid of it. Signed-off-by: Nadav Har'El --- arch/x64/boot.S | 4 1 file changed, 4

[PATCH] gcc 7: fix alignment of main()'s stack

2017-07-12 Thread Nadav Har'El
This patch fixes an early boot crash (a #GP) of the optimized build built with gcc 7. According to the x86_64 ABI, C functions must be called with the stack 16-byte aligned. The called function may and do use this assumption to create aligned objects on the stack without wasting time to verify

[PATCH 3/5] gcc 7: fix use of uninitialized variable

2017-07-12 Thread Nadav Har'El
Gcc 7 rightly complains that in bsd_init() we create an uninitialized timeval structure, and then use it to see the random number generator. The intention was probably to fetch the current time here :-) So let's do it. Signed-off-by: Nadav Har'El --- bsd/init.cc | 1 + 1 file

[PATCH 2/5] gcc 7: ignore warning in bsd/sys/netinet/in_mcast

2017-07-12 Thread Nadav Har'El
In bsd/sys/netinet/in_mcast we get a "maybe uninitialized" warning which as far as I can tell, is a false alarm. I also checked the freebsd tree, and they haven't fixed anything in this area, so it's probably correct. So let's just ignore this warning. Signed-off-by: Nadav Har'El

[PATCH 5/5] gcc 7: do not use dynamic exception specifications

2017-07-12 Thread Nadav Har'El
Dynamic exception specifications (throw(...) specification on functions) were deprecated in C++11 so we shouldn't use them. Gcc 7 started complaining about them, so it's about time we get rid of them. Use the C++11 "noexcept" instead, where appropriate (instead of an empty throw()).

[PATCH 1/5] gcc 7: add missing include

2017-07-12 Thread Nadav Har'El
Gcc 7 complains about defining memset when we don't include a header file with its prototype. So let's do. Signed-off-by: Nadav Har'El --- fastlz/lzloader.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/fastlz/lzloader.cc b/fastlz/lzloader.cc index 5f95e413..e05387e7

[PATCH 4/5] gcc 7: array should have non-negative length

2017-07-12 Thread Nadav Har'El
Gcc 7 rightly complains when we try to allocate an array with a signed int length. Changing the length variable to unsigned int fixes it. Signed-off-by: Nadav Har'El --- core/app.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/app.cc b/core/app.cc

[COMMIT osv master] command line: expand env vars before using them to expand cmdline

2017-07-12 Thread Commit Bot
From: Justin Cinkelj Committer: Nadav Har'El Branch: master command line: expand env vars before using them to expand cmdline Previously, runscript with content "--env=PORT?= /usr/lib/mpi_hello.so aaa $PORT ccc", run as /scripts/run.py -Vd -e

[COMMIT osv master] Support mmap() flag MAP_32BIT

2017-07-12 Thread Commit Bot
From: Nadav Har'El Committer: Nadav Har'El Branch: master Support mmap() flag MAP_32BIT Support the mmap() flag MAP_32BIT which asks for the allocated address to be in the lower 32 bits. Some applications (like wrk and luajit) use this flag and need it to

[COMMIT osv master] add openat64() and creat64() functions

2017-07-12 Thread Commit Bot
From: Nadav Har'El Committer: Nadav Har'El Branch: master add openat64() and creat64() functions Add functions openat64() and creat64() as aliases to the usual functions. Refs #747. Signed-off-by: Nadav Har'El Message-Id:

[PATCH] add openat64() and creat64() functions

2017-07-12 Thread Nadav Har'El
Add functions openat64() and creat64() as aliases to the usual functions. Refs #747. Signed-off-by: Nadav Har'El --- fs/vfs/main.cc | 2 ++ include/api/fcntl.h | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/vfs/main.cc b/fs/vfs/main.cc index