TSC tolerance patch, CPU-line fixes, ...

This commit is contained in:
kat witch 2022-01-10 17:06:26 +00:00 committed by kat
parent 3b6c1fd11d
commit 84b0a624cd
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
6 changed files with 48 additions and 5 deletions

View file

@ -185,6 +185,10 @@
mkIf (vfio-pci-ids != [ ]) {
options.ids = concatStringsSep "," vfio-pci-ids;
};
kvm_amd.options = {
avic = true;
npt = true;
};
};
services.udev.extraRules = ''

View file

@ -129,11 +129,11 @@ in {
(hugepages { where = "/dev/hugepages1G"; options = "pagesize=1GB,mode=0775"; })
];
fileSystems."/sys/fs/cgroup/cpuset" = {
/* fileSystems."/sys/fs/cgroup/cpuset" = {
device = "cpuset";
fsType = "cgroup";
noCheck = true;
};
}; */
systemd.services.preallocate-huggies = {
wantedBy = singleton "multi-user.target";
@ -149,9 +149,15 @@ in {
boot = lib.mkMerge [{
initrd.kernelModules = mkBefore [ "vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd" ];
kernelParams = [
];
kernelModules = [ "i2c-dev" ]; # i2c-dev is required for DDC/CI for screenstub
kernelPatches = with pkgs.kernelPatches; [
(mkIf config.deploy.profile.hardware.acs-override acs-override)
{
name = "clocksource-reduce-tsc-tolerance";
patch = ./tsc-tolerance.patch;
}
];
}
(mkIf (config.deploy.profile.hardware.amdgpu) {

View file

@ -0,0 +1,26 @@
From 5cac0c3c4383010f0579028de8decd6ede4bd460 Mon Sep 17 00:00:00 2001
From: Stefan Springer <stefanspr94@gmail.com>
Date: Sun, 3 Oct 2021 23:26:40 +0200
Subject: [PATCH] clocksource: set WATCHDOG_MAX_SKEW to 60
in order to find a more relaxed middleground between the old default (100) and the new one(50)
---
kernel/time/clocksource.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index b8a14d2fb..f8f848d13 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -107,7 +107,7 @@ static u64 suspend_start;
* This delay could be due to SMIs, NMIs, or to VCPU preemptions. Used as
* a lower bound for cs->uncertainty_margin values when registering clocks.
*/
-#define WATCHDOG_MAX_SKEW (50 * NSEC_PER_USEC)
+#define WATCHDOG_MAX_SKEW (60 * NSEC_PER_USEC)
#ifdef CONFIG_CLOCKSOURCE_WATCHDOG
static void clocksource_watchdog_work(struct work_struct *work);
--
2.32.0

@ -1 +1 @@
Subproject commit 5ebe55390f615f537be4eda6adaae6656d96655b
Subproject commit 82aa63dafe2fc353ab90475c2cc48069c32738c5

View file

@ -59,7 +59,13 @@ for task in /proc/$QEMU_PID/task/*; do
case $TASKNAME in
worker | qemu-system-*)
echo worker is $TASKNAME
;;
;;
IO*)
regex="IO iothread([0-9]*)"
if [[ $TASKNAME =~ $regex ]]; then
chrt -f -p 1 $TASK
fi
;;
CPU*)
regex="CPU ([0-9]*)/KVM"
if [[ $TASKNAME =~ $regex ]]; then

View file

@ -9,7 +9,8 @@ writeShellScriptBin "win10-vm" ''
-blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \
-machine pc-q35-5.1,accel=kvm,usb=off,vmport=off,dump-guest-core=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format \
-monitor stdio \
-cpu host,migratable=no,+invtsc,topoext=on,hv-time,hv-vpindex,hv-relaxed,hv-vapic,-amd-stibp,hv-synic,hv-spinlocks=0x1fff,host-cache-info=on,l3-cache=off -m 12288 \
-cpu host,migratable=no,topoext=on,host-cache-info=on,+invtsc,hv_time,hv_relaxed,hv_vpindex,hv_synic,hv_spinlocks=0x1fff,hv_vendor_id=ab12341234ab$,hv_vapic,-amd-stibp \
-m 12288 \
-mem-path /dev/hugepages1G/qemu-win10-vm -mem-prealloc \
-smp 8,sockets=1,dies=1,cores=4,threads=2 \
-object iothread,id=iothread1 \