xen: simplify evtchn_do_upcall() call maze
Subsystems (4)
Juergen Gross
maintainerPATCH 1/1 xen: simplify evtchn_do_upcall() call maze
There are several functions involved for performing the functionality of evtchn_do_upcall():
- __xen_evtchn_do_upcall() doing the real work
- xen_hvm_evtchn_do_upcall() just being a wrapper for __xen_evtchn_do_upcall(), exposed for external callers
- xen_evtchn_do_upcall() calling __xen_evtchn_do_upcall(), too, but without any user
Simplify this maze by:
- removing the unused xen_evtchn_do_upcall()
- removing xen_hvm_evtchn_do_upcall() as the only left caller of __xen_evtchn_do_upcall(), while renaming __xen_evtchn_do_upcall() to xen_evtchn_do_upcall()
--- arch/x86/entry/common.c | 2 +- arch/x86/xen/enlighten.c | 2 +- arch/x86/xen/enlighten_hvm.c | 2 +- drivers/xen/events/events_base.c | 21 ++------------------- drivers/xen/platform-pci.c | 2 +- include/xen/events.h | 3 +-- 6 files changed, 7 insertions(+), 25 deletions(-)
arch/x86/entry/common.c +1 -1
@@ -294,7 +294,7 @@ static void __xen_pv_evtchn_do_upcall(struct pt_regs *regs)inc_irq_stat (irq_hv_callback_count); -xen_hvm_evtchn_do_upcall (); +xen_evtchn_do_upcall ();set_irq_regs (old_regs); }
arch/x86/xen/enlighten.c +1 -1
@@ -32,7 +32,7 @@ EXPORT_SYMBOL_GPL(hypercall_page);* &HYPERVISOR_shared_info->vcpu_info[cpu]. See xen_hvm_init_shared_info * and xen_vcpu_setup for details. By default it points to share_info->vcpu_info * but during boot it is switched to point to xen_vcpu_info. -* The pointer is used in __xen_evtchn_do_upcall to acknowledge pending events. +* The pointer is used in xen_evtchn_do_upcall to acknowledge pending events. */ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
arch/x86/xen/enlighten_hvm.c +1 -1
@@ -136,7 +136,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_xen_hvm_callback)inc_irq_stat (irq_hv_callback_count); -xen_hvm_evtchn_do_upcall (); +xen_evtchn_do_upcall ();set_irq_regs (old_regs); }
drivers/xen/events/events_base.c +2 -19
@@ -1704,7 +1704,7 @@ void handle_irq_for_port(evtchn_port_t port, struct evtchn_loop_ctrl *ctrl)generic_handle_irq (irq); } -static int __xen_evtchn_do_upcall (void ) +int xen_evtchn_do_upcall (void ) {struct vcpu_info *vcpu_info =__this_cpu_read (xen_vcpu);int ret = vcpu_info->evtchn_upcall_pending ?IRQ_HANDLED :IRQ_NONE ;
@@ -1735,24 +1735,7 @@ static int __xen_evtchn_do_upcall(void)return ret; } - -void xen_evtchn_do_upcall (struct pt_regs *regs) -{ -struct pt_regs *old_regs =set_irq_regs (regs); - -irq_enter (); - -__xen_evtchn_do_upcall (); - -irq_exit (); -set_irq_regs (old_regs); -} - -int xen_hvm_evtchn_do_upcall (void ) -{ -return __xen_evtchn_do_upcall (); -} -EXPORT_SYMBOL_GPL (xen_hvm_evtchn_do_upcall); +EXPORT_SYMBOL_GPL (xen_evtchn_do_upcall);/* Rebind a new event channel to an existing irq. */ void rebind_evtchn_irq (evtchn_port_t evtchn,int irq)
drivers/xen/platform-pci.c +1 -1
@@ -64,7 +64,7 @@ static uint64_t get_callback_via(struct pci_dev *pdev)static irqreturn_t do_hvm_evtchn_intr (int irq,void *dev_id) { -return xen_hvm_evtchn_do_upcall (); +return xen_evtchn_do_upcall (); }static int xen_allocate_irq (struct pci_dev *pdev)
include/xen/events.h +1 -2
@@ -106,8 +106,7 @@ int irq_from_virq(unsigned int cpu, unsigned int virq);evtchn_port_t evtchn_from_irq (unsigned irq);int xen_set_callback_via (uint64_t via); -void xen_evtchn_do_upcall (struct pt_regs *regs); -int xen_hvm_evtchn_do_upcall (void ); +int xen_evtchn_do_upcall (void );/* Bind a pirq for a physical interrupt to an irq. */ int xen_bind_pirq_gsi_to_irq(unsigned gsi,
Signature · 1 line
2.35.3
Quoted 9 lines · Juergen Gross
There are several functions involved for performing the functionality of
evtchn_do_upcall():-
__xen_evtchn_do_upcall()doing the real work
-xen_hvm_evtchn_do_upcall()just being a wrapper for__xen_evtchn_do_upcall(), exposed for external callers
-xen_evtchn_do_upcall()calling__xen_evtchn_do_upcall(), too, but without any user
Quoted 8 lines
Simplify this maze by:
- removing the unused
xen_evtchn_do_upcall()
- removingxen_hvm_evtchn_do_upcall()as the only left caller of__xen_evtchn_do_upcall(), while renaming__xen_evtchn_do_upcall()toxen_evtchn_do_upcall()Signed-off-by Juergen Gross <[email protected]>
Quoted 9 lines · Juergen Gross
There are several functions involved for performing the functionality of
evtchn_do_upcall():-
__xen_evtchn_do_upcall()doing the real work
-xen_hvm_evtchn_do_upcall()just being a wrapper for__xen_evtchn_do_upcall(), exposed for external callers
-xen_evtchn_do_upcall()calling__xen_evtchn_do_upcall(), too, but without any user
Quoted 8 lines
Simplify this maze by:
- removing the unused
xen_evtchn_do_upcall()
- removingxen_hvm_evtchn_do_upcall()as the only left caller of__xen_evtchn_do_upcall(), while renaming__xen_evtchn_do_upcall()toxen_evtchn_do_upcall()Signed-off-by Juergen Gross <[email protected]>