diff options
author | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2015-04-29 17:10:14 -0400 |
---|---|---|
committer | David Vrabel <david.vrabel@citrix.com> | 2015-05-05 13:27:14 -0400 |
commit | b9d934f27c91b878c4b2e64299d6e419a4022f8d (patch) | |
tree | d18f9087d81ed59ec199eed1696aa754a5171618 | |
parent | 16f1cf3ba7303228372d3756677bf7d10e79cf9f (diff) |
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>
-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) | |||
299 | return 0; | 299 | return 0; |
300 | } | 300 | } |
301 | 301 | ||
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 | |||
302 | void xen_console_resume(void) | 315 | void xen_console_resume(void) |
303 | { | 316 | { |
304 | struct xencons_info *info = vtermno_to_xencons(HVC_COOKIE); | 317 | 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); | ||
306 | rebind_evtchn_irq(info->evtchn, info->irq); | 321 | rebind_evtchn_irq(info->evtchn, info->irq); |
322 | } | ||
307 | } | 323 | } |
308 | 324 | ||
309 | static void xencons_disconnect_backend(struct xencons_info *info) | 325 | static void xencons_disconnect_backend(struct xencons_info *info) |