- Oct 30, 2013
-
-
Avi Kivity authored
The TLS segment is a little wierd in that it grows backwards from percpu_base instead of forwards. This causes the alignment code to calculate wrong offsets when the segment size is 8 (mod 16). A failure was seen where ::percpu_base was set at offset 0xfffffffffffffa08 in code that was in the same translation unit as ::percpu_base, and 0xfffffffffffffa10 elsewhere. This caused all dynamic_percpu instances to crash. Fix by aligning the segment size. For good measure, align also the segment base, both to a cacheline boundary. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Oct 29, 2013
-
-
Tomasz Grabiec authored
When system classloader is used as a parent some of its protected methods are called to lookup resources. This also adds delegation for all remaining protected and public methods. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
Tomasz Grabiec authored
Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
Tomasz Grabiec authored
Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
Tomasz Grabiec authored
Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
Tomasz Grabiec authored
Fix 1. Renaming existing directory to existing file when the destination path has trailing slash should fail: rename("/tmp/dir", "/tmp/file/") == -1 && errno == ENOTDIR Fix 2. Renaming exisitng directory to nonexisting path when the path has trailing slash should succeed: rename("/tmp/dir", "/tmp/im_missing/") == 0 Fix 3. Renaming exisitng file to nonexisting path when the path has trailing slash should fail: rename("/tmp/file", "/tmp/im_missing/") == -1 && errno == ENOTDIR Reference: http://pubs.opengroup.org/onlinepubs/9699919799/functions/rename.html This change also adds a bunch of test cases for various conditions mentioned in the spec. Note that for some cases where the raname() should fail there are discrepancies between Linux and OSv in error codes set by the call. To my understanding, the spec is ambiguous. There are conditions which match more than one error code description. The tests are therefore allowing the call to set error code from a set of matching error codes (eg. both EEXIST and ENOTEMPTY are allowed when applicable). If we decide that OSv should return exactly the same error codes as Linux for the same conditions, this can be changed later. vfs: rename() should fail if paths differ only with trailing slash This should fail: rename("/tmp/file", "/tmp/file/") Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
Tomasz Grabiec authored
The call to namei("/dir/file/") currently fails with ENOENT when "/dir/file" exists. A more standard way is to return ENOTDIR instead. This way calls to stat, open, rename, etc. will be in line with the POSIX spec. It is also useful to rename() implementation which needs to differentiate behaviour between the case in which target does not exist and the case in which it does but the path has trailing slash and the last component is not a directory. In addition to that the check was performed in an inconsistent matter - only when dentry lookup failed. This change makes the check performed always. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
Tomasz Grabiec authored
Renaming to destination which is a substring of the source path but not its parent should succeed: rename("/tmp/one_two", "/tmp/one") == 0 Renaming to a child should fail: rename("/tmp/", "/tmp/child") == -1 && errno = EINVAL Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
Avi Kivity authored
When converting a source file from .c to .cc, make will complain that the old source file was missing. This is annoying, especially when bisecting or compile-testing a patch set. Fix by removing the source file dependency. Since the dependency is alread specified explicitly by the makefile, no information is lost. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Benoît Canet authored
The sched::timer set() function expects an absolute time value. Fix an incorret use of it AcpiOsWaitSemaphore(). Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Tomasz Grabiec authored
Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
- Oct 28, 2013
-
-
Avi Kivity authored
The expression *p >> 24, where p is an unsigned*, is optimized by the compiler to *((u8*)p + 3) - reading the most significant byte only and dropping the shift. When this optimization is applied to reading the APIC ID, QEMU returns zero for all processors, since the manual requires reading entire words. Fix by using a volatile pointer, disabling the optimization. Note that QEMU is technically correct here though it violates all known real x86 implementations. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
xapic::init_ipi() shifts apic_id by 24, unaware that xapic::ipi will do it again. The result is that the boot processor is reset instead of the auxiliary processor. Remove the extraneous shift. Found by booting with QEMU without kvm. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Pekka Enberg authored
Spotted by GCC with '-Wformat=1': ../../drivers/xenfront-xenbus.cc: In function ‘XenbusState xenbus_get_state(device_t)’: ../../drivers/xenfront-xenbus.cc:219:80: warning: format ‘%d’ expects argument of type ‘int*’, but argument 6 has type ‘XenbusState* {aka xenbus_state*}’ [-Wformat=] xs_scanf(XST_NIL, dev->get_node_path().c_str(), "state", NULL, "%d", &state); Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Spotted by GCC with '-Wformat=1': ../../bsd/sys/netinet/tcp_subr.c: In function ‘tcp_log_addr’: ../../bsd/sys/netinet/tcp_subr.c:2286:3: warning: unknown conversion type character ‘b’ in format [-Wformat=] sprintf(sp, " tcpflags 0x%b", th->th_flags, PRINT_TH_FLAGS); ^ ../../bsd/sys/netinet/tcp_subr.c:2286:3: warning: too many arguments for format [-Wformat-extra-args] BSD has some nice printf extension for printing out bitfields. We don't so switch to hexadecimal output. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Add 'werror' option to Makefile that can be used to disable the -Werror GCC option temporarily as follows: make werror=0 This is useful when fixing up build breakage caused by addition of new default compiler warnings. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Spotted by Clang: In file included from ../../loader.cc:27: In file included from ../../drivers/virtio-net.hh:12: In file included from ../../bsd/sys/net/if_var.h:80: In file included from ../../bsd/sys/sys/mbuf.h:40: In file included from ../../bsd/porting/uma_stub.h:161: ../../include/osv/percpu.hh:35:42: error: arithmetic on a pointer to void return reinterpret_cast<T*>(base + offset); ~~~~ ^ Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
smp doesn't currently work on non-accelerated qemu, and doesn't help anyway during mkfs. Restrict ourselves to 1 vcpu to avoid problems. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Oct 27, 2013
-
-
Dmitry authored
This patch fixes regression in d2397b7e. dlopen() must return NULL in case of error, pointer to shared_ptr holding NULL returned instead. Signed-off-by:
Dmitry <dmitry@daynix.com>
-
Benoît Canet authored
Follow section 3.1.5 of RFC2131. Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Benoît Canet authored
The new behavior wait for the DHCP_ACK to be received by OSv to configure the network parameters. Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Benoît Canet authored
Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Nadav Har'El authored
Commit 7fc023e8 fixed issue #64, and made unhandled exceptions work correctly. This patch adds a test to tst-except.cc to test this - that an unhandled exception really does call the custom termination handler that the C++ standard allows to set (before the above commit, this test would hang). Unfortunately, gcc's libsupc++ tries very hard to ensure that the terminination handler really does abort - if the handler returns, or throws an exception, the library nevertheless aborts. So we need to trick it with an ugly longjmp to make this test be able to complete without aborting the system. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
- Oct 25, 2013
-
-
Or Cohen authored
Some distributions have enabled gcc -Wformat-security by default. This causes the build to raise format warnings even though -Wformat=0 is used. Setting no-format-security for build consistency between distros. Signed-off-by:
Or Cohen <orc@fewbytes.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Run 'dos2unix' on the sucker... Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
C++ does not allow reinterpret_cast in constant expressions: http://stackoverflow.com/questions/10369606/constexpr-pointer-value GCC doesn't enforce it but Clang does. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Tomasz Grabiec authored
The current implementation was copying the whole file contents into an array and then into stringstream which under the hood copied it again into even bigger array. These allocations were causing memory fragmentation which some times led to malloc failure. The new approach is using fixed amount of memory. For each file it wraps the cpio input stream in a restricted stream which limits the amount of data that can be read from it so that it represents a view for only that file's data. After the consumer has read it we simply ignore the remaining padding from the cpio stream. This fixes issue #66 Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
- Oct 24, 2013
-
-
Avi Kivity authored
Sometimes nc picks ipv6, which isn't supported; force it to use ipv4. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Benoît Canet authored
Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Benoît Canet authored
Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Benoît Canet authored
The initialization is done a this time so everything needed is ready. Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Benoît Canet authored
These are the two missing functions for ACPICA be able to initialize fully. Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Benoît Canet authored
Start to fill the missing ACPICA OSv primitives in order to be able to fully initialize ACPICA for use in drivers probe functions. Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Or Cohen authored
OpenSolaris version of strftime accepts (char *)0 as format, and translates it to the locale default, which is the same as "%c" for strftime(). http://www.unix.com/man-page/opensolaris/3/strftime/ Signed-off-by:
Or Cohen <orc@fewbytes.com>
-
Or Cohen authored
Signed-off-by:
Or Cohen <orc@fewbytes.com>
-
Or Cohen authored
Signed-off-by:
Or Cohen <orc@fewbytes.com>
-
Tomasz Grabiec authored
For example, assuming the following file exists: /tmp/dir/x ..the following was sondiered absent: /tmp/dir/ ..this was considered present: /tmp/dir Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
Tomasz Grabiec authored
This happens when you move a file to a different directory. Thread 2 (Thread 2): 1 0x000000000032ed3b in halt_no_interrupts () at ../../arch/x64/processor.hh:239 osv::halt () at ../../core/power.cc:28 2 0x000000000020e7fe in abort ( msg=msg@entry=0x580160 "page fault outside application") at ../../runtime.cc:109 3 0x00000000002ecfdc in page_fault (ef=0xffffc0003e362008) at ../../core/mmu.cc:981 4 <signal handler called> 5 merge (b=0xffffc0003b4e8000, a=0xfffffffffffffff8) at ../../core/mempool.cc:421 6 memory::free_page_range_locked (range=range@entry=0xffffc0003b4e8000) at ../../core/mempool.cc:436 7 0x00000000003186d7 in memory::free_page_range ( range=range@entry=0xffffc0003b4e8000) at ../../core/mempool.cc:448 8 0x0000000000319280 in free_large (obj=0xffffc0003b4e9000) at ../../core/mempool.cc:460 9 std_free (object=0xffffc0003b4e9000) at ../../core/mempool.cc:790 10 free (obj=0xffffc0003b4e9000) at ../../core/mempool.cc:892 11 0x0000000000340e52 in ramfs_free_node (np=np@entry=0xffffc0003d250d40) at ../../fs/ramfs/ramfs_vnops.c:78 12 0x0000000000340ed2 in ramfs_remove_node (dnp=0xffffc0003d250a00, np=0xffffc0003d250d40) at ../../fs/ramfs/ramfs_vnops.c:131 13 0x0000000000340ffd in ramfs_rename (dvp1=0xffffc0003fc9a180, vp1=0xffffc0003fc9a100, name1=<optimized out>, dvp2=0xffffc0003fc9a280, vp2=<optimized out>, name2=0x2000001fedf1 "prefix_suffix") at ../../fs/ramfs/ramfs_vnops.c:380 14 0x0000000000340069 in sys_rename (src=<optimized out>, dest=<optimized out>) at ../../fs/vfs/vfs_syscalls.c:671 15 0x000000000033a3b2 in rename (oldpath=<optimized out>, newpath=0xffffc0003e858cc0 "/tmp/t3-26e1b47c/prefix_suffix") at ../../fs/vfs/main.cc:634 Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com>
-
Pekka Enberg authored
Spotted by Clang: ../../drivers/vga.hh:15:18: error: 'VGAConsole::write' hides overloaded virtual function [-Werror,-Woverloaded-virtual] virtual void write(const char *str); ^ ../../drivers/console.hh:16:18: note: hidden overloaded virtual function 'Console::write' declared here: different number of parameters (2 vs 1) virtual void write(const char *str, size_t len) = 0; ^ Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-