Re: [kvm-unit-tests PATCH v2 0/4] Better backtraces for leaf functions

Mathias Krause
2025-11-18T04:04:26Z

On 18.11.25 02:47, Mathias Krause wrote:
> On 18.11.25 02:33, Mathias Krause wrote:
>> On 17.11.25 23:19, Sean Christopherson wrote:
>>> Spoke too soon :-(
>>>
>>> The x86 change breaks the realmode test. I didn't try hard to debug, as that
>>> test is brittle, e.g. see https://lore.kernel.org/all/20240604143507.1041901-1-pbonzini@redhat.com.
>
> Bleh, I just noticed, f01ea38a385a ("x86: Better backtraces for leaf
> functions") broke vmx_sipi_signal_test too :(
>
> Looking into it!

Can't see it. The issue is, the call to hypercall(1) does return in
x86/vmx.c:guest_entry() with f01ea38a385a applied but not w/o it. But
that makes no sense to me whatsoever. :/

Below debug diff shows the issue:

diff --git a/x86/vmx.c b/x86/vmx.c
index c803eaa67ac6..e49668f5ff95 100644
--- a/x86/vmx.c
+++ b/x86/vmx.c
@@ -806,4 +806,5 @@ asm(
" mov $1, %edi\n\t"
" call hypercall\n\t"
+ " ud2"
);

It also explains why the test fails: it's executing random code that
follows, in my case, __this_cpu_has().

Catching some sleep!

Mathias