[PATCH 4/4] KVM: riscv: Fix Spectre-v1 in PMU counter access

Lukas Gerlach lukas.gerlach at cispa.de
Fri Feb 27 07:12:47 PST 2026


Thanks for the review!

> This one also covers a non-speculation bug, since the previous condition
> used cidx > RISCV_KVM_MAX_COUNTER. :)  I'll send a patch for that.

Nice catch, thanks for sending the fix.

> I noticed a few other places where mis-speculation is possible,
> see below; can you explain why they don't need protection?

They do, I missed those. Will send a v2 incorporating all four sites.

Thanks,
Lukas



More information about the linux-riscv mailing list