clocksource on SeaBios vs UEFI

planetf1

New Member
Jun 19, 2024
11
2
3
I have a Intel N100 16GB PC (4 cpu) running some fedora 40 guests. Both use host cpu type

One proxmox guest (UEFI) is reporting some clock instability trying to use tsc & throws a few events in dmesg, ending up with hpet . kvm-clock isn't available
Another guest (Seabios) has no such issues, and happily uses kvm-clock

I think the difference in behaviour is down to bios type.
Reviewing dmesg output I see that the seabios version knows it's working in kvm ('Hypervisor detected') and so tries to use the kvm clock. The uefi version doesn't report anything like this
 
What does cat /sys/devices/system/clocksource/clocksource0/current_clocksource show (on host).
 
tsc

All looks fine on the host - no oddities, simple use of tsc

I had thought tsc would be ok in the vm too. Yet I have one on kvm, the other hpet

The factor seems to be the bios. I'm wondering about moving that vm back to seabios (that presumably means a re-install )
 
I created a new fc40 vm with UEFI - it used the kvm clocksource. So that's consistent with my 'good' vm.

So the other big difference is that the 'bad' vm has pci passthrough of the igpu, bluebooth, audio .....
 
I notice that `system-detect-virt` returns 'qemu` on the UEFI bios, but `kvm` on the seabios
 
Digging further, there's a difference in whether the hypervisor is detected (hypervisor.c in the kernel). Why, when both are set to 'host', I'm not sure.
 
So looking into the cpuid more:

On the desktop with gpu passthrough:
jonesn@nigel-desktop:/etc$ cpuid | grep -y hyper
hyper-threading / multi-core supported = true
hypervisor guest status = true
hypervisor_id (0x40000000) = "\0\0\0\0\0\0\0\0\0\0\0\0"
hyper-threading / multi-core supported = true
hypervisor guest status = true
hypervisor_id (0x40000000) = "\0\0\0\0\0\0\0\0\0\0\0\0"
hyper-threading / multi-core supported = true
hypervisor guest status = true
hypervisor_id (0x40000000) = "\0\0\0\0\0\0\0\0\0\0\0\0"
hyper-threading / multi-core supported = true
hypervisor guest status = true
hypervisor_id (0x40000000) = "\0\0\0\0\0\0\0\0\0\0\0\0"


whilst on the other vm, with a working kvm clock:

root@fed40:~# cpuid | grep -y hyper
hyper-threading / multi-core supported = true
hypervisor guest status = true
hypervisor_id (0x40000000) = "KVMKVMKVM\0\0\0"
hypervisor features (0x40000001/eax):
map gpa range hypercall supported = false
hypervisor features (0x40000001/edx):
hypervisor_id (0x40000100) = "\0\0\0\0\0\0\0\0\0\0\0\0"
hyper-threading / multi-core supported = true
hypervisor guest status = true
hypervisor_id (0x40000000) = "KVMKVMKVM\0\0\0"
hypervisor features (0x40000001/eax):
map gpa range hypercall supported = false
hypervisor features (0x40000001/edx):
hypervisor_id (0x40000100) = "\0\0\0\0\0\0\0\0\0\0\0\0"
hyper-threading / multi-core supported = true
hypervisor guest status = true
hypervisor_id (0x40000000) = "KVMKVMKVM\0\0\0"
hypervisor features (0x40000001/eax):
map gpa range hypercall supported = false
hypervisor features (0x40000001/edx):
hypervisor_id (0x40000100) = "\0\0\0\0\0\0\0\0\0\0\0\0"
hyper-threading / multi-core supported = true
hypervisor guest status = true
hypervisor_id (0x40000000) = "KVMKVMKVM\0\0\0"
hypervisor features (0x40000001/eax):
map gpa range hypercall supported = false
hypervisor features (0x40000001/edx):
hypervisor_id (0x40000100) = "\0\0\0\0\0\0\0\0\0\0\0\0"


I've checked the vm settings very closely - they are very similar, certainly for cpu, machine type etc.
The kernel cmdline is too
Running on same proxmox server
 
After reading through proxmox & kernel code, I unclicked 'primary vga' in my desktop with passthrough. This avoids setting 'kvm=off' and allows the kvm-clock to work. Gory details available if anyone is interested!

The vm seems happier with kvm-clock, and the desktop still runs fine on the passed-through GPU.
 
Last edited:
I've learned something new today.

Good you've got it working. Maybe tag mark the thread-title with [SOLVED], (upper right hand corner under title).
 
  • Like
Reactions: planetf1

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!