Re: [PATCH v4 4/4] KVM: SVM: Add Bus Lock Detect support

From: Shivansh Dhiman

Date: Fri Nov 14 2025 - 03:50:46 EST


On 11-11-2025 20:45, Sean Christopherson wrote:
> On Tue, Nov 11, 2025, Shivansh Dhiman wrote:
>> On 17-08-2024 05:43, Sean Christopherson wrote:
>>> On Thu, Aug 08, 2024, Ravi Bangoria wrote:

...

>
>> ===========================================================
>> Issue 1: Interception still enabled after enabling LBRV
>> ===========================================================
>> Using the 6.16 upstream kernel (unpatched) I ran the KUT tests and they passed
>> when run from both the bare metal and from inside a L1 guest. However for L2
>> guest, when looking at the logs I found that RDMSR interception of LBR MSRs is
>> still enabled despite the LBRV is enabled for the L2 guest. Effectively, the
>> reads are emulated instead of being virtualized, which is not the intended
>> behaviour. KUT cannot distinguish between emulated and virtualized RDMSR, and
>> hence the test passes regardless.
>
> I haven't looked closely at your patch or at Yosry's patches, but I suspect this
> was _just_ fixed:
>
> https://lore.kernel.org/all/20251108004524.1600006-1-yosry.ahmed@xxxxxxxxx

Thanks Sean. I tested Yosry's patches and they indeed have solved this issue.

>
>> ===========================================================
>> Issue 2: Basic LBR KUT fails with Sean's implementation
>> ===========================================================
>> After using your implementation, all KUTs passed on the bare metal. With LBRV
>> enabled for L2, RDMSR interception of LBR MSRs is disabled as intended.
>> However, when running KUT tests inside an L1 guest, the tests fail.
>
> Same story here: I haven't had cycles to actually look at code, but Yosry also
> posted a pile of changes for KUT:
>
> https://lore.kernel.org/all/20251110232642.633672-1-yosry.ahmed@xxxxxxxxx

This issue was also related to buggy LBRV in the kernel. Yosry's patches have
fixed this issue as well and I've verified it. There was a slight flakiness in
the KUT which was later fixed by another patch by Yosry's. [1]

Thanks,
Shivansh

1. https://lore.kernel.org/all/20251113224639.2916783-1-yosry.ahmed@xxxxxxxxx/