Skip to content

Commit b9d934f

Browse files
Boris OstrovskyDavid Vrabel
authored andcommitted
xen/console: Update console event channel on resume
After a resume the hypervisor/tools may change console event channel number. We should re-query it. Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: <stable@vger.kernel.org> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
1 parent 16f1cf3 commit b9d934f

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

drivers/tty/hvc/hvc_xen.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,27 @@ static int xen_initial_domain_console_init(void)
299299
return 0;
300300
}
301301

302+
static void xen_console_update_evtchn(struct xencons_info *info)
303+
{
304+
if (xen_hvm_domain()) {
305+
uint64_t v;
306+
int err;
307+
308+
err = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v);
309+
if (!err && v)
310+
info->evtchn = v;
311+
} else
312+
info->evtchn = xen_start_info->console.domU.evtchn;
313+
}
314+
302315
void xen_console_resume(void)
303316
{
304317
struct xencons_info *info = vtermno_to_xencons(HVC_COOKIE);
305-
if (info != NULL && info->irq)
318+
if (info != NULL && info->irq) {
319+
if (!xen_initial_domain())
320+
xen_console_update_evtchn(info);
306321
rebind_evtchn_irq(info->evtchn, info->irq);
322+
}
307323
}
308324

309325
static void xencons_disconnect_backend(struct xencons_info *info)

0 commit comments

Comments
 (0)