From: Grygorii Strashko <grygorii_strashko@epam.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Julien Grall" <julien@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Tamas K Lengyel" <tamas@tklengyel.com>,
"Alexandru Isaila" <aisaila@bitdefender.com>,
"Petre Pircalabu" <ppircalabu@bitdefender.com>,
"Teddy Astie" <teddy.astie@vates.tech>,
"Penny Zheng" <Penny.Zheng@amd.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [XEN][PATCH v3] xen: make VMTRACE support optional
Date: Tue, 18 Nov 2025 14:42:02 +0200 [thread overview]
Message-ID: <5ebcbafc-d391-4541-8df3-2742cef43be8@epam.com> (raw)
In-Reply-To: <225378f4-0ebd-4c77-ae77-807bbb03b0bb@suse.com>
Hi Jan,
On 17.11.25 18:52, Jan Beulich wrote:
> On 14.11.2025 15:22, Grygorii Strashko wrote:
>> --- a/xen/arch/x86/hvm/Kconfig
>> +++ b/xen/arch/x86/hvm/Kconfig
>> @@ -35,6 +35,18 @@ config INTEL_VMX
>> If your system includes a processor with Intel VT-x support, say Y.
>> If in doubt, say Y.
>>
>> +config VMTRACE
>> + bool "HW VM tracing support"
>> + depends on INTEL_VMX
>> + default y
>> + help
>> + Enables HW VM tracing support which allows to configure HW processor
>> + features (vmtrace_op) to enable capturing information about software
>> + execution using dedicated hardware facilities with minimal interference
>> + to the software being traced. The trace data can be retrieved using buffer
>> + shared between Xen and domain
>> + (see XENMEM_acquire_resource(XENMEM_resource_vmtrace_buf)).
>
> Please check adjacent options above or ...
>
>> config HVM_FEP
>> bool "HVM Forced Emulation Prefix support (UNSUPPORTED)" if UNSUPPORTED
>> default DEBUG
>
> ... below for how proper indentation would look like here.
There is a mix in Kconfigs - some places <Tabs> some places <Spaces> :(
Will change to <Tabs>
>
>> --- a/xen/arch/x86/hvm/vmx/vmcs.c
>> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
>> @@ -307,6 +307,7 @@ static int vmx_init_vmcs_config(bool bsp)
>> rdmsrl(MSR_IA32_VMX_MISC, _vmx_misc_cap);
>>
>> /* Check whether IPT is supported in VMX operation. */
>> +#ifdef CONFIG_VMTRACE
>
> This imo wants to move ahead of the comment. (Feels a little like I may have
> said so already, but it may well have been in the context of a different
> recent patch.)
>
>> @@ -772,13 +775,24 @@ static inline int hvm_vmtrace_get_option(
>>
>> return -EOPNOTSUPP;
>> }
>> +#else
>> +/*
>> + * Function declaration(s) here are used without definition(s) to make compiler
>> + * happy when VMTRACE=n, compiler DCE will eliminate unused code.
>> + */
>> +int hvm_vmtrace_output_position(struct vcpu *v, uint64_t *pos);
>> +#endif
>>
>> static inline int hvm_vmtrace_reset(struct vcpu *v)
>> {
>> +#ifdef CONFIG_VMTRACE
>> if ( hvm_funcs.vmtrace_reset )
>> return alternative_call(hvm_funcs.vmtrace_reset, v);
>>
>> return -EOPNOTSUPP;
>> +#else
>> + return -EOPNOTSUPP;
>> +#endif
>
> No #else please and the #endif moved up.
>
>> --- a/xen/arch/x86/vm_event.c
>> +++ b/xen/arch/x86/vm_event.c
>> @@ -253,7 +253,8 @@ void vm_event_fill_regs(vm_event_request_t *req)
>> req->data.regs.x86.shadow_gs = ctxt.shadow_gs;
>> req->data.regs.x86.dr6 = ctxt.dr6;
>>
>> - if ( hvm_vmtrace_output_position(curr, &req->data.regs.x86.vmtrace_pos) != 1 )
>> + if ( IS_ENABLED(CONFIG_VMTRACE) &&
>> + hvm_vmtrace_output_position(curr, &req->data.regs.x86.vmtrace_pos) != 1 )
>
> Would be nice if the too-long-line issue here was also address, when the line
> needs touching anyway.
I left it as is for better readability as an exception.
Will below be ok:
if ( IS_ENABLED(CONFIG_VMTRACE) &&
- hvm_vmtrace_output_position(curr, &req->data.regs.x86.vmtrace_pos) != 1 )
+ hvm_vmtrace_output_position(curr,
+ &req->data.regs.x86.vmtrace_pos) != 1 )
req->data.regs.x86.vmtrace_pos = ~0;
--
Best regards,
-grygorii
next prev parent reply other threads:[~2025-11-18 12:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 14:22 [XEN][PATCH v3] xen: make VMTRACE support optional Grygorii Strashko
2025-11-17 16:52 ` Jan Beulich
2025-11-18 12:42 ` Grygorii Strashko [this message]
2025-11-18 13:39 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5ebcbafc-d391-4541-8df3-2742cef43be8@epam.com \
--to=grygorii_strashko@epam.com \
--cc=Penny.Zheng@amd.com \
--cc=aisaila@bitdefender.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=ppircalabu@bitdefender.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=tamas@tklengyel.com \
--cc=teddy.astie@vates.tech \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.