Commit b9d934f2 authored by Boris Ostrovsky's avatar Boris Ostrovsky Committed by David Vrabel

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: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
parent 16f1cf3b
...@@ -299,11 +299,27 @@ static int xen_initial_domain_console_init(void) ...@@ -299,11 +299,27 @@ static int xen_initial_domain_console_init(void)
return 0; return 0;
} }
static void xen_console_update_evtchn(struct xencons_info *info)
{
if (xen_hvm_domain()) {
uint64_t v;
int err;
err = hvm_get_parameter(HVM_PARAM_CONSOLE_EVTCHN, &v);
if (!err && v)
info->evtchn = v;
} else
info->evtchn = xen_start_info->console.domU.evtchn;
}
void xen_console_resume(void) void xen_console_resume(void)
{ {
struct xencons_info *info = vtermno_to_xencons(HVC_COOKIE); struct xencons_info *info = vtermno_to_xencons(HVC_COOKIE);
if (info != NULL && info->irq) if (info != NULL && info->irq) {
if (!xen_initial_domain())
xen_console_update_evtchn(info);
rebind_evtchn_irq(info->evtchn, info->irq); rebind_evtchn_irq(info->evtchn, info->irq);
}
} }
static void xencons_disconnect_backend(struct xencons_info *info) static void xencons_disconnect_backend(struct xencons_info *info)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment