Skip to content

Commit 37510dd

Browse files
committed
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>
1 parent ce9ecca commit 37510dd

File tree

7 files changed

+8
-26
lines changed

7 files changed

+8
-26
lines changed

arch/arm/xen/enlighten.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static void xen_power_off(void)
207207

208208
static irqreturn_t xen_arm_callback(int irq, void *arg)
209209
{
210-
xen_hvm_evtchn_do_upcall();
210+
xen_evtchn_do_upcall();
211211
return IRQ_HANDLED;
212212
}
213213

arch/x86/entry/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static void __xen_pv_evtchn_do_upcall(struct pt_regs *regs)
294294

295295
inc_irq_stat(irq_hv_callback_count);
296296

297-
xen_hvm_evtchn_do_upcall();
297+
xen_evtchn_do_upcall();
298298

299299
set_irq_regs(old_regs);
300300
}

arch/x86/xen/enlighten.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ EXPORT_SYMBOL_GPL(hypercall_page);
3232
* &HYPERVISOR_shared_info->vcpu_info[cpu]. See xen_hvm_init_shared_info
3333
* and xen_vcpu_setup for details. By default it points to share_info->vcpu_info
3434
* 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.
3636
*/
3737
DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);
3838
DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);

arch/x86/xen/enlighten_hvm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_xen_hvm_callback)
136136

137137
inc_irq_stat(irq_hv_callback_count);
138138

139-
xen_hvm_evtchn_do_upcall();
139+
xen_evtchn_do_upcall();
140140

141141
set_irq_regs(old_regs);
142142
}

drivers/xen/events/events_base.c

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,7 @@ void handle_irq_for_port(evtchn_port_t port, struct evtchn_loop_ctrl *ctrl)
17041704
generic_handle_irq(irq);
17051705
}
17061706

1707-
static int __xen_evtchn_do_upcall(void)
1707+
int xen_evtchn_do_upcall(void)
17081708
{
17091709
struct vcpu_info *vcpu_info = __this_cpu_read(xen_vcpu);
17101710
int ret = vcpu_info->evtchn_upcall_pending ? IRQ_HANDLED : IRQ_NONE;
@@ -1735,24 +1735,7 @@ static int __xen_evtchn_do_upcall(void)
17351735

17361736
return ret;
17371737
}
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);
17561739

17571740
/* Rebind a new event channel to an existing irq. */
17581741
void rebind_evtchn_irq(evtchn_port_t evtchn, int irq)

drivers/xen/platform-pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static uint64_t get_callback_via(struct pci_dev *pdev)
6464

6565
static irqreturn_t do_hvm_evtchn_intr(int irq, void *dev_id)
6666
{
67-
return xen_hvm_evtchn_do_upcall();
67+
return xen_evtchn_do_upcall();
6868
}
6969

7070
static int xen_allocate_irq(struct pci_dev *pdev)

include/xen/events.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ int irq_from_virq(unsigned int cpu, unsigned int virq);
105105
evtchn_port_t evtchn_from_irq(unsigned irq);
106106

107107
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);
110109

111110
/* Bind a pirq for a physical interrupt to an irq. */
112111
int xen_bind_pirq_gsi_to_irq(unsigned gsi,

0 commit comments

Comments
 (0)