- Sep 08, 2013
-
-
Avi Kivity authored
The shell call to stat(1) is evaluted when the rule to build the image is triggered, at which point loader-stripped.elf does not exist yet. This causes stat to fail and the build to break. Fix by moving the creation of loader-stripped.elf to its own target, so that by the time the recipe is evaluated, the file is known to exist.
-
- Sep 06, 2013
-
-
Or Cohen authored
Changed "$[]" to "$(())" when calculating zfs start/size
-
- Sep 05, 2013
-
-
Glauber Costa authored
-
Glauber Costa authored
We cannot read the partition table from the device if the device is not marked as ready, since all IO will stall. I believe it should be fine to just mark the device ready before we mark our state as connected. With that change, it all proceed normally.
-
Glauber Costa authored
I would like to call read_partition_table automatically from device_register, which would guarantee that every device that comes up have its partitions scanned. Although totally possible on KVM, it is not possible on Xen, due to the assynchronous nature of the bringup protocol: the device is exposed and created in a moment where IO is not yet possible, so reading the partition table will fail. Just read them both from the drivers when we are sure the driver is ready.
-
Glauber Costa authored
This code, living in device.c for maximum generality, will read the partition table from any disk that calls it. Ideally, each new device would have its own private data. But that would mean having to callback to the driver to set each of the partitions up. Therefore, I found it easier to convention that all partitions in the same drive have the same private data. This makes some sense if we consider that the hypervisors are usually agnostic about partitions, and all of the addressing and communications go through a single entry point, which is the disk.
-
Glauber Costa authored
To support multiple partitions to a disk, I found it easier to add a post-processing offset calculation to the bio just before calling the strategy. The reason is, we have many (really many) entry points for bio preparation (pre-strategy) and only two entry points for the strategy itself (the drivers). Since multiplex_strategy is a good thing to be used even for virtio (although I am not converting it now), since it allows for arbitrary sized requests, we could very well reduce it to just one. At this moment, the offset is always 0 and everything works as before.
-
Glauber Costa authored
Currently we get it from the private data, but since I plan to use the same private data for all partitions, we need a unique value, that already exists in the device. So use it.
-
Glauber Costa authored
Because we will be copying the bootloader code to the beginning of the disk, make sure we won't step over the partition table space. This is technically not needed if the code is small enough, but this guard code will 1) make sure that doesn't happen, and 2) make sure the space is zeroed out. The signature though, is needed, and is set to the bytes "O", "S" and "V", which will span VSO in the end.
-
Glauber Costa authored
Given a partition size and start address, this will edit the image passed as parameter to create a partition entry. This assumes the disk is always bigger than 8Gb while setting the CHS address. From osdev wiki: "For drives smaller than 8GB, the LBA fields and the CHS fields must "match" when the values are converted into the other format. For drives bigger than 8GB, generally the CHS fields are set to Cylinder = 1023, Head = 254 or 255, Sector = 63 -- which is considered an invalid setting."
-
Glauber Costa authored
This is the size that goes in our bootloader count32. But since we will be copying over the stripped binary anyway, we are probably reading too much data, for no reason. That should increase boot time a bit.
-
Glauber Costa authored
It currently sits in the middle of the partition table. Move it to a safer location.
-
Glauber Costa authored
This patch implement the HPET clock driver, that should work as a fallback for both Xen and KVM, in case the paravirtual clock is not present. This is unfortunately the situation for all HVM guests running on EC2, so support for this is paramount. I have tested on KVM forcing the kvmclock to disappear, and it seems to work all right.
-
Glauber Costa authored
Right now we are doing it right before we parse the MADT, but this is by far not MADT specific. Other users are planned, and the best way to resolve the disputes is to have it in a separate constructor
-
Glauber Costa authored
-
- Sep 04, 2013
-
-
Pekka Enberg authored
As a cleanup, use wait_for_queue() like virtio-net does.
-
- Sep 03, 2013
-
-
Avi Kivity authored
In an attempt to be clever, we define irq_lock as an object in an anonymous namespace, so that each translation unit gets its own copy, which is then optimized away, since the object is never touched. But the compiler complains that the object is defined but not used if we include the file but don't use irq_lock. Simplify by only declaring the object there, and defining it somewhere else.
-
Pekka Enberg authored
They are needed by the JVM when "-javaagent" command line option is used. After this patch, the jamm memory meter javaagent can be enabled for Cassandra.
-
Pekka Enberg authored
-
Pekka Enberg authored
If "-javaagent" option is enabled, the JVM page faults: (gdb) bt #0 0x000000000033d432 in halt_no_interrupts () at ../../arch/x64/processor.hh:232 #1 osv::halt () at ../../core/power.cc:20 #2 0x0000000000214d82 in abort (msg=msg@entry=0x57ea90 "page fault outside application") at ../../runtime.cc:98 #3 0x00000000002fd4d8 in page_fault (ef=0xffffc0003ffe6008) at ../../core/mmu.cc:943 #4 <signal handler called> #5 0x0000000000373169 in __stpncpy (d=d@entry=0x2000001fe7f0 "dlsym: symbol JVM_begin_signal_setting not found", s=0x0, n=1023) at ../../libc/string/stpncpy.c:19 #6 0x0000000000373ad1 in strncpy (d=0x2000001fe7f0 "dlsym: symbol JVM_begin_signal_setting not found", s=<optimized out>, n=<optimized out>) at ../../libc/string/strncpy.c:7 #7 0x0000100000b0ab67 in os::dll_load (filename=filename@entry=0x2000001febf0 "libinstrument.so", ebuf=ebuf@entry=0x2000001fe7f0 "dlsym: symbol JVM_begin_signal_setting not found", ebuflen=ebuflen@entry=1024) at /usr/src/debug/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc19.x86_64/openjdk/hotspot/src/os/linux/vm/os_linux.cpp:1841 #8 0x0000100000c247eb in lookup_on_load (agent=agent@entry=0xffffc0003976ccc0, on_load_symbols=on_load_symbols@entry=0x2000001ffd40, num_symbol_entries=1) at /usr/src/debug/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc19.x86_64/openjdk/hotspot/src/share/vm/runtime/thread.cpp:3585 #9 0x0000100000c2a64f in lookup_agent_on_load (agent=0xffffc0003976ccc0) at /usr/src/debug/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc19.x86_64/openjdk/hotspot/src/share/vm/runtime/thread.cpp:3617 #10 create_vm_init_agents () at /usr/src/debug/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc19.x86_64/openjdk/hotspot/src/share/vm/runtime/thread.cpp:3656 #11 Threads::create_vm (args=<optimized out>, canTryAgain=canTryAgain@entry=0x2000001ffdb0) at /usr/src/debug/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc19.x86_64/openjdk/hotspot/src/share/vm/runtime/thread.cpp:3177 #12 0x000010000094d7b0 in JNI_CreateJavaVM (vm=0x2000001ffe58, penv=0x2000001ffe60, args=<optimized out>) at /usr/src/debug/java-1.7.0-openjdk-1.7.0.25-2.3.12.3.fc19.x86_64/openjdk/hotspot/src/share/vm/prims/jni.cpp:5127 #13 0x0000100000007b3b in main (argc=<optimized out>, argv=0xffffc0003fff2008) at ../../java/java.cc:73 #14 0x0000000000208ac8 in run_main (prog=<optimized out>, args=args@entry=0xffffc0003fe9bfa0) at ../../loader.cc:196 #15 0x0000000000208c68 in do_main_thread (_args=0xffffc0003fe9bfa0) at ../../loader.cc:217 #16 0x0000000000376d36 in operator() (__closure=0xffffc0003b5e2a00) at ../../libc/pthread.cc:59 #17 std::_Function_handler<void(), pthread_private::pthread::pthread(void* (*)(void*), void*, sigset_t, const pthread_private::thread_attr*)::__lambda0>::_M_invoke(const std::_Any_data &) (__functor=...) at ../../external/gcc.bin/usr/include/c++/4.8.1/functional:2071 #18 0x000000000032ed6b in main (this=0xffffc0003a807010) at ../../core/sched.cc:536 #19 sched::thread_main_c (t=0xffffc0003a807010) at ../../arch/x64/arch-switch.hh:133 #20 0x000000000031873e in thread_main () at ../../arch/x64/entry.S:101 Backtrace stopped: frame did not save the PC This is caused by the JVM expecting dlerror() to return an error string if dlopen() fails. Fix that up.
-
- Sep 02, 2013
-
-
Pekka Enberg authored
Add simple tests for munmap() for file-backed memory maps. This exposes a limitation in munmap() not writing out MAP_SHARED mappings.
-
Pekka Enberg authored
Use the new mmu::msync() function to make sure file-backed memory maps are written out to disk in munmap().
-
Pekka Enberg authored
This adds simple msync() implementation for file-backed memory maps. It uses the newly added 'file_vma' data structure to write out and fsync the msync'd region as suggested by Avi Kivity.
-
Pekka Enberg authored
Add a new 'file_vma' class that extends 'vma'. This is needed to keep track of fileref and offset for file-backed VMAs for msync().
-
Avi Kivity authored
Spotted by Pekka.
-
Avi Kivity authored
Different source bases have different error conventions; libc has 0/-1+errno, while the rest os the source base uses 0/error. Wrap errors in a class to prevent confusion between the two.
-
- Sep 01, 2013
-
-
narkisr authored
-
narkisr authored
-
narkisr authored
-
narkisr authored
-
Ronen Narkis authored
-
Pekka Enberg authored
Fixes the following build brekage caused by commit a7d6b269 ("mman: Use libc_error() in mprotect()"): ../../libc/mman.cc: In function ‘int mprotect(void*, size_t, int)’: ../../libc/mman.cc:36:33: error: ‘libc_error’ was not declared in this scope return libc_error(EINVAL); ^ ../../libc/mman.cc:41:33: error: ‘libc_error’ was not declared in this scope return libc_error(ENOMEM); ^ CXX libc/pipe_buffer.o CXX libc/pipe.o make[1]: *** [libc/mman.o] Error 1
-
Pekka Enberg authored
-
- Aug 29, 2013
-
-
narkisr authored
-
Avi Kivity authored
-
Avi Kivity authored
This is used for temporarily dropping a lock in a lexical scope, and reacquiring it after an exit from the scope (similar to wait_until(mutex), but without the waiting): WITH_LOCK(preempt_lock) { // do some stuff while (not enough resources) { DROP_LOCK(preempt_lock) { acquire more resources } // reload anything that may have changed after DROP_LOCK() } // do more stuff with the acquired resources } Note that DROP_LOCK() doesn't work will with recursively-taken locks.
-
Avi Kivity authored
We don't want the compiler moving reads after a possible rcu_defer().
-
narkisr authored
-
narkisr authored
-
Pekka Enberg authored
-