[osv-dev] [PATCH] Enhance scripts/build to allow passing arguments to modules/apps

2019-07-20 Thread Waldemar Kozaczuk
* variable and customize its build behavior. This new mechanism should let us remove redundant openjdk apps. Signed-off-by: Waldemar Kozaczuk --- scripts/build | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/build b/scripts/build index 2affe578..b30943c9 100755

[osv-dev] [PATCH] Fixed compilation errors in modules mostly related to strlcpy

2019-07-20 Thread Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk --- modules/cloud-init/Makefile | 6 +++--- modules/golang/Makefile | 6 ++ modules/httpserver-api/Makefile | 9 + modules/httpserver-api/api/env.cc | 1 + modules/java-base/common.gmk | 1 - 5 files changed, 11 insertions

[osv-dev] [PATCH V3] Support local-exec TLS access

2019-07-13 Thread Waldemar Kozaczuk
should be sufficient for most applications which either use tiny TLS (Golang uses 8-bytes long) if at all. Rust ELFs tend to rely on quite large TLS in which case the limit in loader.ld needs to be increased accordingly and loader.elf relinked. Fixes #352 Signed-off-by: Waldemar Kozaczuk --- arch

[osv-dev] [PATCH] Support PVH/HVM direct kernel boot

2019-07-06 Thread Waldemar Kozaczuk
,drive=hd0,scsi=off \ -drive file=./build/last/usr.img,if=none,id=hd0,cache=none,aio=threads Signed-off-by: Waldemar Kozaczuk --- arch/x64/arch-setup.cc| 16 ++ arch/x64/arch-setup.hh| 2 + arch/x64/boot.S | 9 +-

[osv-dev] [PATCH V2] hpet: handle wrap-around with 32-bit counter

2019-07-05 Thread Waldemar Kozaczuk
This patch enhances the hpet clock with 32-bit main counter to handle wrap-arounds. It does it by maintaining separate upper 32-bit counter per-cpu and incrementing it when wrap around is detected. Signed-off-by: Waldemar Kozaczuk --- drivers/hpet.cc | 53

[osv-dev] [PATCH V2] Support local-exec TLS access

2019-07-03 Thread Waldemar Kozaczuk
should be sufficient for most applications which either use tiny TLS (Golang uses 8-bytes long) if at all. Rust ELFs tend to rely on quite large TLS in which case the limit in loader.ld needs to be increased accordingly and loader.elf relinked. Fixes #352 Signed-off-by: Waldemar Kozaczuk --- arch

[osv-dev] [PATCH] Refine confstr() to conform more closely to Linux spec

2019-07-03 Thread Waldemar Kozaczuk
Please see https://linux.die.net/man/3/confstr for more details. Signed-off-by: Waldemar Kozaczuk --- runtime.cc | 28 +--- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/runtime.cc b/runtime.cc index acd6333e..20a19a43 100644 --- a/runtime.cc +++ b

[osv-dev] [PATCH] syscall: provide limited implementation of tgkil

2019-07-02 Thread Waldemar Kozaczuk
This patch provides very limited implementation of the Linux specific system call tgkill(). For now it only handles SIGINT which is interpreted as a request to shutdown the app and OSv. Fixes #1026 Signed-off-by: Waldemar Kozaczuk --- linux.cc | 18 ++ 1 file changed, 18

[osv-dev] [PATCH] signal: tag user handler thread as an application one

2019-07-02 Thread Waldemar Kozaczuk
also prevents crash as described by the issue #1026. Signed-off-by: Waldemar Kozaczuk --- libc/signal.cc | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libc/signal.cc b/libc/signal.cc index 913976f2..ac105568 100644 --- a/libc/signal.cc +++ b/libc/signal.cc @@ -345,6

[osv-dev] [PATCH] procfs: populate maps file with i-node numbers

2019-06-29 Thread Waldemar Kozaczuk
20101000-2020 rw-p 00:00 0 8000-8000 ---p 00:00 0 It does so by capturing and saving the file i-node number when constructing file_vma so that it can be used when generating /proc/self/maps. Signed-off-by: Waldemar Kozaczuk --- core/mmu.cc| 10

[osv-dev] [PATCH] mprotect: page-align len parameter instead of returning error

2019-06-28 Thread Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk --- libc/mman.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libc/mman.cc b/libc/mman.cc index 73a3f416..bb573a80 100644 --- a/libc/mman.cc +++ b/libc/mman.cc @@ -88,11 +88,12 @@ int mprotect(void *addr, size_t len, int prot

[osv-dev] [PATCH] hpet: handle wrap-around with 32-bit counter

2019-06-28 Thread Waldemar Kozaczuk
This patch enhances the hpet clock with 32-bit main counter to handle wrap-arounds. It does it by maintaining separate upper 32-bit counter and incrementing it when wrap around is detected. Signed-off-by: Waldemar Kozaczuk --- drivers/hpet.cc | 26 +- 1 file changed, 21

[osv-dev] [PATCH] hpet: Enhance 64-bit hpet clock to handle non-monotonic reads of the main counter

2019-06-27 Thread Waldemar Kozaczuk
This patch hardens the implementation of hpet clock with 64-bit counter by enforcing that every read of the main counter is NOT less than the previous value. Fixes #382 Signed-off-by: Waldemar Kozaczuk --- drivers/hpet.cc | 18 -- 1 file changed, 16 insertions(+), 2 deletions

[osv-dev] [PATCH] Make OSv boot as vmlinuz

2019-06-27 Thread Waldemar Kozaczuk
in boot.S. This patch allows OSv to boot on Docker's hyperkit hypervisor. Signed-off-by: Waldemar Kozaczuk --- Makefile | 19 ++-- arch/x64/arch-setup.cc| 4 +++ arch/x64/boot.S | 3 ++ arch/x64/loader.ld| 7 + arch/x64/vmlinuz-boot.ld

[osv-dev] [PATCH V2] hpet: Support 32-bit counter

2019-06-27 Thread Waldemar Kozaczuk
et code to allow for future refinements of both 32-bit and 64-bit implementations independently. Signed-off-by: Waldemar Kozaczuk --- drivers/hpet.cc | 70 + 1 file changed, 47 insertions(+), 23 deletions(-) diff --git a/drivers/hpet.cc b/drivers/hpe

[osv-dev] [PATCH V2] Support local-exec TLS access

2019-06-26 Thread Waldemar Kozaczuk
be sufficient for most applications which either use tiny TLS (Golang uses 8-bytes long) if at all. Rust ELFs tend to rely on quite large TLS in which case the limit in loader.ld needs to be increased accordingly and loader.elf relinked. Fixes #352 Signed-off-by: Waldemar Kozaczuk --- arch/x64

[osv-dev] [PATCH] hpet: Support 32-bit counter

2019-06-26 Thread Waldemar Kozaczuk
This patch adds very limited support of hpets with 32-bit main counter. It also refactors the hpet code to allow for future refinements of both 32-bit and 64-bit implementations independently. Signed-off-by: Waldemar Kozaczuk --- drivers/hpet.cc | 54

[osv-dev] [PATCH V3] Allow running non-PIE executables that do not collide with kernel

2019-06-20 Thread Waldemar Kozaczuk
This patch provides necessary changes to OSv dynamic linker to allow running non-PIEs (Position Dependant Executables) as long as they do not collide in virtual memory with kernel. Fixes #190 Signed-off-by: Waldemar Kozaczuk --- Makefile | 3 ++- core/elf.cc| 45

[osv-dev] [PATCH V2] Allow running non-PIE executables that do not collide with kernel

2019-06-20 Thread Waldemar Kozaczuk
This patch provides necessary changes to OSv dynamic linker to allow running non-PIEs (= Position Dependant Executables) as long as they do not collide in virtual memory with kernel. Fixes #190 Signed-off-by: Waldemar Kozaczuk --- Makefile | 3 ++- core/elf.cc| 35

[osv-dev] [PATCH V2] Move kernel to 0x40200000 address (1 GiB higher) in virtual memory

2019-06-19 Thread Waldemar Kozaczuk
locally in HVM mode Fixes #1043 Signed-off-by: Waldemar Kozaczuk --- Makefile | 7 +- arch/x64/arch-setup.cc| 39 ++ arch/x64/boot.S | 41 +--- arch/x64/entry-xen.S | 3 ++- arch/x64/loader.ld

[osv-dev] [PATCH] Move kernel to 0x40200000 address (1 GiB higher) in virtual memory

2019-06-15 Thread Waldemar Kozaczuk
higher at the end of the 2GiB limit (small memory model) and thus support virtually any non-PIE built using small memory model. Fixes #1043 Signed-off-by: Waldemar Kozaczuk --- Makefile | 6 +++-- arch/x64/arch-setup.cc| 39 +--- arch/x64/boot.S

[osv-dev] [PATCH] Change vmlinux_entry64 to switch to protected mode and jump to start32

2019-06-14 Thread Waldemar Kozaczuk
vmlinux boot code (used with firecracker) by making sure that all data segment registers (ES, DS, etc) are setup correctly to point to OSv GDT table (see start32) which is critical when kernel is not mapped 1:1. Signed-off-by: Waldemar Kozaczuk --- arch/x64/boot.S | 28 +++ arch

[osv-dev] [PATCH] Make rebuilding loader.elf automatic and more efficient when changing kernel_base

2019-06-08 Thread Waldemar Kozaczuk
re-built when kernel_base is changed. Signed-off-by: Waldemar Kozaczuk --- Makefile | 8 ++-- arch/aarch64/arch-dtb.cc | 1 + arch/aarch64/arch.hh | 2 +- arch/x64/arch-setup.cc | 1 + arch/x64/arch.hh | 2 +- arch/x64/boot16.S

[osv-dev] [PATCH] Start using memory below kernel

2019-06-04 Thread Waldemar Kozaczuk
almost 10M of memory. Fixes #1012 Signed-off-by: Waldemar Kozaczuk --- arch/x64/arch-setup.cc | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/x64/arch-setup.cc b/arch/x64/arch-setup.cc index 9317dd25..62236486 100644 --- a/arch/x64/arch-setup.cc +++ b/arch

[osv-dev] [PATCH] Allow running non-PIE executables that do not collide with kernel

2019-06-01 Thread Waldemar Kozaczuk
using -Wl,-Ttext-segment,0x?? option. 2) Change kernel_base in OSv makefile to a higher address that makes it not collide with the executable (for example 0xa0); most non-PIEs by default load at 0x40 Signed-off-by: Waldemar Kozaczuk --- core/elf.cc| 35

[osv-dev] [PATCH] Provide full implementation of epoll_pwait

2019-06-01 Thread Waldemar Kozaczuk
This patch provides full implementation of epoll_pwait and exposes it as a public function which is needed by Node.JS 10. The implementation is modeled after pselect/select. Signed-off-by: Waldemar Kozaczuk --- core/epoll.cc | 11 +++ linux.cc | 14 +- 2 files changed

[osv-dev] [PATCH] Fix slow write/append to files on ramfs

2019-05-21 Thread Waldemar Kozaczuk
is stored by using std::map where keys are file offsets and values are file segments at that offset. This eliminates the need to copy data as well as only allocates enough memory needed for next 10% of file or desired increase. Fixes #884 Signed-off-by: Waldemar Kozaczuk --- fs/ramfs/ramfs.h

[osv-dev] [PATCH V2] Enhanced __fxstata to handle AT_SYMLINK_NOFOLLOW

2019-05-19 Thread Waldemar Kozaczuk
This patch also effectively makes unmodified coreutils find work as expected: ./scripts/manifest_from_host.sh -w find && ./scripts/build fs=rofs --append-manifest ./scripts/run.py -e '/find / -ls' Signed-off-by: Waldemar Kozaczuk --- fs/vfs/main.cc | 11 ++- te

[osv-dev] [PATCH] Move _post_main invocation to run_main

2019-05-19 Thread Waldemar Kozaczuk
This patch also fixes __libc_start_main() used for example by java to terminate any remaining app threads by _post_main. Signed-off-by: Waldemar Kozaczuk --- core/app.cc| 8 include/osv/app.hh | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/app.cc b

[osv-dev] [PATCH] vfs: Harden task_conv() to return EFAULT when cpath argument is null

2019-05-19 Thread Waldemar Kozaczuk
This patch also reverts the commit a0dcf8530c352536ab6633952b6f614f73eed154. Signed-off-by: Waldemar Kozaczuk --- fs/vfs/main.cc | 5 - fs/vfs/vfs_syscalls.cc | 4 fs/vfs/vfs_task.cc | 4 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/fs/vfs/main.cc b

[osv-dev] [PATCH V2] Added option suffix "!" to force termination of remaining application threads

2019-05-19 Thread Waldemar Kozaczuk
one. In order to run unmodified JVM on OSV without OSV 'java wrapper' we need to allow an ability to pass a suffix '!' in command line that gives a hint to OSv to terminate any remaining application threads like so: ./scripts/run.py -e '/usr/bin/java -cp / Hello !' Sig

[osv-dev] [PATCH] Enhanced __fxstata to handle AT_SYMLINK_NOFOLLOW

2019-05-17 Thread Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk --- fs/vfs/main.cc | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/vfs/main.cc b/fs/vfs/main.cc index 889aa268..876ae2ba 100644 --- a/fs/vfs/main.cc +++ b/fs/vfs/main.cc @@ -592,10 +592,6 @@ extern "C" int __fxstat

[osv-dev] [PATCH] Added option suffix "!" to force termination of remaining application threads

2019-05-17 Thread Waldemar Kozaczuk
n order to run unmodified JVM on OSV without OSV 'java wrapper' we need to allows ability to pass a suffix '!' in command line that gives a hint to OSv to terminate any remaining application threads like so: ./scripts/run.py -e '/usr/bin/java -cp / Hello !' Signed-off

[osv-dev] [PATCH] elf: handle new DT_RUNPATH

2019-05-17 Thread Waldemar Kozaczuk
es at run time" under http://man7.org/training/download/shlib_dynlinker_slides.pdf. Fixes #1039 Signed-off-by: Waldemar Kozaczuk --- core/elf.cc| 13 +++-- include/osv/elf.hh | 3 ++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/core/elf.cc b/core/el

[osv-dev] [PATCH] Make RAMFS not to free file data when file is still opened

2019-05-15 Thread Waldemar Kozaczuk
: Waldemar Kozaczuk --- fs/ramfs/ramfs.h| 2 ++ fs/ramfs/ramfs_vnops.cc | 38 +++--- tests/tst-mmap-file.cc | 31 +++ 3 files changed, 68 insertions(+), 3 deletions(-) diff --git a/fs/ramfs/ramfs.h b/fs/ramfs/ramfs.h index 88ccbe72

[osv-dev] [PATCH 2/2 V3] Enhance getopt family of functions to work with PIEs

2019-05-13 Thread Waldemar Kozaczuk
copies of those variables. Fixes #689 Signed-off-by: Waldemar Kozaczuk --- core/elf.cc | 13 +++ include/osv/elf.hh | 4 + libc/misc/getopt.cc | 9 +- libc/misc/getopt.hh | 66 +++ libc/misc/getopt_long.cc | 5 +- modules/tests/Makefile | 9 +-

[osv-dev] [PATCH 2/2 V2] Enhance getopt family of functions to work with PIEs

2019-05-12 Thread Waldemar Kozaczuk
copies of those variables. Fixes #689 Signed-off-by: Waldemar Kozaczuk --- core/elf.cc | 13 +++ include/osv/elf.hh | 4 + libc/misc/getopt.cc | 54 - libc/misc/getopt.hh | 21 libc/misc/getopt_long.cc | 7 +- modules/tests/Makefile | 9 +-

[osv-dev] [PATCH] Fix fopen to return EFAULT when filename is NULL

2019-05-11 Thread Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk --- libc/stdio/fopen.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libc/stdio/fopen.c b/libc/stdio/fopen.c index 83452407..c6053c21 100644 --- a/libc/stdio/fopen.c +++ b/libc/stdio/fopen.c @@ -10,6 +10,11 @@ FILE *fopen(const char *restrict filename

[osv-dev] [PATCH] Simplify building images out of artifacts found on host filesystem

2019-05-09 Thread Waldemar Kozaczuk
e manifest for 'ls' executable and build image Signed-off-by: Waldemar Kozaczuk --- scripts/build | 13 ++- scripts/manifest_from_host.sh | 180 ++ 2 files changed, 192 insertions(+), 1 deletion(-) create mode 100755 scripts/manifest_from_h

[osv-dev] [PATCH] Support local-exec TLS access

2019-05-05 Thread Waldemar Kozaczuk
be sufficient for most applications which either use tiny TLS (Golang uses 8-bytes long) if at all. Rust ELFs tend to rely on quite large TLS in which case the limit in loader.ld needs to be increased accordingly and loader.elf relinked. Fixes #352 Signed-off-by: Waldemar Kozaczuk --- arch/x64

[osv-dev] [PATCH V2] Add GNU libc extension variables __progname and __progname_full

2019-04-30 Thread Waldemar Kozaczuk
This patch adds GNU libc extension variables __progname and __progname_full used by coreutils. These seem to come from BSD as 'BSD' paragraph explains - https://rosettacode.org/wiki/Program_name#C. Signed-off-by: Waldemar Kozaczuk --- libc/libc.cc | 3 +++ 1 file changed, 3 insertion

[osv-dev] [PATCH 2/2] Enhance getopt family of functions to work with PIEs

2019-04-30 Thread Waldemar Kozaczuk
copies of those variables. Fixes #689 Signed-off-by: Waldemar Kozaczuk --- core/elf.cc | 14 +++ include/osv/elf.hh | 4 + libc/misc/getopt.cc | 62 +-- libc/misc/getopt_long.cc | 37 ++- modules/tests/Makefile | 9 +- tests/tst-getopt.cc

[osv-dev] [PATCH 1/2] Move getopt* files to libc folder and convert to C++

2019-04-30 Thread Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk --- Makefile | 4 +-- libc/misc/getopt.cc | 77 libc/misc/getopt_long.cc | 61 +++ 3 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 libc/misc

[osv-dev] [PATCH 0/2] Enhance getopt functions to work with PIEs

2019-04-30 Thread Waldemar Kozaczuk
Waldemar Kozaczuk (2): Move getopt* files to libc folder and convert to C++ Enhance getopt family of functions to work with PIEs Makefile | 4 +- core/elf.cc | 14 +++ include/osv/elf.hh | 4 + libc/misc/getopt.cc | 125 + libc

[osv-dev] [PATCH] Add GNU libc extension variables __progname and __progname_full

2019-04-27 Thread Waldemar Kozaczuk
This patch adds GNU libc extension variables __progname and __progname_full used by coreutils. These seem to come from BSD as 'BSD' paragraph explains - https://rosettacode.org/wiki/Program_name#C. Signed-off-by: Waldemar Kozaczuk --- core/app.cc | 6 -- libc/libc.cc | 4 +++

[osv-dev] [PATCH] Add GNU libc extension function error()

2019-04-27 Thread Waldemar Kozaczuk
This patch adds GNU libc extension function error() as specified at https://linux.die.net/man/3/error. This function is used by core utils programs on Linux. Signed-off-by: Waldemar Kozaczuk --- Makefile | 1 + libc/misc/error.c | 37 + 2 files

[osv-dev] [PATCH] Update nbd_client.py to do newstyle handshake

2019-04-27 Thread Waldemar Kozaczuk
qemu-nbd as of QEMU 3.1.5 stopped supporting old style of handshake. This patch updates nbd_client.py to use new handshake. Signed-off-by: Waldemar Kozaczuk --- scripts/nbd_client.py | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/scripts/nbd_client.py

[osv-dev] [PATCH V2] Changed loader to print total boot time by default

2019-03-25 Thread Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk --- core/chart.cc | 7 +++ include/osv/boot.hh | 1 + loader.cc | 3 +++ 3 files changed, 11 insertions(+) diff --git a/core/chart.cc b/core/chart.cc index 59311a93..c3355907 100644 --- a/core/chart.cc +++ b/core/chart.cc @@ -45,3 +45,10

[osv-dev] [PATCH] Changed loader to print total boot time by default

2019-03-25 Thread Waldemar Kozaczuk
--- core/chart.cc | 7 +++ include/osv/boot.hh | 1 + loader.cc | 3 +++ 3 files changed, 11 insertions(+) diff --git a/core/chart.cc b/core/chart.cc index 59311a93..c3355907 100644 --- a/core/chart.cc +++ b/core/chart.cc @@ -45,3 +45,10 @@ void boot_time_chart::print_chart()

[osv-dev] [PATCH] Refactor and enhance firecracker script

2019-03-24 Thread Waldemar Kozaczuk
This patch: - refactors firecracker.py to better handle error scenarios - adds ability to use external networking bridge through -b parameter (see scripts/setup-external-bridge.sh) - adds ability to specify custom location of kernel and image files Signed-off-by: Waldemar Kozaczuk --- scripts

[osv-dev] [PATCH] Add script to setup external bridge

2019-03-24 Thread Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk --- scripts/setup-external-bridge.sh | 27 +++ 1 file changed, 27 insertions(+) create mode 100755 scripts/setup-external-bridge.sh diff --git a/scripts/setup-external-bridge.sh b/scripts/setup-external-bridge.sh new file mode 100755

[osv-dev] [PATCH V2] Add virtio mmio implementation

2019-03-03 Thread Waldemar Kozaczuk
Adds implementation of virtio mmio devices needed to support block and networking devices on firecracker. Signed-off-by: Waldemar Kozaczuk --- Makefile | 1 + arch/x64/arch-setup.cc | 5 + drivers/virtio-mmio.cc | 216 + drivers/virtio

[osv-dev] [PATCH] Refactor vmlinux boot code

2019-03-03 Thread Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk --- Makefile | 2 + arch/x64/arch-setup.cc| 124 +- arch/x64/arch-setup.hh| 39 arch/x64/boot.S | 55 + arch/x64/loader.ld| 2 +- arch/x64/setup.S

[osv-dev] [PATCH] Enhance SMP logic to parse MP table

2019-03-01 Thread Waldemar Kozaczuk
Adds logic to parse information about CPUs on system where ACPI is not available. It does it by parsing so called MP table. If MP table not found assumes single vCPU. Signed-off-by: Waldemar Kozaczuk --- arch/x64/smp.cc | 125 ++-- 1 file changed, 111

[osv-dev] [PATCH] Add virtio mmio implementation

2019-03-01 Thread Waldemar Kozaczuk
Adds implementation of virtio mmio devices needed to support block and networking devices on firecracker. Signed-off-by: Waldemar Kozaczuk --- Makefile | 1 + arch/x64/arch-setup.cc | 5 + drivers/virtio-mmio.cc | 213 + drivers/virtio

[osv-dev] [PATCH] Clean virtio code

2019-03-01 Thread Waldemar Kozaczuk
edge interrupt handlers that will be used by virtio mmio drivers code in next patch Signed-off-by: Waldemar Kozaczuk --- drivers/virtio-blk.cc| 46 drivers/virtio-blk.hh| 20 +--- drivers/virtio-device.hh | 4 drivers

[osv-dev] [PATCH] Add missing readlinkat function and corresponding syscall

2019-02-24 Thread Waldemar Kozaczuk
Fixes #956 Signed-off-by: Waldemar Kozaczuk --- fs/vfs/main.cc | 33 + linux.cc | 1 + 2 files changed, 34 insertions(+) diff --git a/fs/vfs/main.cc b/fs/vfs/main.cc index 7cc4291d..4adf4434 100644 --- a/fs/vfs/main.cc +++ b/fs/vfs/main.cc @@ -1760,6

[osv-dev] [PATCH V2] Add python script to run OSv on fireracker

2019-02-22 Thread Waldemar Kozaczuk
This patch adds simple Python script that allows booting OSv loader.elf on firecracker. It also automates process of downloading and installing firecracker. Evenntually it might be incorporated into scripts/run.py Signed-off-by: Waldemar Kozaczuk --- scripts/firecracker.py | 126

[osv-dev] [PATCH V2] Make OSv boot without ACPI present

2019-02-22 Thread Waldemar Kozaczuk
probing panic driver as it relies on ACPI as well. Lastly we skip MADT table parsing if APCI is off and for now assume there is single vCPU only. Eventually we should parse vCPU information from MP table as an alternative. Signed-off-by: Waldemar Kozaczuk --- arch/x64/power.cc | 30

[osv-dev] [PATCH] Add python script to run OSv on fireracker

2019-02-20 Thread Waldemar Kozaczuk
This patch adds simple Python script that allows booting OSv loader.elf on firecracker. It also automates process of downloading and installing firecracker. Evenntually it might be incorporated into scripts/run.py Signed-off-by: Waldemar Kozaczuk --- scripts/firecracker.py | 100

[osv-dev] [PATCH] Make OSv bootable as a Linux 64-bit ELF

2019-02-20 Thread Waldemar Kozaczuk
This patch makes all necessary changes to OSv boot logic to make it bootable on firecracker. Please note that until we add virtio-mmio support we can only boot ramfs images on firecracker like so: ./scripts/build fs=ramfs image=native-example Signed-off-by: Waldemar Kozaczuk --- arch/x64/arch

[osv-dev] [PATCH] Make OSv boot without ACPI present

2019-02-19 Thread Waldemar Kozaczuk
probing panic driver as it relies on ACPI as well. Lastly we skip MADT table parsing if APCI is off and for now assume there is single vCPU only. Eventually we should parse vCPU information from MP table as an alternative. Signed-off-by: Waldemar Kozaczuk --- arch/x64/power.cc | 26

[osv-dev] [RFC] Remaining work to support OSv on firecracker

2019-02-10 Thread Waldemar Kozaczuk
time end Signed-off-by: Waldemar Kozaczuk --- Makefile | 1 + arch/x64/arch-setup.cc | 180 - arch/x64/boot.S| 37 - arch/x64/loader.ld | 2 +- arch/x64/power.cc | 14 +--- arch/x64/smp.cc| 16 +++- drivers

[osv-dev] [PATCH] Enhance scripts/test.py to pass extra arguments to run.py

2019-02-08 Thread Waldemar Kozaczuk
./scripts/test.py --run_options '--virtio modern' ./scripts/test.py --run_options '--virtio modern -S' Signed-off-by: Waldemar Kozaczuk --- scripts/test.py | 8 +++- scripts/tests/testing.py | 10 +++--- 2 files changed, 14 insertions(+), 4 deletions(-)

[osv-dev] [PATCH] Implemented modern virtio PCI device

2019-02-06 Thread Waldemar Kozaczuk
transitional devices simulated by QEMU by passing correct value of a new '--virtio' parameter to scripts/run.py. Signed-off-by: Waldemar Kozaczuk --- drivers/pci-function.cc | 16 ++- drivers/pci-function.hh | 2 + drivers/virtio-blk.cc| 22 - drivers/virtio-device.hh

[osv-dev] [PATCH] Add option to run OSv with legacy or modern virtio

2019-02-05 Thread Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk --- scripts/run.py | 24 +++- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/scripts/run.py b/scripts/run.py index 92cd4e5f..17a21298 100755 --- a/scripts/run.py +++ b/scripts/run.py @@ -124,7 +124,7 @@ def start_osv_qemu

[osv-dev] [PATCH V2] Refactor virtio layer to support modern PCI and mmio devices

2019-02-05 Thread Waldemar Kozaczuk
removes some unused code. Signed-off-by: Waldemar Kozaczuk --- Makefile | 1 + drivers/pci-generic.cc | 25 +- drivers/virtio-blk.cc| 37 +--- drivers/virtio-blk.hh| 6 +- drivers/virtio-device.hh | 86 ++ drivers/virtio

[osv-dev] [PATCH V2] Reset FPU state after saving it and upon context switch

2019-01-28 Thread Waldemar Kozaczuk
n over 100 successful test runs where it would crash almost every time Fixes #1018 - based on over successful 50 test runs with /os/threads API being used in tight loop and before patch would crash sporadically Signed-off-by: Waldemar Kozaczuk --- arch/x64/arch-cpu.hh| 5 +++ arch/x64/arch-swit

[osv-dev] [PATCH] Add sys_exit_group syscall used by golang

2019-01-25 Thread Waldemar Kozaczuk
OSv is a unikernel and exit() in OSv terminates both app and kernel, it makes sense for sys_exit_group() do the same thing. Signed-off-by: Waldemar Kozaczuk --- linux.cc | 8 1 file changed, 8 insertions(+) diff --git a/linux.cc b/linux.cc index d548db93..1eff6ffc 100644 --- a/linux.cc

[osv-dev] [PATCH] Add scripts helping to automate testing of FPU-related bugs

2019-01-25 Thread Waldemar Kozaczuk
THIS is just for testing -> is not meant to be applied to OSv github tree. Helps recreating and testing issues #536, #1010 and #1018 Signed-off-by: Waldemar Kozaczuk --- fpu_test_scripts/poll_threads.sh | 16 + fpu_test_scripts/run_cassandra.sh |

[PATCH] Delete assigned_virtio driver

2019-01-18 Thread Waldemar Kozaczuk
and virtio MMIO devices, we have decided to remove it from OSv codebase. In future if somebody finds it useful again we will bring it back and adjust accordingly. Signed-off-by: Waldemar Kozaczuk --- Makefile | 1 - arch/x64/arch-setup.cc | 9 +- drivers/virtio-assi

[RFC] Support firecracker - addendum

2019-01-17 Thread Waldemar Kozaczuk
Tweaked virtio device initialization to conform to more stricter enforcement of protocol on firecracker side Makes OSv boot on newest firecracker. Signed-off-by: Waldemar Kozaczuk --- drivers/virtio-blk.cc | 5 - drivers/virtio-net.cc | 21 ++--- drivers/virtio-net.hh | 7

[PATCH] Refactor virtio layer to support modern PCI and mmio devices

2019-01-15 Thread Waldemar Kozaczuk
creating/registering proper interrupt logic for each transport. Signed-off-by: Waldemar Kozaczuk --- Makefile | 1 + drivers/device.hh| 2 + drivers/pci-generic.cc | 25 +++- drivers/virtio-assign.cc | 40 ++- drivers/virtio-blk.cc| 29

[RFC] Support firecracker

2019-01-04 Thread Waldemar Kozaczuk
tmp/firecracker.socket -i \ -X PUT 'http://localhost/actions' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json'\ -d '{ "action_type": "InstanceStart" }' Signed-off-by:

[PATCH] Reset FPU state after saving it and upon context switch

2018-12-19 Thread Waldemar Kozaczuk
most every time Fixes #1018 - based on over successful 50 test runs with /os/threads API being used in tight loop and before patch would crash sporadically Signed-off-by: Waldemar Kozaczuk --- arch/x64/arch-cpu.cc| 10 ++ arch/x64/arch-switch.hh | 8 + modules/tests/Makefile | 4

[PATCH] Reset FPU state after saving it and upon context switch

2018-12-16 Thread Waldemar Kozaczuk
most every time Fixes #1018 - based on over successful 50 test runs with /os/threads API being used in tight loop and before patch would crash sporadically Signed-off-by: Waldemar Kozaczuk --- arch/x64/arch-cpu.cc| 10 ++ arch/x64/arch-switch.hh | 10 +- modules/tests/Makefile | 4

[RFC] Implemented read-only subset of SMB2/3 filesystem

2018-12-12 Thread Waldemar Kozaczuk
order to use it one needs to as smbfs to an image and then mount desired share by using REST app API (see mount-samba.sh) or add an init script to call mount-fs.so. Signed-off-by: Waldemar Kozaczuk --- Makefile | 3 +- fs/smbfs/smbfs_null_vfsops.cc

[PATCH V3] Implement more space-efficient early memory allocation scheme

2018-12-11 Thread Waldemar Kozaczuk
around 125K and new scheme uses ~44 pages (176K) of memory to satisfy all requests. With this patch it is possible to run native example with 18.5M of memory: ./scripts/build -j6 fs=rofs image=native-example ./scripts/run.py -c 1 -m 19M Fixes #270 Signed-off-by: Waldemar Kozaczuk --- core/memp

[PATCH V2] Implement more space-efficient early memory allocation scheme

2018-12-09 Thread Waldemar Kozaczuk
around 125K and new scheme uses ~44 pages (176K) of memory to satisfy all requests. Fixes #270 Signed-off-by: Waldemar Kozaczuk --- core/mempool.cc| 144 - include/osv/mempool.hh | 10 +++ 2 files changed, 152 insertions(+), 2 deletions(-) diff -

[PATCH v2] Add libc aliases to some mathematical functions

2018-11-22 Thread Waldemar Kozaczuk
would avoid unnecessary instructions involved in calling a function. Signed-off-by: Waldemar Kozaczuk --- Makefile| 1 + libc/math/aliases.c | 26 ++ 2 files changed, 27 insertions(+) create mode 100644 libc/math/aliases.c diff --git a/Makefile b/Makefile

[PATCH] Implement more space-efficient early memory allocation scheme

2018-11-21 Thread Waldemar Kozaczuk
around 125K and new scheme uses ~44 pages (176K) of memory to satisfy all requests. Fixes #270 Signed-off-by: Waldemar Kozaczuk --- core/mempool.cc| 133 - include/osv/mempool.hh | 5 ++ 2 files changed, 136 insertions(+), 2 deletions(-) diff -

[PATCH] Add libc aliases to some mathematical functions

2018-11-21 Thread Waldemar Kozaczuk
unnecessary instructions involved in calling a function. Signed-off-by: Waldemar Kozaczuk --- Makefile | 5 + libc/math/exp.c | 6 ++ libc/math/log.c | 6 ++ libc/math/log10.c | 6 ++ libc/math/log2.c | 6 ++ libc/math/pow.c | 6 ++ 6 files changed, 35

[PATCH] Refine tst-small-malloc to check alignment

2018-11-21 Thread Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk --- core/mempool.cc | 2 +- tests/tst-small-malloc.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/mempool.cc b/core/mempool.cc index 23dc67da..102e4e6e 100644 --- a/core/mempool.cc +++ b/core/mempool.cc @@ -1547,7

[PATCH] Refine malloc pool allocations to accomodate more edge cases

2018-11-20 Thread Waldemar Kozaczuk
scenarios. Signed-off-by: Waldemar Kozaczuk --- core/mempool.cc | 13 +++--- tests/tst-small-malloc.cc | 52 ++- 2 files changed, 49 insertions(+), 16 deletions(-) diff --git a/core/mempool.cc b/core/mempool.cc index deb7a0bb..23dc67da 100644 --- a/core

[PATCH] Handle small memory allocations ( < 16 bytes) more space efficiently

2018-11-16 Thread Waldemar Kozaczuk
#1011 Signed-off-by: Waldemar Kozaczuk --- core/mempool.cc | 5 +++-- modules/tests/Makefile| 2 +- tests/tst-small-malloc.cc | 45 +++ 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 tests/tst-small-malloc.cc diff --git

[RFC] Partially fix soabort() to not free freed socket

2018-11-04 Thread Waldemar Kozaczuk
Signed-off-by: Waldemar Kozaczuk --- bsd/sys/kern/uipc_socket.cc | 11 +++ bsd/sys/net/raw_usrreq.cc | 3 ++- bsd/sys/net/rtsock.cc | 5 ++--- bsd/sys/netinet/raw_ip.cc | 3 ++- bsd/sys/netinet/tcp_usrreq.cc | 6 -- bsd/sys/netinet/udp_usrreq.cc | 3 ++- bsd

[PATCH V2] Support non-fPIC shared objects

2018-10-29 Thread Waldemar Kozaczuk
. Eventually it fixes permissions of PT_LOAD sections to make it non-writable. This patch most notably allows to run GraalVM generated Java apps. Fixes #1004 Signed-off-by: Waldemar Kozaczuk --- core/elf.cc| 47 +++--- include/osv/elf.hh | 5

[PATCH] Support non-fPIC shared objects

2018-10-24 Thread Waldemar Kozaczuk
it fixes permissions of PT_LOAD sections to make it non-writable. This patch most notably allows to run GraalVM generated Java apps. Fixes #1004 Signed-off-by: Waldemar Kozaczuk --- core/elf.cc| 47 +++--- include/osv/elf.hh | 5 - modules

[PATCH] Disable linking libgcc.a with --whole-archive option

2018-10-12 Thread Waldemar Kozaczuk
be565320c082c00069614c850d29b42831b3dea6 Signed-off-by: Waldemar Kozaczuk --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 44a86c01..2270206b 100644 --- a/Makefile +++ b/Makefile @@ -1869,9 +1869,9 @@ $(out)/loader.elf: $(stage1_targets) arch/$(arch)/loader.ld $(out

[PATCH] Enhance multiboot mode

2018-09-16 Thread Waldemar Kozaczuk
can boot and execute in around 50ms. This is an example of how to execute OSv on hyperkit: hyperkit -A -m 512M \ -s 0:0,hostbridge \ -s 31,lpc \ -l com1,stdio \ -s 4,virtio-blk,build/release/usr.img \ -f multiboot,build/release/loader.bin,,'/hello.so' Signed-off-by: Waldema

[PATCH V2] Implemented almost-in-place kernel decompression

2018-09-08 Thread Waldemar Kozaczuk
lzkernel_base to build bigger ramfs images. Fixes #985 Signed-off-by: Waldemar Kozaczuk --- Makefile| 12 ++- arch/x64/lzloader.ld| 1 + fastlz/fastlz.h | 20 +++ fastlz/lz.cc| 69 ++--- fastlz

[PATCH V4] Changed syscall stack implementation to use mmap

2018-09-06 Thread Waldemar Kozaczuk
logic to setup large stack. Signed-off-by: Waldemar Kozaczuk --- arch/x64/arch-switch.hh | 55 +++-- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/arch/x64/arch-switch.hh b/arch/x64/arch-switch.hh index e376954..223e4db 100644 --- a

[PATCH V3] Changed syscall stack implementation to use mmap

2018-09-06 Thread Waldemar Kozaczuk
logic to setup large stack. Signed-off-by: Waldemar Kozaczuk --- arch/x64/arch-switch.hh | 52 + 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/arch/x64/arch-switch.hh b/arch/x64/arch-switch.hh index e3769540..817ea7ed 100644 --- a/arch/x64

[PATCH V2] Changed syscall stack implementation to use mmap

2018-09-06 Thread Waldemar Kozaczuk
logic to setup large stack. Signed-off-by: Waldemar Kozaczuk --- arch/x64/arch-switch.hh | 50 + 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/arch/x64/arch-switch.hh b/arch/x64/arch-switch.hh index e3769540..12766877 100644 --- a/arch/x64

[PATCH] Changed syscall stack implementation to use mmap

2018-09-05 Thread Waldemar Kozaczuk
logic to setup large stack. Tiny stack had to be increased to 4096 bytes to accomodate mmap call. Signed-off-by: Waldemar Kozaczuk --- arch/x64/arch-switch.hh | 40 ++-- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/arch/x64/arch-switch.hh b

[PATCH V2] Revive multiboot mode

2018-08-31 Thread Waldemar Kozaczuk
multiboot info structure into the low memory. Signed-off-by: Waldemar Kozaczuk --- Makefile | 5 +++-- arch/x64/boot32.S | 2 +- scripts/run.py| 16 ++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 770b28d0..0ca95c64 100644

[PATCH] Revive multiboot mode

2018-08-30 Thread Waldemar Kozaczuk
multiboot info structure in low memory. Signed-off-by: Waldemar Kozaczuk --- Makefile | 5 +++-- arch/x64/boot32.S | 2 +- scripts/run.py| 10 ++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 770b28d0..0ca95c64 100644 --- a/Makefile

[PATCH V3] Relax ELF symbol resolution failure when BIND_NOW

2018-08-29 Thread Waldemar Kozaczuk
referenced later. So in essence we are postponing abort until absolutely necessary. Fixes #993 Signed-off-by: Waldemar Kozaczuk --- arch/aarch64/arch-elf.cc | 11 --- arch/x64/arch-elf.cc | 11 --- core/elf.cc | 21 - include/osv/elf.hh

[PATCH V2] Relax ELF symbol resolution failure when BIND_NOW

2018-08-28 Thread Waldemar Kozaczuk
referenced later. So in essence we are postponing abort until absolutely necessary. Fixes #993 Signed-off-by: Waldemar Kozaczuk --- arch/aarch64/arch-elf.cc | 11 --- arch/x64/arch-elf.cc | 11 --- core/elf.cc | 22 +- include/osv/elf.hh |

[PATCH] Optimize bootfs memory utilization

2018-08-23 Thread Waldemar Kozaczuk
likely not aligned which possibly means slower access. This could be improved by making individual files aligned in bootfs.bin. Fixes #977 Signed-off-by: Waldemar Kozaczuk --- fs/ramfs/ramfs.h| 1 + fs/ramfs/ramfs_vnops.cc | 38 ++ fs/vfs/main.cc

<    1   2   3   4   5   6   7   >