[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABgObfbWqcorZC+1Hjh7SQtn69LE-Wng-wBKOq=tqh00_3R6dw@mail.gmail.com>
Date: Wed, 22 Jan 2025 10:00:52 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: John Stultz <jstultz@...gle.com>
Cc: Sean Christopherson <seanjc@...gle.com>, kvm <kvm@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>, Frederic Weisbecker <fweisbec@...il.com>,
Andy Lutomirski <luto@...nel.org>, Borislav Petkov <bp@...e.de>, Jim Mattson <jmattson@...gle.com>,
Alex Bennée <alex.bennee@...aro.org>,
Will Deacon <will@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, LKML <linux-kernel@...r.kernel.org>,
"Team, Android" <kernel-team@...roid.com>
Subject: Re: BUG: Occasional unexpected DR6 value seen with nested
virtualization on x86
Il mer 22 gen 2025, 07:07 John Stultz <jstultz@...gle.com> ha scritto:
>
> I then cut down and ported the bionic test out so it could build under
> a standard debian environment:
> https://github.com/johnstultz-work/bionic-ptrace-reproducer
>
> Where I was able to reproduce the same problem in a debian VM (after
> running the test in a loop for a short while).
Thanks, that's nice to have.
> Now, here's where it is odd. I could *not* reproduce the problem on
> bare metal hardware, *nor* could I reproduce the problem in a virtual
> environment. I can *only* reproduce the problem with nested
> virtualization (running the VM inside a VM).
Typically in that case the best thing to do is turn it into a
kvm-unit-test or selftest (though that's often an endeavor of its own,
as it requires distilling the Linux kernel and userspace code into a
guest that runs without an OS). But what you've done is already a good
step.
> I have reproduced this on my intel i12 NUC using the same v6.12 kernel
> on metal + virt + nested environments. It also reproduced on the NUC
> with v5.15 (metal) + v6.1 (virt) + v6.1(nested).
Good that you can use a new kernel. Older kernels are less reliable
with nested virt (especially since the one that matters the most is
the metal one).
Paolo
> I've tried to do some tracing in the arch/x86/kvm/x86.c logic, but
> I've not yet directly correlated anything on the hosts to the point
> where we read the zero DR6 value in the nested guest.
>
> But I'm not very savvy around virtualization or ptrace watchpoints or
> low level details around intel DB6 register, so I wanted to bring this
> up on the list to see if folks had suggestions or ideas to further
> narrow this down? Happy to test things as it's pretty simple to
> reproduce here.
>
> Many thanks to Alex Bennee and Jim Mattson for their testing
> suggestions to help narrow this down so far.
>
> thanks
> -john
>
Powered by blists - more mailing lists