Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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()

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Juergen Gross <jgross@suse.com>

+8 -26
+1 -1
arch/arm/xen/enlighten.c
··· 207 207 208 208 static irqreturn_t xen_arm_callback(int irq, void *arg) 209 209 { 210 - xen_hvm_evtchn_do_upcall(); 210 + xen_evtchn_do_upcall(); 211 211 return IRQ_HANDLED; 212 212 } 213 213
+1 -1
arch/x86/entry/common.c
··· 294 294 295 295 inc_irq_stat(irq_hv_callback_count); 296 296 297 - xen_hvm_evtchn_do_upcall(); 297 + xen_evtchn_do_upcall(); 298 298 299 299 set_irq_regs(old_regs); 300 300 }
+1 -1
arch/x86/xen/enlighten.c
··· 32 32 * &HYPERVISOR_shared_info->vcpu_info[cpu]. See xen_hvm_init_shared_info 33 33 * and xen_vcpu_setup for details. By default it points to share_info->vcpu_info 34 34 * but during boot it is switched to point to xen_vcpu_info. 35 - * The pointer is used in __xen_evtchn_do_upcall to acknowledge pending events. 35 + * The pointer is used in xen_evtchn_do_upcall to acknowledge pending events. 36 36 */ 37 37 DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); 38 38 DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);
+1 -1
arch/x86/xen/enlighten_hvm.c
··· 136 136 137 137 inc_irq_stat(irq_hv_callback_count); 138 138 139 - xen_hvm_evtchn_do_upcall(); 139 + xen_evtchn_do_upcall(); 140 140 141 141 set_irq_regs(old_regs); 142 142 }
+2 -19
drivers/xen/events/events_base.c
··· 1704 1704 generic_handle_irq(irq); 1705 1705 } 1706 1706 1707 - static int __xen_evtchn_do_upcall(void) 1707 + int xen_evtchn_do_upcall(void) 1708 1708 { 1709 1709 struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu); 1710 1710 int ret = vcpu_info->evtchn_upcall_pending ? IRQ_HANDLED : IRQ_NONE; ··· 1735 1735 1736 1736 return ret; 1737 1737 } 1738 - 1739 - void xen_evtchn_do_upcall(struct pt_regs *regs) 1740 - { 1741 - struct pt_regs *old_regs = set_irq_regs(regs); 1742 - 1743 - irq_enter(); 1744 - 1745 - __xen_evtchn_do_upcall(); 1746 - 1747 - irq_exit(); 1748 - set_irq_regs(old_regs); 1749 - } 1750 - 1751 - int xen_hvm_evtchn_do_upcall(void) 1752 - { 1753 - return __xen_evtchn_do_upcall(); 1754 - } 1755 - EXPORT_SYMBOL_GPL(xen_hvm_evtchn_do_upcall); 1738 + EXPORT_SYMBOL_GPL(xen_evtchn_do_upcall); 1756 1739 1757 1740 /* Rebind a new event channel to an existing irq. */ 1758 1741 void rebind_evtchn_irq(evtchn_port_t evtchn, int irq)
+1 -1
drivers/xen/platform-pci.c
··· 64 64 65 65 static irqreturn_t do_hvm_evtchn_intr(int irq, void *dev_id) 66 66 { 67 - return xen_hvm_evtchn_do_upcall(); 67 + return xen_evtchn_do_upcall(); 68 68 } 69 69 70 70 static int xen_allocate_irq(struct pci_dev *pdev)
+1 -2
include/xen/events.h
··· 105 105 evtchn_port_t evtchn_from_irq(unsigned irq); 106 106 107 107 int xen_set_callback_via(uint64_t via); 108 - void xen_evtchn_do_upcall(struct pt_regs *regs); 109 - int xen_hvm_evtchn_do_upcall(void); 108 + int xen_evtchn_do_upcall(void); 110 109 111 110 /* Bind a pirq for a physical interrupt to an irq. */ 112 111 int xen_bind_pirq_gsi_to_irq(unsigned gsi,