scripts: add alternative script to create EC2 AMIs

This script creates AMIs from snapshots instead of running instances, and
does not require uploading and converting the volume.  As a result it is
much, much faster.  The downside is that it must be run on ec2 itself, and
cannot be run on a local host.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Swagger Definition: app.json should use type

The currect way of defining return type, and parameter type is with the "type"
keyword.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
x64: Make DUMMY_HANDLER less dumb

It's nice to at least see the RIP where the invalid opcode exception
happened at...

Reviewed-by: Glauber Costa <glommer@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
x64: Move kernel image start at 32 MB

Make some room for statically linked executables that are loaded at
fixed addresses.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
elf: Support statically linked ELF executables

The ELF linker assumes that it's loading dynamically linked ELF
libraries and does not check if dynamic array tags are present. Fix them
to make statically linked ELF executables load.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
elf: Fix statically linked executable entry point

Statically linked executable may not have PT_INTERP present so we also
need to check for ET_EXEC object file type when looking up the entry
point.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
elf: Fix statically-linked executable base address

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
elf: Fix permissions for static executables

A statically linked "hello, world" C++ application will page fault on
its stack because there's a PT_RELRO segment type present that sets the
stack page to read-only...

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
x64: Fix ELF initial stack state

Fix ELF initial stack state as per Figure 3.9 ("Initial Process Stack")
in the x86-64 ABI specification. This is needed for statically linked
executables.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
x64: 'syscall' instruction support

Enable "fast system calls" via the 'syscall' instruction on OSv. The
instruction is used by Go programs on Linux/x86-64 for system calls.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
linux: Fix futex() command bitmask

The "op" argument passed to futex() also include flags so we need to
mask the command bits.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
linux: Wire up uname system call

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
libc/mman: Add brk() stub

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
linux: Wire up brk system call

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tests: Add static ELF test case

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
linux: arch_prctl() system call

Needed by binaries produced by the Go compiler.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>