[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] x86/vPMU: drop regs parameter from interrupt functions
commit cd574f3ed86636fb2375deaf2767b9f3e287cdc6 Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Mon Jan 15 12:19:41 2024 +0100 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Mon Jan 15 12:19:41 2024 +0100 x86/vPMU: drop regs parameter from interrupt functions 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@xxxxxxxx> Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> --- xen/arch/x86/apic.c | 2 +- xen/arch/x86/cpu/vpmu.c | 5 +++-- xen/arch/x86/cpu/vpmu_amd.c | 2 +- xen/arch/x86/cpu/vpmu_intel.c | 2 +- xen/arch/x86/include/asm/vpmu.h | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c index d00ff0943f..da41d2dfed 100644 --- a/xen/arch/x86/apic.c +++ b/xen/arch/x86/apic.c @@ -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) diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c index ed84372b80..2e08d2363c 100644 --- a/xen/arch/x86/cpu/vpmu.c +++ b/xen/arch/x86/cpu/vpmu.c @@ -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; diff --git a/xen/arch/x86/cpu/vpmu_amd.c b/xen/arch/x86/cpu/vpmu_amd.c index c28a7e3c47..db2fa420e1 100644 --- a/xen/arch/x86/cpu/vpmu_amd.c +++ b/xen/arch/x86/cpu/vpmu_amd.c @@ -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; } diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c index 0a73ae27a4..cd414165df 100644 --- a/xen/arch/x86/cpu/vpmu_intel.c +++ b/xen/arch/x86/cpu/vpmu_intel.c @@ -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; diff --git a/xen/arch/x86/include/asm/vpmu.h b/xen/arch/x86/include/asm/vpmu.h index 6629093197..f271f28e4a 100644 --- a/xen/arch/x86/include/asm/vpmu.h +++ b/xen/arch/x86/include/asm/vpmu.h @@ -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); -- generated by git-patchbot for /home/xen/git/xen.git#master
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |