aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Cottlehuber <dch@FreeBSD.org>2021-05-30 13:35:19 +0000
committerDave Cottlehuber <dch@FreeBSD.org>2021-05-30 13:35:19 +0000
commit563d5929d5f28631999a32d2aab4e72e1bf2c323 (patch)
tree2ebdf8064034565eab8ee42703209bf846286326
parent68fa173526465a755a9b7fdc5ee9b8761c2a47b1 (diff)
downloadports-563d5929d5f28631999a32d2aab4e72e1bf2c323.tar.gz
ports-563d5929d5f28631999a32d2aab4e72e1bf2c323.zip
sysutils/kvmclock-kmod: new port - call for testing
Improved performance on KVM paravirtualised systems. Testing welcomed; please report successes and issues to: https://reviews.freebsd.org/D29733 kvmclock-kmod is experimental and currently under development. This port provides an easy and quick method for users to test this code for early testing, feedback and bug reports. This driver enables FreeBSD to use a more efficient paravirtualized hardware clock, instead of emulating one, or abusing hypervisor interrupts, when running as a virtualized OS under Linux KVM (Kernel-based Virtual Machine). Reviewed by: allanjude Sponsored by: Klara Inc. Sponsored by: SkunkWerks, GmbH Differential Revision: https://reviews.freebsd.org/D30459 PR: 216759
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/kvmclock-kmod/Makefile25
-rw-r--r--sysutils/kvmclock-kmod/distinfo3
-rw-r--r--sysutils/kvmclock-kmod/pkg-descr11
-rw-r--r--sysutils/kvmclock-kmod/pkg-message24
5 files changed, 64 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index dda66170e644..98481ed67421 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -581,6 +581,7 @@
SUBDIR += kshutdown
SUBDIR += ksystemlog
SUBDIR += kubectl
+ SUBDIR += kvmclock-kmod
SUBDIR += lava
SUBDIR += lbl-cf
SUBDIR += lbl-hf
diff --git a/sysutils/kvmclock-kmod/Makefile b/sysutils/kvmclock-kmod/Makefile
new file mode 100644
index 000000000000..6a1c5ec2d222
--- /dev/null
+++ b/sysutils/kvmclock-kmod/Makefile
@@ -0,0 +1,25 @@
+PORTNAME= kvmclock
+DISTVERSION= 0.0.0-a2
+CATEGORIES= sysutils
+PKGNAMESUFFIX= -kmod
+
+MAINTAINER= dch@FreeBSD.org
+COMMENT= Paravirtualized Linux KVM clock support
+
+LICENSE= BSD2CLAUSE
+
+ONLY_FOR_ARCHS= amd64 i386
+ONLY_FOR_ARCHS_REASON= not yet tested for non-x86
+
+USES= kmod uidfix
+KMOD= kvmclock
+
+USE_GITHUB= yes
+GH_ACCOUNT= klarasystems
+
+PLIST_FILES= ${KMODDIR}/kvmclock.ko
+
+OPTIONS_DEFINE= DEBUG
+OPTIONS_SUB= yes
+
+.include <bsd.port.mk>
diff --git a/sysutils/kvmclock-kmod/distinfo b/sysutils/kvmclock-kmod/distinfo
new file mode 100644
index 000000000000..7e6f54fc3840
--- /dev/null
+++ b/sysutils/kvmclock-kmod/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1621967719
+SHA256 (klarasystems-kvmclock-0.0.0-a2_GH0.tar.gz) = 1497f3eca5bc1f1d9708aa601f5fdbdea08852e16b6c9c1d55bc6d0262baf708
+SIZE (klarasystems-kvmclock-0.0.0-a2_GH0.tar.gz) = 7676
diff --git a/sysutils/kvmclock-kmod/pkg-descr b/sysutils/kvmclock-kmod/pkg-descr
new file mode 100644
index 000000000000..7eca429ebc59
--- /dev/null
+++ b/sysutils/kvmclock-kmod/pkg-descr
@@ -0,0 +1,11 @@
+Development version of kvmclock FreeBSD driver for virtual machines.
+
+References and prior art:
+
+https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/virtualization_deployment_and_administration_guide/chap-kvm_guest_timing_management
+https://www.vmware.com/files/pdf/techpaper/Timekeeping-In-VirtualMachines.pdf
+http://oliveryang.net/2015/09/pitfalls-of-TSC-usage/#33-tsc-emulation-on-different-hypervisors
+https://reviews.freebsd.org/D29531
+https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216759
+
+WWW: https://reviews.freebsd.org/D29733
diff --git a/sysutils/kvmclock-kmod/pkg-message b/sysutils/kvmclock-kmod/pkg-message
new file mode 100644
index 000000000000..d410eecdba03
--- /dev/null
+++ b/sysutils/kvmclock-kmod/pkg-message
@@ -0,0 +1,24 @@
+[
+{ type: install
+ message: <<EOM
+kvmclock-kmod is experimental and currently under development. This port
+provides an easy and quick method for users to test this code for early
+testing, feedback and bug reports.
+
+This driver enables FreeBSD to use a more efficient paravirtualized
+hardware clock, instead of emulating one, or abusing hypervisor
+interrupts, when running as a virtualized OS under Linux KVM
+(Kernel-based Virtual Machine).
+
+Usage:
+
+# kldload kvmclock
+# sysctl kern.timecounter
+kern.timecounter.choice: kvmclock(975) i8254(0) ...
+kern.timecounter.hardware: kvmclock
+...
+
+Please report successes and issues to: https://reviews.freebsd.org/D29733
+EOM
+}
+]