diff options
author | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2015-04-29 17:10:14 -0400 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-05-23 15:53:06 -0400 |
commit | 0120beac6be73f3bdf3ddce4eb428d7667c08cef (patch) | |
tree | 41a4f4982b3b2c6a079e7f553cc8b4cb67357b84 /drivers/tty | |
parent | df39fed60dbca981281fe1df2082d60bed944d68 (diff) |
xen/console: Update console event channel on resume
[ Upstream commit b9d934f27c91b878c4b2e64299d6e419a4022f8d ]
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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/hvc/hvc_xen.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index f1e57425e39f..5bab1c684bb1 100644 --- a/drivers/tty/hvc/hvc_xen.c +++ b/drivers/tty/hvc/hvc_xen.c @@ -299,11 +299,27 @@ static int xen_initial_domain_console_init(void) 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) { 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); + } } static void xencons_disconnect_backend(struct xencons_info *info) |