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

Mathias Krause
2025-11-18T12:10:37Z

On 18.11.25 12:56, Mathias Krause wrote:
> On 18.11.25 05:04, Mathias Krause wrote:
> [...]> After some sleep it makes lot more sense. Well, not really, but
it's a
> race that f01ea38a385a, apparently, makes easier to hit.
>
>>
>> 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"
>> );
> That hypercall call shouldn't return, as it's HYPERCALL_VMEXIT which
> makes vmx_run() return and not re-enter the guest. But, apparently, it
> does so and it does so because the guest/VMM shared variable
> 'hypercall_field' to communicate to the VMM what to do can also be
> modified concurrently by the other CPU/guest #2 after it was written by
> CPU/guest #1 but before read by the VMM. Bummer!

Bleh, I messed up my test setup and it's not it. Back to square one.