Commit 37510dd5 authored by Juergen Gross's avatar Juergen Gross
Browse files

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: default avatarJuergen Gross <jgross@suse.com>
Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent ce9ecca0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ static void xen_power_off(void)

static irqreturn_t xen_arm_callback(int irq, void *arg)
{
	xen_hvm_evtchn_do_upcall();
	xen_evtchn_do_upcall();
	return IRQ_HANDLED;
}

+1 −1
Original line number Diff line number Diff line
@@ -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);
}
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);
}
+2 −19
Original line number Diff line number Diff line
@@ -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)
Loading