|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] trace/vvmx: Correctly report TRC_HVM_NESTEDFLAG flag
On 13.10.2026 11:09, Teddy Astie wrote:
> Currently all VMEXITs are reported as if it occured "non-nested",
Nit: s/ it / they /
> even when the vCPU is in "guest mode". Making distinguishing
> "nested virt" VMEXIT to regular ones much harder.
Same for entries, as it looks.
> Fix this by adding TRC_HVM_NESTEDFLAG flag when the guest is in guest
> mode, matching the svm logic.
>
> Fixes: ??? (???)
> Signed-off-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
> ---
> I can't really find the commit that introduced vVMX. But I guess it
> would be the candidate for the fixes tag.
For the exit aspect I'd suggest 3bafd4a90995 ("Nested VMX: VM exit handler of
n2-guest"). Changes to vmx_vmenter_helper() came later, so I'd leave it at
that.
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -4209,9 +4209,13 @@ void asmlinkage vmx_vmexit_handler(struct
> cpu_user_regs *regs)
> __vmread(VM_EXIT_REASON, &exit_reason);
>
> if ( hvm_long_mode_active(v) )
> - TRACE_TIME(TRC_HVM_VMX_EXIT64, exit_reason, regs->rip, regs->rip >>
> 32);
> + TRACE_TIME(TRC_HVM_VMX_EXIT64 |
> + (nestedhvm_vcpu_in_guestmode(v) ? TRC_HVM_NESTEDFLAG : 0),
> + exit_reason, regs->rip, regs->rip >> 32);
> else
> - TRACE_TIME(TRC_HVM_VMX_EXIT, exit_reason, regs->eip);
> + TRACE_TIME(TRC_HVM_VMX_EXIT |
> + (nestedhvm_vcpu_in_guestmode(v) ? TRC_HVM_NESTEDFLAG : 0),
> + exit_reason, regs->eip);
SVM code uses a local boolean to avoid the separate (and now also repeated,
considering the later use) nestedhvm_vcpu_in_guestmode() invocations. Thoughts
towards introducing such a local here as well? (I don't quite understand why
they also use nestedhvm_enabled() when setting that boolean:
nestedhvm_vcpu_in_guestmode() would better return false for domains with
nested not enabled.)
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |