Re: [PATCH] KVM: SVM: make svm_flush_tlb_gva do a full asid flush if NPT enabled
From: Tycho Andersen
Date: Thu Jul 30 2026 - 13:04:50 EST
On Thu, Jul 30, 2026 at 01:02:46PM +0200, Alexander Lougovski wrote:
> On Tue, Jul 28, 2026 at 03:34:36PM -0600, Tycho Andersen wrote:
> > my LLM complained about the '% 2800000', looks like it's selecting
> > from 1..2.8M in a 1.6M table, so the updates above 1.6M don't affect
> > any rows.
>
> Hi Tycho,
> ah, true. Your LLM is correct. I've been experimenting with the different sizes of DB to ensure more memory churn (avoid sql reading from the cache) but then settled back to 1.6M.
Ok, makes sense. I found enough hardware yesterday to run ~35 VMs with
a bit of memory pressure, so smaller is better for me.
When you say "200 VM hours", I guess that's an average? Or do you find
they need to run that long to see the fault?
Also, how are you detecting the BSOD? I'm just waiting for ssh to stop
responding and screen capping the VNC, but maybe there's a better way.
>
> Another thing to mention, it looks like 1582 workload version I've shared doesn't work correctly. So I'm attaching an improved version which mitigates problems - the version I shared before, was still generating a noticeable amount of TLB flushes but still wasn't exactly working as it's supposed to. So here is the improved version:
Thanks for this, I'll update. Though based on:
#!/usr/bin/env bpftrace
kprobe:svm_flush_tlb_gva
{
$vcpu = (struct kvm_vcpu *)arg0;
printf("%-14llu %-7d %-16s %-4d 0x%lx\n",
nsecs / 1000000, pid, comm,
$vcpu->vcpu_id,
arg1);
}
I was already getting quite a few of these flushes, so your scripts
are working somewhat :)
> -cpu host,hv-time=on,hv-relaxed=on,hv-vapic=on,hv-spinlocks=0x1fff,hv-vpindex=on,hv-runtime=on,hv-synic=on,hv-reset=on,hv-frequencies=on,hv-tlbflush=on,hv-ipi=on
Thanks for this as well, I only had hv-tlbflush=on, I'll go ahead and
adapt my command line to yours.
Cheers,
Tycho