Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b953a5e authored by Boris Ostrovsky's avatar Boris Ostrovsky Committed by David Vrabel
Browse files

xen: Suspend ticks on all CPUs during suspend



Commit 77e32c89 ("clockevents: Manage device's state separately for
the core") decouples clockevent device's modes from states. With this
change when a Xen guest tries to resume, it won't be calling its
set_mode op which needs to be done on each VCPU in order to make the
hypervisor aware that we are in oneshot mode.

This happens because clockevents_tick_resume() (which is an intermediate
step of resuming ticks on a processor) doesn't call clockevents_set_state()
anymore and because during suspend clockevent devices on all VCPUs (except
for the one doing the suspend) are left in ONESHOT state. As result, during
resume the clockevents state machine will assume that device is already
where it should be and doesn't need to be updated.

To avoid this problem we should suspend ticks on all VCPUs during
suspend.

Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
parent b44166cd
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -88,7 +88,17 @@ static void xen_vcpu_notify_restore(void *data)
	tick_resume_local();
}

static void xen_vcpu_notify_suspend(void *data)
{
	tick_suspend_local();
}

void xen_arch_resume(void)
{
	on_each_cpu(xen_vcpu_notify_restore, NULL, 1);
}

void xen_arch_suspend(void)
{
	on_each_cpu(xen_vcpu_notify_suspend, NULL, 1);
}
+6 −3
Original line number Diff line number Diff line
@@ -131,6 +131,8 @@ static void do_suspend(void)
		goto out_resume;
	}

	xen_arch_suspend();

	si.cancelled = 1;

	err = stop_machine(xen_suspend, &si, cpumask_of(0));
@@ -148,11 +150,12 @@ static void do_suspend(void)
		si.cancelled = 1;
	}

out_resume:
	if (!si.cancelled) {
	xen_arch_resume();

out_resume:
	if (!si.cancelled)
		xs_resume();
	} else
	else
		xs_suspend_cancel();

	dpm_resume_end(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ void xen_arch_post_suspend(int suspend_cancelled);

void xen_timer_resume(void);
void xen_arch_resume(void);
void xen_arch_suspend(void);

void xen_resume_notifier_register(struct notifier_block *nb);
void xen_resume_notifier_unregister(struct notifier_block *nb);