[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN][PATCH] xen: make VMTRACE support optional


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Tue, 11 Nov 2025 20:21:34 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H21cx4bnj4u1fPlLjXy2JWQVGn4I7j0WjgmUiq2H2pA=; b=OdWefzSG8ojKzXcs8zuM3JX90+jvm57E6O+vC+VdU2QuMocIGqy1eAAzsMmibXxZGE9iCWPGlGE1Ukk3HIGvbRw2u4xiaW0O8Ym8qSKBYIvTtfEnPdaNKooayZlymhOw780NouTLRpOG0t7EF9IrDkHoaCjF7pLENtAas+Xpie8vWQzqQtifDZ7s9Uapd5asmMNAoEwUbIdQNyy5qCvFmUbpKmO9evnS999DfUjvvFSEfhuZcAXhnS6JU7S/LvvBL2o54piFCdChsegCnPT84nWidw8w2FFICp4ced4MGEh66T1q71ZJrAO7MF7HTZ/TKpbnREZGqLBoBlS0GQsu3A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XPgXiLgpr73H14i3Tguk2Qdop3C1HpfQj7i6UoLyhTq/gEFyqVEVmVVrh5+0fDvcJm8DWia1wY8hp+z/OsTawmtUPkOKkPXKbPMmy3CBc6SEBBRVDDLYBSPZWYZH6AJPeYDk4eJDS4aXPSvxZDc6NHfwz3MVIEBLXM/dRkF8rNQtaTFSxPAWOteN+sxGNCrFxv+ttb/kTkiZoXvUsKtQyLCkHn5QHj4Ueq66cwOknmoER+PThC/CgJdTThY+2wSSOPe2SJgEvYM8CuPt0cmMhANI4YBIl2JqgtUSltXzvb6+SIUKPaT48VeRvPmP+cEYozTT0m0jH4DeKYfe4ltBEg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>, Petre Pircalabu <ppircalabu@xxxxxxxxxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
  • Delivery-date: Tue, 11 Nov 2025 18:22:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>



On 10.11.25 08:36, Jan Beulich wrote:
On 07.11.2025 16:47, Grygorii Strashko wrote:
Hi

On 06.11.25 16:09, Jan Beulich wrote:
On 06.11.2025 14:50, Grygorii Strashko wrote:
On 06.11.25 14:00, Jan Beulich wrote:
On 31.10.2025 22:20, Grygorii Strashko wrote:
--- a/xen/Kconfig.debug
+++ b/xen/Kconfig.debug
@@ -155,4 +155,19 @@ config DEBUG_INFO
          "make install-xen" for installing xen.efi, stripping needs to be
          done outside the Xen build environment).
    +config HAS_VMTRACE
+    bool
+
+config VMTRACE
+    bool "HW VM tracing support"
+    depends on HAS_VMTRACE
+    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 date can be retrieved using 
buffer

Nit: s/date/data/

+      shared between Xen and domain
+      (see XENMEM_acquire_resource(XENMEM_resource_vmtrace_buf)).
+

I was actually meaning to ask that "VMX only" should somehow be mentioned here,
but then I noticed this is an arch-independent location.

Right, Arch code advertise VMTRACE support with HAS_VMTRACE.
In this particular case:
config INTEL_VMX
...
     select HAS_VMTRACE


I'm not quite sure we want it like this (just yet).

?

To rephrase the question: Are we expecting anything other than VMX to support
VMTRACE any time soon?


That's I do not know.

I assume your point is similar to what Teddy noted [1].

I think vmtrace code can be consolidate, but question is on what level(s):

only:
  xen/arch/x86/hvm/vmx/
  |- vmtrace.c

or:
  xen/arch/x86/hvm
  |- vmtrace.c
     <- vmtrace_alloc/free_buffer(), acquire_vmtrace_buf(), do_vmtrace_op()
  xen/arch/x86/hvm/vmx/
  |- vmtrace.c

it will require more work comparing to the current change.

Well, I don't think code movement is strictly necessary here. But as I'm 
unconvinced
of Kconfig.debug (in whatever subdir) being an appropriate place to add this, 
for
the time being merely putting the new Kconfig option directly next to INTEL_VMX 
(and
then without any new HAS_*) wants at least considering, imo. If and when some 
other
use appears, HAS_* can be introduced and the whole thing moved.

For me it will be fine.


As otoh abstracting things in an arch-independent way also has its merits, it 
is -
as said - not quite clear to me which way we'd prefer to have it.

Jan

[1] https://patchwork.kernel.org/comment/26637627/



--
Best regards,
-grygorii




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.