diff options
Diffstat (limited to 'drivers/xen/xenbus/xenbus_xs.c')
-rw-r--r-- | drivers/xen/xenbus/xenbus_xs.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index 131dec04794..48220e129f8 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <xen/xenbus.h> | 48 | #include <xen/xenbus.h> |
49 | #include <xen/xen.h> | 49 | #include <xen/xen.h> |
50 | #include "xenbus_comms.h" | 50 | #include "xenbus_comms.h" |
51 | #include <asm/xen/hypervisor.h> | ||
51 | 52 | ||
52 | struct xs_stored_msg { | 53 | struct xs_stored_msg { |
53 | struct list_head list; | 54 | struct list_head list; |
@@ -618,7 +619,24 @@ static struct xenbus_watch *find_watch(const char *token) | |||
618 | 619 | ||
619 | return NULL; | 620 | return NULL; |
620 | } | 621 | } |
622 | /* | ||
623 | * Certain older XenBus toolstack cannot handle reading values that are | ||
624 | * not populated. Some Xen 3.4 installation are incapable of doing this | ||
625 | * so if we are running on anything older than 4 do not attempt to read | ||
626 | * control/platform-feature-xs_reset_watches. | ||
627 | */ | ||
628 | static bool xen_strict_xenbus_quirk() | ||
629 | { | ||
630 | uint32_t eax, ebx, ecx, edx, base; | ||
631 | |||
632 | base = xen_cpuid_base(); | ||
633 | cpuid(base + 1, &eax, &ebx, &ecx, &edx); | ||
621 | 634 | ||
635 | if ((eax >> 16) < 4) | ||
636 | return true; | ||
637 | return false; | ||
638 | |||
639 | } | ||
622 | static void xs_reset_watches(void) | 640 | static void xs_reset_watches(void) |
623 | { | 641 | { |
624 | int err, supported = 0; | 642 | int err, supported = 0; |
@@ -626,6 +644,9 @@ static void xs_reset_watches(void) | |||
626 | if (!xen_hvm_domain() || xen_initial_domain()) | 644 | if (!xen_hvm_domain() || xen_initial_domain()) |
627 | return; | 645 | return; |
628 | 646 | ||
647 | if (xen_strict_xenbus_quirk()) | ||
648 | return; | ||
649 | |||
629 | err = xenbus_scanf(XBT_NIL, "control", | 650 | err = xenbus_scanf(XBT_NIL, "control", |
630 | "platform-feature-xs_reset_watches", "%d", &supported); | 651 | "platform-feature-xs_reset_watches", "%d", &supported); |
631 | if (err != 1 || !supported) | 652 | if (err != 1 || !supported) |