Displaying 12 results from an estimated 12 matches for "cpu_to_host_notifier16".
2015 Mar 11
4
[PATCH] virtio-pci: fix host notifiers on bi-endian architectures
...gt; > return 0;
> > }
> >
/* The host notifier will be swapped in adjust_endianness() according to the
* target default endianness. We need to negate this swap if the device uses
* an endianness that is not the default (ppc64le for example).
*/
> > +static uint16_t cpu_to_host_notifier16(VirtIODevice *vdev, uint16_t val)
> > +{
> > + return virtio_is_big_endian(vdev) ? val : bswap16(val);
> > +}
> > +
> > static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy,
> > int n, bool a...
2015 Mar 11
4
[PATCH] virtio-pci: fix host notifiers on bi-endian architectures
...gt; > return 0;
> > }
> >
/* The host notifier will be swapped in adjust_endianness() according to the
* target default endianness. We need to negate this swap if the device uses
* an endianness that is not the default (ppc64le for example).
*/
> > +static uint16_t cpu_to_host_notifier16(VirtIODevice *vdev, uint16_t val)
> > +{
> > + return virtio_is_big_endian(vdev) ? val : bswap16(val);
> > +}
> > +
> > static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy,
> > int n, bool a...
2015 Mar 11
1
[Qemu-ppc] [PATCH] virtio-pci: fix host notifiers on bi-endian architectures
..., Greg Kurz wrote:
> /* The host notifier will be swapped in adjust_endianness() according to the
> * target default endianness. We need to negate this swap if the device uses
> * an endianness that is not the default (ppc64le for example).
> */
>
> > > +static uint16_t cpu_to_host_notifier16(VirtIODevice *vdev, uint16_t val)
> > > +{
> > > + return virtio_is_big_endian(vdev) ? val : bswap16(val);
> > > +}
But but but ... The above ... won't it do things like break x86 ? Ie,
shouldn't we swap only if TARGET_BIG_ENDIAN and !virtio_is_big_endian ?
Or...
2015 Mar 11
1
[Qemu-ppc] [PATCH] virtio-pci: fix host notifiers on bi-endian architectures
..., Greg Kurz wrote:
> /* The host notifier will be swapped in adjust_endianness() according to the
> * target default endianness. We need to negate this swap if the device uses
> * an endianness that is not the default (ppc64le for example).
> */
>
> > > +static uint16_t cpu_to_host_notifier16(VirtIODevice *vdev, uint16_t val)
> > > +{
> > > + return virtio_is_big_endian(vdev) ? val : bswap16(val);
> > > +}
But but but ... The above ... won't it do things like break x86 ? Ie,
shouldn't we swap only if TARGET_BIG_ENDIAN and !virtio_is_big_endian ?
Or...
2015 Mar 11
2
[PATCH] virtio-pci: fix host notifiers on bi-endian architectures
...ons(+), 2 deletions(-)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index e7baf7b..62b04c9 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -133,6 +133,11 @@ static int virtio_pci_load_queue(DeviceState *d, int n, QEMUFile *f)
return 0;
}
+static uint16_t cpu_to_host_notifier16(VirtIODevice *vdev, uint16_t val)
+{
+ return virtio_is_big_endian(vdev) ? val : bswap16(val);
+}
+
static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy,
int n, bool assign, bool set_handler)
{
@@ -150,10 +155,12 @@ static int...
2015 Mar 11
2
[PATCH] virtio-pci: fix host notifiers on bi-endian architectures
...ons(+), 2 deletions(-)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index e7baf7b..62b04c9 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -133,6 +133,11 @@ static int virtio_pci_load_queue(DeviceState *d, int n, QEMUFile *f)
return 0;
}
+static uint16_t cpu_to_host_notifier16(VirtIODevice *vdev, uint16_t val)
+{
+ return virtio_is_big_endian(vdev) ? val : bswap16(val);
+}
+
static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy,
int n, bool assign, bool set_handler)
{
@@ -150,10 +155,12 @@ static int...
2015 Mar 11
0
[Qemu-ppc] [PATCH] virtio-pci: fix host notifiers on bi-endian architectures
.../* The host notifier will be swapped in adjust_endianness() according to the
> > * target default endianness. We need to negate this swap if the device uses
> > * an endianness that is not the default (ppc64le for example).
> > */
> >
> > > > +static uint16_t cpu_to_host_notifier16(VirtIODevice *vdev, uint16_t val)
> > > > +{
> > > > + return virtio_is_big_endian(vdev) ? val : bswap16(val);
> > > > +}
>
> But but but ... The above ... won't it do things like break x86 ? Ie,
> shouldn't we swap only if TARGET_BIG_ENDIAN...
2015 Mar 11
0
[Qemu-ppc] [PATCH] virtio-pci: fix host notifiers on bi-endian architectures
.../* The host notifier will be swapped in adjust_endianness() according to the
> > * target default endianness. We need to negate this swap if the device uses
> > * an endianness that is not the default (ppc64le for example).
> > */
> >
> > > > +static uint16_t cpu_to_host_notifier16(VirtIODevice *vdev, uint16_t val)
> > > > +{
> > > > + return virtio_is_big_endian(vdev) ? val : bswap16(val);
> > > > +}
>
> But but but ... The above ... won't it do things like break x86 ? Ie,
> shouldn't we swap only if TARGET_BIG_ENDIAN...
2015 Mar 11
0
[PATCH] virtio-pci: fix host notifiers on bi-endian architectures
...virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index e7baf7b..62b04c9 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -133,6 +133,11 @@ static int virtio_pci_load_queue(DeviceState *d, int n, QEMUFile *f)
> return 0;
> }
>
> +static uint16_t cpu_to_host_notifier16(VirtIODevice *vdev, uint16_t val)
> +{
> + return virtio_is_big_endian(vdev) ? val : bswap16(val);
> +}
> +
> static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy,
> int n, bool assign, bool set_handler)
>...
2015 Mar 11
0
[PATCH] virtio-pci: fix host notifiers on bi-endian architectures
...virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index e7baf7b..62b04c9 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -133,6 +133,11 @@ static int virtio_pci_load_queue(DeviceState *d, int n, QEMUFile *f)
> return 0;
> }
>
> +static uint16_t cpu_to_host_notifier16(VirtIODevice *vdev, uint16_t val)
> +{
> + return virtio_is_big_endian(vdev) ? val : bswap16(val);
> +}
> +
> static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy,
> int n, bool assign, bool set_handler)
>...
2015 Mar 12
0
[PATCH] virtio-pci: fix host notifiers on bi-endian architectures
...; > >
>
> /* The host notifier will be swapped in adjust_endianness() according to the
> * target default endianness. We need to negate this swap if the device uses
> * an endianness that is not the default (ppc64le for example).
> */
>
> > > +static uint16_t cpu_to_host_notifier16(VirtIODevice *vdev, uint16_t val)
> > > +{
> > > + return virtio_is_big_endian(vdev) ? val : bswap16(val);
> > > +}
> > > +
> > > static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy,
> > >...
2015 Mar 12
0
[PATCH] virtio-pci: fix host notifiers on bi-endian architectures
...; > >
>
> /* The host notifier will be swapped in adjust_endianness() according to the
> * target default endianness. We need to negate this swap if the device uses
> * an endianness that is not the default (ppc64le for example).
> */
>
> > > +static uint16_t cpu_to_host_notifier16(VirtIODevice *vdev, uint16_t val)
> > > +{
> > > + return virtio_is_big_endian(vdev) ? val : bswap16(val);
> > > +}
> > > +
> > > static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy,
> > >...