summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>2015-04-29 17:10:14 -0400
committerZefan Li <lizefan@huawei.com>2015-09-18 09:20:36 +0800
commitda91140159233782ddd65c4b88a3fe2c9243d36f (patch)
treee080582124f08de12bf2b1dcc02492fdfef0ab2e
parentbbb55274896b65b70a30b56243e99ce1a12ca6e8 (diff)
downloadlwn-da91140159233782ddd65c4b88a3fe2c9243d36f.tar.gz
lwn-da91140159233782ddd65c4b88a3fe2c9243d36f.zip
xen/console: Update console event channel on resume
commit b9d934f27c91b878c4b2e64299d6e419a4022f8d upstream. 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> Signed-off-by: David Vrabel <david.vrabel@citrix.com> Signed-off-by: Zefan Li <lizefan@huawei.com>
-rw-r--r--drivers/tty/hvc/hvc_xen.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index 944eaeb8e0cf..53e02b702a66 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -300,11 +300,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)