* [PATCHv1] xen-blkback: default to X86_32 ABI on x86
@ 2015-02-05 17:09 David Vrabel
2015-02-05 19:44 ` Konrad Rzeszutek Wilk
2015-02-09 12:24 ` Roger Pau Monné
0 siblings, 2 replies; 4+ messages in thread
From: David Vrabel @ 2015-02-05 17:09 UTC (permalink / raw)
To: xen-devel; +Cc: David Vrabel
Prior to the existance of 64-bit backends using the X86_64 ABI,
frontends used the X86_32 ABI. These old frontends do not specify the
ABI and when used with a 64-bit backend do not work.
On x86, default to the X86_32 ABI if one is not specified. Backends
on ARM continue to default to their NATIVE ABI.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
drivers/block/xen-blkback/common.h | 9 +++++++++
drivers/block/xen-blkback/xenbus.c | 4 ++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h
index f65b807..78b0411 100644
--- a/drivers/block/xen-blkback/common.h
+++ b/drivers/block/xen-blkback/common.h
@@ -214,6 +214,15 @@ enum blkif_protocol {
BLKIF_PROTOCOL_X86_64 = 3,
};
+/*
+ * Default protocol if the frontend doesn't specify one.
+ */
+#ifdef CONFIG_X86
+# define BLKIF_PROTOCOL_DEFAULT BLKIF_PROTOCOL_X86_32
+#else
+# define BLKIF_PROTOCOL_DEFAULT BLKIF_PROTOCOL_NATIVE
+#endif
+
struct xen_vbd {
/* What the domain refers to this vbd as. */
blkif_vdev_t handle;
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index 630a489..e3afe97 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -868,11 +868,11 @@ static int connect_ring(struct backend_info *be)
return err;
}
- be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE;
+ be->blkif->blk_protocol = BLKIF_PROTOCOL_DEFAULT;
err = xenbus_gather(XBT_NIL, dev->otherend, "protocol",
"%63s", protocol, NULL);
if (err)
- strcpy(protocol, "unspecified, assuming native");
+ strcpy(protocol, "unspecified, assuming default");
else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE))
be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE;
else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32))
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCHv1] xen-blkback: default to X86_32 ABI on x86
2015-02-05 17:09 [PATCHv1] xen-blkback: default to X86_32 ABI on x86 David Vrabel
@ 2015-02-05 19:44 ` Konrad Rzeszutek Wilk
2015-02-06 10:22 ` David Vrabel
2015-02-09 12:24 ` Roger Pau Monné
1 sibling, 1 reply; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-02-05 19:44 UTC (permalink / raw)
To: David Vrabel; +Cc: xen-devel
On Thu, Feb 05, 2015 at 05:09:56PM +0000, David Vrabel wrote:
> Prior to the existance of 64-bit backends using the X86_64 ABI,
> frontends used the X86_32 ABI. These old frontends do not specify the
> ABI and when used with a 64-bit backend do not work.
Whoa. How old are we talking? I had been using RHEL5 guests and
those work OK (64bit dom0, 32-bit domU).
>
> On x86, default to the X86_32 ABI if one is not specified. Backends
> on ARM continue to default to their NATIVE ABI.
>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> ---
> drivers/block/xen-blkback/common.h | 9 +++++++++
> drivers/block/xen-blkback/xenbus.c | 4 ++--
> 2 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h
> index f65b807..78b0411 100644
> --- a/drivers/block/xen-blkback/common.h
> +++ b/drivers/block/xen-blkback/common.h
> @@ -214,6 +214,15 @@ enum blkif_protocol {
> BLKIF_PROTOCOL_X86_64 = 3,
> };
>
> +/*
> + * Default protocol if the frontend doesn't specify one.
> + */
> +#ifdef CONFIG_X86
> +# define BLKIF_PROTOCOL_DEFAULT BLKIF_PROTOCOL_X86_32
> +#else
> +# define BLKIF_PROTOCOL_DEFAULT BLKIF_PROTOCOL_NATIVE
> +#endif
> +
> struct xen_vbd {
> /* What the domain refers to this vbd as. */
> blkif_vdev_t handle;
> diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
> index 630a489..e3afe97 100644
> --- a/drivers/block/xen-blkback/xenbus.c
> +++ b/drivers/block/xen-blkback/xenbus.c
> @@ -868,11 +868,11 @@ static int connect_ring(struct backend_info *be)
> return err;
> }
>
> - be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE;
> + be->blkif->blk_protocol = BLKIF_PROTOCOL_DEFAULT;
> err = xenbus_gather(XBT_NIL, dev->otherend, "protocol",
> "%63s", protocol, NULL);
> if (err)
> - strcpy(protocol, "unspecified, assuming native");
> + strcpy(protocol, "unspecified, assuming default");
> else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE))
> be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE;
> else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32))
> --
> 1.7.10.4
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv1] xen-blkback: default to X86_32 ABI on x86
2015-02-05 19:44 ` Konrad Rzeszutek Wilk
@ 2015-02-06 10:22 ` David Vrabel
0 siblings, 0 replies; 4+ messages in thread
From: David Vrabel @ 2015-02-06 10:22 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk, David Vrabel; +Cc: xen-devel
On 05/02/15 19:44, Konrad Rzeszutek Wilk wrote:
> On Thu, Feb 05, 2015 at 05:09:56PM +0000, David Vrabel wrote:
>> Prior to the existance of 64-bit backends using the X86_64 ABI,
>> frontends used the X86_32 ABI. These old frontends do not specify the
>> ABI and when used with a 64-bit backend do not work.
>
> Whoa. How old are we talking? I had been using RHEL5 guests and
> those work OK (64bit dom0, 32-bit domU).
Unfortunately I can't remember and the internal commit is tagged with
the wrong bug number. I think it was either sles 9 or rhel 4.
David
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv1] xen-blkback: default to X86_32 ABI on x86
2015-02-05 17:09 [PATCHv1] xen-blkback: default to X86_32 ABI on x86 David Vrabel
2015-02-05 19:44 ` Konrad Rzeszutek Wilk
@ 2015-02-09 12:24 ` Roger Pau Monné
1 sibling, 0 replies; 4+ messages in thread
From: Roger Pau Monné @ 2015-02-09 12:24 UTC (permalink / raw)
To: David Vrabel, xen-devel
El 05/02/15 a les 18.09, David Vrabel ha escrit:
> Prior to the existance of 64-bit backends using the X86_64 ABI,
> frontends used the X86_32 ABI. These old frontends do not specify the
> ABI and when used with a 64-bit backend do not work.
>
> On x86, default to the X86_32 ABI if one is not specified. Backends
> on ARM continue to default to their NATIVE ABI.
>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
I don't see anything wrong with changing the default protocol from
native to the 32bit variant.
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Roger.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-02-09 12:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-05 17:09 [PATCHv1] xen-blkback: default to X86_32 ABI on x86 David Vrabel
2015-02-05 19:44 ` Konrad Rzeszutek Wilk
2015-02-06 10:22 ` David Vrabel
2015-02-09 12:24 ` Roger Pau Monné
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.