This is backport of upstream commit cb6b6df111e46b9d0f79eb971575fd50555f43f4 that is required to run Fedora 18 as HVM guest on RHEL 5 Xen hypervisor.
xen/pv-on-hvm kexec: add quirk for Xen 3.4 and shutdown watches.
The commit 254d1a3f02ebc10ccc6e4903394d8d3f484f715e, titled "xen/pv-on-hvm kexec: shutdown watches from old kernel" assumes that the XenBus backend can deal with reading of values from: "control/platform-feature-xs_reset_watches":
... a patch for xenstored is required so that it accepts the XS_RESET_WATCHES request from a client (see changeset 23839:42a45baf037d in xen-unstable.hg). Without the patch for xenstored the registration of watches will fail and some features of a PVonHVM guest are not available. The guest is still able to boot, but repeated kexec boots will fail."
Sadly this is not true when using a Xen 3.4 hypervisor and booting a PVHVM guest. We end up hanging at:
err = xenbus_scanf(XBT_NIL, "control", "platform-feature-xs_reset_watches", "%d", &supported);
This can easily be seen with guests hanging at xenbus_init:
NX (Execute Disable) protection: active SMBIOS 2.4 present. DMI: Xen HVM domU, BIOS 3.4.0 05/13/2011 Hypervisor detected: Xen HVM Xen version 3.4. Xen Platform PCI: I/O protocol version 1 ... snip .. calling xenbus_init+0x0/0x27e @ 1
Reverting the commit or using the attached patch fixes the issue. This fix checks whether the hypervisor is older than 4.0 and if so does not try to perform the read.
Signed-off-by: Konrad Rzeszutek Wilk konrad.wilk@oracle.com
Signed-off-by: Miroslav Rezanina mrezanin@redhat.com
diff --git a/drivers/xen/xenbus/xenbus_xs.c b/drivers/xen/xenbus/xenbus_xs.c index bce15cf..ca373d1 100644 --- a/drivers/xen/xenbus/xenbus_xs.c +++ b/drivers/xen/xenbus/xenbus_xs.c @@ -47,6 +47,7 @@ #include <xen/xenbus.h> #include <xen/xen.h> #include "xenbus_comms.h" +#include <asm/xen/hypervisor.h>
struct xs_stored_msg { struct list_head list; @@ -617,7 +618,24 @@ static struct xenbus_watch *find_watch(const char *token)
return NULL; } +/* + * Certain older XenBus toolstack cannot handle reading values that are + * not populated. Some Xen 3.4 installation are incapable of doing this + * so if we are running on anything older than 4 do not attempt to read + * control/platform-feature-xs_reset_watches. + */ +static bool xen_strict_xenbus_quirk() +{ + uint32_t eax, ebx, ecx, edx, base; + + base = xen_cpuid_base(); + cpuid(base + 1, &eax, &ebx, &ecx, &edx);
+ if ((eax >> 16) < 4) + return true; + return false; + +} static void xs_reset_watches(void) { int err, supported = 0; @@ -625,6 +643,9 @@ static void xs_reset_watches(void) if (!xen_hvm_domain()) return;
+ if (xen_strict_xenbus_quirk()) + return; + err = xenbus_scanf(XBT_NIL, "control", "platform-feature-xs_reset_watches", "%d", &supported); if (err != 1 || !supported)
On Fri, Oct 19, 2012 at 09:14:20AM -0400, Miroslav Rezanina wrote:
This is backport of upstream commit cb6b6df111e46b9d0f79eb971575fd50555f43f4 that is required to run Fedora 18 as HVM guest on RHEL 5 Xen hypervisor.
This patch is queued for 3.6.3 already. That should be released over the weekend and make it into F18 very shortly thereafter. Is it sufficient to just wait for the stable process to take care of this?
josh
----- Original Message -----
From: "Josh Boyer" jwboyer@redhat.com To: "Miroslav Rezanina" mrezanin@redhat.com Cc: kernel@lists.fedoraproject.org Sent: Friday, October 19, 2012 3:22:51 PM Subject: Re: [PATCH F18] xen/pv-on-hvm kexec: add quirk for Xen 3.4 and shutdown watches
On Fri, Oct 19, 2012 at 09:14:20AM -0400, Miroslav Rezanina wrote:
This is backport of upstream commit cb6b6df111e46b9d0f79eb971575fd50555f43f4 that is required to run Fedora 18 as HVM guest on RHEL 5 Xen hypervisor.
This patch is queued for 3.6.3 already. That should be released over the weekend and make it into F18 very shortly thereafter. Is it sufficient to just wait for the stable process to take care of this?
josh
Yes, it is ok as long as patch get into F18. I'm not familiar with exact fedora kernel process so I post it here to not be missed.
Mirek
kernel mailing list kernel@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/kernel
kernel@lists.fedoraproject.org