- Dec 01, 2013
-
-
Nadav Har'El authored
When KVM paravirtual clock isn't available (e.g., on Xen or on plain Qemu), we used the HPET clock. Our HPET clock driver rolled back the clock (clock::get()->time()) once every 42 seconds, causing strange things like a scheduler assertion when the clock jumps back. The problem is that we read just 32 bits out of the 64 bits of the HPET counter. This means that we roll back the clock once every 2^32 ticks, and with the 10ns tick (which seems to be case in Qemu), this means about 42 seconds. Douglas Adams would have liked this bug ;-) Fixed the code, and removed overly-optimistic comment which stated the rollback should take years. Added an assertion that the HPET really has a 64-bit counter; Intel's HPET specification from 2004 already specify that a 64-bit counter is recommended, and both Qemu and Xen do implement a 64-bit counter. If we had to deal with a 32-bit counter, we would need to write a handler for the interrupt that the HPET sends every time the counter wraps around. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Nov 28, 2013
-
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Add a new virtio::probe() helper function to simplify virtio driver probing. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Nov 26, 2013
-
-
Nadav Har'El authored
This patch causes incorrect usage of percpu<>/PERCPU() to cause compilation errors instead of silent runtime corruptions. Thanks to Dmitry for first noticing this issue in xen_intr.cc (see his separate patch), and to Avi for suggesting a compile-time fix. With this patch: 1. Using percpu<...> to *define* a per-cpu variable fails compilation. Instead, PERCPU(...) must be used for the definition, which is important because it places the variable in the ".percpu" section. 2. If a *declaration* is needed additionally (e.g., for a static class member), percpu<...> must be used, not PERCPU(). Trying to use PERCPU() for declaration will cause a compilation error. 3. PERCPU() only works on statically-constructed objects - global variables, static function-variables and static class-members. Trying to use it on a dynamically-constructed object - stack variable, class field, or operator new - will cause a compilation error. With this patch, the bug in xen_intr.cc would have been caught at compile time. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Nov 21, 2013
-
-
Nadav Har'El authored
prio.hh defines various initialization priorities. The actual numbers don't matter, just the order between them. But when we add too many priorities between existing ones, we may hit a need to renumber. This is plain ugly, and reminds me of Basic programming ;-) So this patch switches to an enum (enum class, actually). We now just have a list of priority names in order, with no numbers. It would have been straightforward, if it weren't for a bug in GCC (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59211 ) where the "init_priority" attribute doesn't accept the enum (while the "constructor" attribute does). Luckily, a simple workaround - explicitly casting to int - works. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Nov 06, 2013
-
-
Pekka Enberg authored
condvar_wait() expects an absolute time, not a duration. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Nov 05, 2013
-
-
Pekka Enberg authored
Add the explanation by Avi Kivity to AcpiOsUnmapMemory() to explain why it's a no-op. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Nov 04, 2013
-
-
Dmitry Fleytman authored
Due to incorrect mapping logic ACPI tables longer than PAGE_SIZE mapped partially and to wrong base address. As a result system crashed on ACPI tables checksum verification. Found when running on EC2 HVM instances, the problematic table was: ACPI: DSDT 0xfc002c40 0321F (v02 Xen HVM 00000000 INTL 20090220) Signed-off-by:
Dmitry Fleytman <dmitry@daynix.com>
-
- Oct 31, 2013
-
-
Pekka Enberg authored
Use the initialization sequence specified in 10.1.2.2 ("ACPICA Initialization With Early ACPI Table Access") from ACPICA reference manual. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Use mmu:isreadable() to actually check if a memory region is readable in AcpiOsReadable(). Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Switch to console::write_ll() in AcpiOsPrintf() and AcpiOsvPrintf() to make ACPI boot-time output readable: [penberg@localhost osv]$ ./scripts/run.py ACPI: RSDP 0xfd8d0 00014 (v00 BOCHS ) ACPI: RSDT 0x3fffe380 00034 (v01 BOCHS BXPCRSDT 00000001 BXPC 00000001) ACPI: FACP 0x3fffff80 00074 (v01 BOCHS BXPCFACP 00000001 BXPC 00000001) ACPI: DSDT 0x3fffe3c0 011A9 (v01 BXPC BXDSDT 00000001 INTL 20100528) ACPI: FACS 0x3fffff40 00040 ACPI: SSDT 0x3ffff6e0 00858 (v01 BOCHS BXPCSSDT 00000001 BXPC 00000001) ACPI: APIC 0x3ffff5b0 00090 (v01 BOCHS BXPCAPIC 00000001 BXPC 00000001) ACPI: HPET 0x3ffff570 00038 (v01 BOCHS BXPCHPET 00000001 BXPC 00000001) acpi 0 apic 0 acpi 1 apic 1 acpi 2 apic 2 acpi 3 apic 3 APIC base fee00000 OSv v0.02-64-ga556eab Copyright 2013 Cloudius Systems locale works ACPI: RSDP 0xfd8d0 00014 (v00 BOCHS ) ACPI: RSDT 0x3fffe380 00034 (v01 BOCHS BXPCRSDT 00000001 BXPC 00000001) ACPI: FACP 0x3fffff80 00074 (v01 BOCHS BXPCFACP 00000001 BXPC 00000001) ACPI: DSDT 0x3fffe3c0 011A9 (v01 BXPC BXDSDT 00000001 INTL 20100528) ACPI: FACS 0x3fffff40 00040 ACPI: SSDT 0x3ffff6e0 00858 (v01 BOCHS BXPCSSDT 00000001 BXPC 00000001) ACPI: APIC 0x3ffff5b0 00090 (v01 BOCHS BXPCAPIC 00000001 BXPC 00000001) ACPI: HPET 0x3ffff570 00038 (v01 BOCHS BXPCHPET 00000001 BXPC 00000001) ACPI: All ACPI Tables successfully acquired Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Oct 29, 2013
-
-
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>
-
- Oct 28, 2013
-
-
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>
-
- Oct 24, 2013
-
-
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
Signed-off-by:
Or Cohen <orc@fewbytes.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>
-
- Oct 10, 2013
-
-
Avi Kivity authored
We have _KERNEL defines scattered throughout the code, which makes understanding it difficult. Define it just once, and adjust the source to build. We define it in an overridable variable, so that non-kernel imported code can undo it.
-
- Oct 09, 2013
-
-
Pekka Enberg authored
Switch to size_t type for ->bio_bcount in struct bio and clean up virtio-blk signedness casts. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Oct 07, 2013
-
-
Nadav Har'El authored
This patch adds interrupt (by default ctrl-C) and quit (by default ctrl-\) handling to the console driver, when the ISIG termios flag is enabled (and this patch enables this flag by default). The application can change these characters or disable ISIG with ioctls, exactly as in Unix. The ^C character sends a SIGINT to the (only) process, and ^\ sends SIGQUIT. By default both abort OSv, but when running Java we get a much more interesting SIGQUIT handler - it shows a trace of all running threads and other information. Note that our line-discipline code currently sits in the console driver (we do not have ptys yet), so it only applies to the console, not to SSH connections or the likes. Also note that by default (before the patch to issue #49), qemu will catch the ^C and ^\ and won't even pass them to OSv, so apply the patch to #49 (or change the interrupt or quit characters) to see this feature working. This patch relates to issue #53. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com>
-
- Oct 02, 2013
-
-
Pekka Enberg authored
The page_size constant is not used in the code so lets just remove it. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Oct 01, 2013
-
-
Pekka Enberg authored
Make kvmclock::probe() easier to follow by simplifying the processor feature checks. Cc: Venkatesh Srinivas <venkateshs@google.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Sep 30, 2013
-
-
Venkatesh Srinivas authored
Older versions of KVM and user VMMs expose kvmclock MSRs at different MSR offsets. Detect the old flag in kvmclock::probe() and use the old MSRs if they are the only ones available. Signed-off-by:
Venkatesh Srinivas <venkateshs@google.com> Signed-off-by:
Glauber Costa <glommer@cloudius-systems.com>
-
- Sep 29, 2013
-
-
Dmitry Fleytman authored
1. MSI-X printous fixed 2. Duplicate EOLs removed Signed-off-by:
Dmitry Fleytman <dmitry@daynix.com>
-
- Sep 20, 2013
-
-
Pekka Enberg authored
Switch to the mmu::page_size constant instead of inventing our own. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
The 'offset' variable is first assigned to "bio->bio_offset" and then immediately overwritten with "bio->bio_data & 0xfff". Fix that up. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Sep 18, 2013
-
-
Pekka Enberg authored
Fix few minor but annoying coding style issues in drivers/virtio-blk.cc. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Sep 15, 2013
-
-
Nadav Har'El authored
Add Cloudius copyright and license statement to drivers/*. A couple of header files were based on Linux's BSD-licensed header files (e.g., include/uapi/linux/virtio_net.h) so they included the BSD license, but not any copyright statement, so we can just replace that by our own statement of the BSD license.
-
- Sep 14, 2013
-
-
Glauber Costa authored
I've made the mistake of presenting the counter value directly instead of converting it to nanoseconds. We need to do that, by grabbing the period from the device and using it. Since hpet is already our slow fallback anyway, I am using simple multiplication and not bothering with complex mult / shift stuff.
-
Glauber Costa authored
The Xen hypervisor not always initialize its pages. The BSD drivers will however assume they are zeroed, and so things may break if they are not (misterious flag tests suddenly being true, for instance). Initialize manually the data we have just received from malloc when we deal with softc.
-
- Sep 12, 2013
-
-
Dmitry Fleytman authored
This patch implements GSI interrupt support for Xen bus. Needed in Xen environments w/o vector callbacks for HVM. One example of such an environment is Amazon EC2.
-
- Sep 05, 2013
-
-
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
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
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
-