]> xenbits.xensource.com Git - xen.git/commitdiff
x86/vPMU: drop regs parameter from interrupt functions
authorJan Beulich <jbeulich@suse.com>
Mon, 15 Jan 2024 11:19:41 +0000 (12:19 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 15 Jan 2024 11:19:41 +0000 (12:19 +0100)
The vendor functions don't use the respective parameters at all. In
vpmu_do_interrupt() there's only a very limited area where the
outer context's state would be needed, retrievable by get_irq_regs().

This is in preparation of dropping the register parameters from direct
APIC vector handler functions.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/apic.c
xen/arch/x86/cpu/vpmu.c
xen/arch/x86/cpu/vpmu_amd.c
xen/arch/x86/cpu/vpmu_intel.c
xen/arch/x86/include/asm/vpmu.h

index d00ff0943f3495cc425b7991c9e7a416e8ea71a1..da41d2dfedd6df8449bc017304620550c992af12 100644 (file)
@@ -1412,7 +1412,7 @@ static void cf_check error_interrupt(struct cpu_user_regs *regs)
 static void cf_check pmu_interrupt(struct cpu_user_regs *regs)
 {
     ack_APIC_irq();
-    vpmu_do_interrupt(regs);
+    vpmu_do_interrupt();
 }
 
 void __init apic_intr_init(void)
index ed84372b8001218b1e14960ab9b9d1e293579b35..2e08d2363c3e4a4b6de2bac959a5868ca5ed41a6 100644 (file)
@@ -158,7 +158,7 @@ static inline struct vcpu *choose_hwdom_vcpu(void)
     return hardware_domain->vcpu[idx];
 }
 
-void vpmu_do_interrupt(struct cpu_user_regs *regs)
+void vpmu_do_interrupt(void)
 {
     struct vcpu *sampled = current, *sampling;
     struct vpmu_struct *vpmu;
@@ -239,6 +239,7 @@ void vpmu_do_interrupt(struct cpu_user_regs *regs)
         else
 #endif
         {
+            const struct cpu_user_regs *regs = get_irq_regs();
             struct xen_pmu_regs *r = &vpmu->xenpmu_data->pmu.r.regs;
 
             if ( (vpmu_mode & XENPMU_MODE_SELF) )
@@ -301,7 +302,7 @@ void vpmu_do_interrupt(struct cpu_user_regs *regs)
     /* We don't support (yet) HVM dom0 */
     ASSERT(sampling == sampled);
 
-    if ( !alternative_call(vpmu_ops.do_interrupt, regs) ||
+    if ( !alternative_call(vpmu_ops.do_interrupt) ||
          !is_vlapic_lvtpc_enabled(vlapic) )
         return;
 
index c28a7e3c4719c5cf34c23b4db3f04ddce817e0d9..db2fa420e14ab00ff2ff82fc8a9de9bbb726a523 100644 (file)
@@ -175,7 +175,7 @@ static void amd_vpmu_unset_msr_bitmap(struct vcpu *v)
     msr_bitmap_off(vpmu);
 }
 
-static int cf_check amd_vpmu_do_interrupt(struct cpu_user_regs *regs)
+static int cf_check amd_vpmu_do_interrupt(void)
 {
     return 1;
 }
index 0a73ae27a4cb1e91002cd3fab4d3eb3058a1e26f..cd414165dfce3adfe4494cfc435c1c62a4978060 100644 (file)
@@ -772,7 +772,7 @@ static void cf_check core2_vpmu_dump(const struct vcpu *v)
     }
 }
 
-static int cf_check core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
+static int cf_check core2_vpmu_do_interrupt(void)
 {
     struct vcpu *v = current;
     u64 msr_content;
index 6629093197c3ba644d253b82acb76d62877a3c7e..f271f28e4a74a990a91dcc2b94851c6b179cc69b 100644 (file)
@@ -31,7 +31,7 @@ struct arch_vpmu_ops {
     int (*initialise)(struct vcpu *v);
     int (*do_wrmsr)(unsigned int msr, uint64_t msr_content);
     int (*do_rdmsr)(unsigned int msr, uint64_t *msr_content);
-    int (*do_interrupt)(struct cpu_user_regs *regs);
+    int (*do_interrupt)(void);
     void (*arch_vpmu_destroy)(struct vcpu *v);
     int (*arch_vpmu_save)(struct vcpu *v, bool to_guest);
     int (*arch_vpmu_load)(struct vcpu *v, bool from_guest);
@@ -99,7 +99,7 @@ static inline bool vpmu_are_all_set(const struct vpmu_struct *vpmu,
 
 void vpmu_lvtpc_update(uint32_t val);
 int vpmu_do_msr(unsigned int msr, uint64_t *msr_content, bool is_write);
-void vpmu_do_interrupt(struct cpu_user_regs *regs);
+void vpmu_do_interrupt(void);
 void vpmu_initialise(struct vcpu *v);
 void vpmu_destroy(struct vcpu *v);
 void vpmu_save(struct vcpu *v);