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

[PATCH] x86: cpu{id,}_policy_updated() can be static


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 18 Apr 2023 11:35:41 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=sKyDnkik5ayw5gfaTdlRNJoU3D5nuUPMckTjZzUPdmc=; b=UCEttQOT8Ag4EhyV5k70RSl20QVmPAsabIKdWjrRZVa4TA9fgkjdVU6x/fR+wngYq7m4RevniH1XybZPLTqUvRodnvR20c9qvHQlv93Ulro9qh9HvUyfFUrUSy18elSD7BSJ8D1ZUr76Zn6mg/QERoeVly36hwMR56YJABDUBCCKZyPouoEz3pv07DgLCRdDxGQjvWm4zrj94ELWIaZRW3wDutE2VtaZ+GeXche6HrnoUdNDCP3CIHNl1VXqoVkZi8t+L1H8MvJ6NNj41N3SnSCmaafw+YdNRFy8Dn9Let3NfW8ON6iBp4+RtqGWpP8dpstTKaOvl87YvVldlahjPg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e00X9ptd8NzNCDjQIN9sLm4B7Nmi54ZeJUZL0VYiZMe2Xuu5Sjfn7SWsC4hFknkMh9iEE4f/SjJ7qQ3dDjZFYihXNo6DCv9JN4bzn2QMRlA9SYiGffGk5UMu8ck1Zwf/VcmnK2temYijxskMSUgT3f2C3BAwTZ9YOUJuvaK/SU5FzWw8/7LyxZqs6RnAcAIdB9O8j1vBRQ9FZgEQ4h4gzZRFC376kQcetJ18P6C8bDmrIvE2k4KDAYbuv4AIhemSRnKPakQAafRcueBf7m2EeBAzEK+s15eq288yZ99vKGFM8loNXrDH8aK+tVXTz6tAXEpYQpUSWObWAAPkEmxjQA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 18 Apr 2023 09:35:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The function merely needs moving earlier in the file to avoid the need
for a forward declaration. While moving it, also rename it following the
recent folding of CPUID and MSR policies.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -288,6 +288,16 @@ void update_guest_memory_policy(struct v
     }
 }
 
+/*
+ * Called during vcpu construction, and each time the toolstack changes the
+ * CPUID configuration for the domain.
+ */
+static void cpu_policy_updated(struct vcpu *v)
+{
+    if ( is_hvm_vcpu(v) )
+        hvm_cpuid_policy_changed(v);
+}
+
 void domain_cpu_policy_changed(struct domain *d)
 {
     const struct cpu_policy *p = d->arch.cpu_policy;
@@ -446,7 +456,7 @@ void domain_cpu_policy_changed(struct do
 
     for_each_vcpu ( d, v )
     {
-        cpuid_policy_updated(v);
+        cpu_policy_updated(v);
 
         /* If PMU version is zero then the guest doesn't have VPMU */
         if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
@@ -591,7 +601,7 @@ int arch_vcpu_create(struct vcpu *v)
     {
         vpmu_initialise(v);
 
-        cpuid_policy_updated(v);
+        cpu_policy_updated(v);
     }
 
     return rc;
@@ -2416,16 +2426,6 @@ int domain_relinquish_resources(struct d
     return 0;
 }
 
-/*
- * Called during vcpu construction, and each time the toolstack changes the
- * CPUID configuration for the domain.
- */
-void cpuid_policy_updated(struct vcpu *v)
-{
-    if ( is_hvm_vcpu(v) )
-        hvm_cpuid_policy_changed(v);
-}
-
 void arch_dump_domain_info(struct domain *d)
 {
     paging_dump_domain_info(d);
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -83,8 +83,6 @@ void toggle_guest_mode(struct vcpu *);
 /* x86/64: toggle guest page tables between kernel and user modes. */
 void toggle_guest_pt(struct vcpu *);
 
-void cpuid_policy_updated(struct vcpu *v);
-
 /*
  * Initialise a hypercall-transfer page. The given pointer must be mapped
  * in Xen virtual address space (accesses are not validated or checked).



 


Rackspace

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