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

[PATCH v3 07/20] xen/sysctl: wrap around XEN_SYSCTL_perfc_op


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Mon, 21 Apr 2025 15:37:10 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=ZtqepNbzG/v0HEc0GM7qbXHNRHLGLqkNYOLvoJlXcTQ=; b=Dl8ujQ6dwkQn9CnSLPtf5dJVlMlqE26QnvrvSR49s0eMk/j9yJhnanr2ih6AhQ/MCY+SkiX6+o6B5JpUqahd0MC+XqP89EkiCKvavkMBHhLISrlKdQ+ioBQzZpKf5upjrN2lgQDpKK8Z/Un5LeTGVZD5dOh9gMmiM4SaWzPYiNQrHtNLN7kvcsqpG7o8bipS0c8Zx+ugGyIcXccj85gIjiux61vEH5aZSpIG6smiV7A+xqCEIhWUxPkgyuvj6OuOLBP71hK9SBWBIMcywWjKRVO+RvzH30Y4LORimSxdguPObqXa2ZaoHaZmtVYBi3WlJQYqM+MrR/LZa8UIuhCeZA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=s/xHelMs1EsbXpI6QsNfIvzryL+EuXW01gJ8TRMi1TShYPGGwFRNtaUg0pqKOHCNIA7CbNYDgPKlK/a72LKSgaAHMVdy/Pr40J1yFZaZYcPqnPGQ+/crPE5+bVnUXlW517J5X1OkoVHcCg9C5cqphlh8nw3GqUZxXjSqxSU3aEZd3YtWDEoBmeZj7cG+uWIblacie2FtnvvFYFvOFaVyQV0aVZuRcfHgAy3c7bRnZCL8XKcbBk+jhEt9jNKJiULUR1xOZcMW/LhV/CgYcbdCU+HEwzD9XZaLD3dzazXrV+ftwhqpnw+BVDbkpc1iO2XaBiE9QHgSiMfSxPD6DMa1Ug==
  • Cc: <ray.huang@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, "Julien Grall" <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Mon, 21 Apr 2025 07:38:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

perfc_control() and perfc_copy_info() are responsible for providing control
of perf counters via XEN_SYSCTL_perfc_op in DOM0, so they both shall
be wrapped.

Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 xen/common/perfc.c  | 2 ++
 xen/common/sysctl.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/xen/common/perfc.c b/xen/common/perfc.c
index 8302b7cf6d..0f3b89af2c 100644
--- a/xen/common/perfc.c
+++ b/xen/common/perfc.c
@@ -149,6 +149,7 @@ void cf_check perfc_reset(unsigned char key)
     }
 }
 
+#ifdef CONFIG_SYSCTL
 static struct xen_sysctl_perfc_desc perfc_d[NR_PERFCTRS];
 static xen_sysctl_perfc_val_t *perfc_vals;
 static unsigned int      perfc_nbr_vals;
@@ -265,6 +266,7 @@ int perfc_control(struct xen_sysctl_perfc_op *pc)
 
     return rc;
 }
+#endif /* CONFIG_SYSCTL */
 
 /*
  * Local variables:
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index b644347b40..608e159571 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -117,11 +117,13 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) 
u_sysctl)
     }
     break;
 
+#ifdef CONFIG_SYSCTL
 #ifdef CONFIG_PERF_COUNTERS
     case XEN_SYSCTL_perfc_op:
         ret = perfc_control(&op->u.perfc_op);
         break;
 #endif
+#endif /* CONFIG_SYSCTL */
 
 #ifdef CONFIG_DEBUG_LOCK_PROFILE
     case XEN_SYSCTL_lockprof_op:
-- 
2.34.1




 


Rackspace

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