diff options
| author | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2015-04-29 17:10:13 -0400 |
|---|---|---|
| committer | David Vrabel <david.vrabel@citrix.com> | 2015-05-05 13:27:13 -0400 |
| commit | 16f1cf3ba7303228372d3756677bf7d10e79cf9f (patch) | |
| tree | 399b3a03d53ee01b3ad986f1d26b65dfa8fd6792 | |
| parent | 5cec98834989a014a9560b1841649eaca95cf00e (diff) | |
xen/xenbus: Update xenbus event channel on resume
After a resume the hypervisor/tools may change xenbus 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/xen/xenbus/xenbus_probe.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index 564b31584860..5390a674b5e3 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c | |||
| @@ -57,6 +57,7 @@ | |||
| 57 | #include <xen/xen.h> | 57 | #include <xen/xen.h> |
| 58 | #include <xen/xenbus.h> | 58 | #include <xen/xenbus.h> |
| 59 | #include <xen/events.h> | 59 | #include <xen/events.h> |
| 60 | #include <xen/xen-ops.h> | ||
| 60 | #include <xen/page.h> | 61 | #include <xen/page.h> |
| 61 | 62 | ||
| 62 | #include <xen/hvm.h> | 63 | #include <xen/hvm.h> |
| @@ -735,6 +736,30 @@ static int __init xenstored_local_init(void) | |||
| 735 | return err; | 736 | return err; |
| 736 | } | 737 | } |
| 737 | 738 | ||
| 739 | static int xenbus_resume_cb(struct notifier_block *nb, | ||
| 740 | unsigned long action, void *data) | ||
| 741 | { | ||
| 742 | int err = 0; | ||
| 743 | |||
| 744 | if (xen_hvm_domain()) { | ||
| 745 | uint64_t v; | ||
| 746 | |||
| 747 | err = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN, &v); | ||
| 748 | if (!err && v) | ||
| 749 | xen_store_evtchn = v; | ||
| 750 | else | ||
| 751 | pr_warn("Cannot update xenstore event channel: %d\n", | ||
| 752 | err); | ||
| 753 | } else | ||
| 754 | xen_store_evtchn = xen_start_info->store_evtchn; | ||
| 755 | |||
| 756 | return err; | ||
| 757 | } | ||
| 758 | |||
| 759 | static struct notifier_block xenbus_resume_nb = { | ||
| 760 | .notifier_call = xenbus_resume_cb, | ||
| 761 | }; | ||
| 762 | |||
| 738 | static int __init xenbus_init(void) | 763 | static int __init xenbus_init(void) |
| 739 | { | 764 | { |
| 740 | int err = 0; | 765 | int err = 0; |
| @@ -793,6 +818,10 @@ static int __init xenbus_init(void) | |||
| 793 | goto out_error; | 818 | goto out_error; |
| 794 | } | 819 | } |
| 795 | 820 | ||
| 821 | if ((xen_store_domain_type != XS_LOCAL) && | ||
| 822 | (xen_store_domain_type != XS_UNKNOWN)) | ||
| 823 | xen_resume_notifier_register(&xenbus_resume_nb); | ||
| 824 | |||
| 796 | #ifdef CONFIG_XEN_COMPAT_XENFS | 825 | #ifdef CONFIG_XEN_COMPAT_XENFS |
| 797 | /* | 826 | /* |
| 798 | * Create xenfs mountpoint in /proc for compatibility with | 827 | * Create xenfs mountpoint in /proc for compatibility with |
