Displaying 10 results from an estimated 10 matches for "virtio_pci_config_common_read".
2013 May 29
2
[PATCH RFC] virtio-pci: new config layout: using memory BAR
On 29 May 2013 09:24, Michael S. Tsirkin <mst at redhat.com> wrote:
> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> index f4db224..fd09ea7 100644
> --- a/hw/virtio/virtio-pci.c
> +++ b/hw/virtio/virtio-pci.c
> @@ -467,51 +467,70 @@ static uint64_t virtio_pci_config_common_read(void *opaque, hwaddr addr,
> {
> VirtIOPCIProxy *proxy = opaque;
> VirtIODevice *vdev = proxy->vdev;
> + struct virtio_pci_common_cfg cfg;
>
> uint64_t low = 0xffffffffull;
>
> switch (addr) {
> case offsetof(struct virtio_pci_common_cfg, d...
2013 May 28
5
[PATCH RFC] virtio-pci: new config layout: using memory BAR
On Tue, May 28, 2013 at 12:15:16PM -0500, Anthony Liguori wrote:
> > @@ -455,6 +462,226 @@ static void virtio_pci_config_write(void *opaque, hwaddr addr,
> > }
> > }
> >
> > +static uint64_t virtio_pci_config_common_read(void *opaque, hwaddr addr,
> > + unsigned size)
> > +{
> > + VirtIOPCIProxy *proxy = opaque;
> > + VirtIODevice *vdev = proxy->vdev;
> > +
> > + uint64_t low = 0xffffffffull;
> > +
> > + swit...
2013 May 28
3
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...virtio_pci_set_status(proxy, val);
/* Linux before 2.6.34 sets the device as OK without enabling
the PCI device bus master bit. In this case we need to disable
@@ -455,6 +462,226 @@ static void virtio_pci_config_write(void *opaque, hwaddr addr,
}
}
+static uint64_t virtio_pci_config_common_read(void *opaque, hwaddr addr,
+ unsigned size)
+{
+ VirtIOPCIProxy *proxy = opaque;
+ VirtIODevice *vdev = proxy->vdev;
+
+ uint64_t low = 0xffffffffull;
+
+ switch (addr) {
+ case offsetof(struct virtio_pci_common_cfg, device_feature_sele...
2013 May 28
3
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...virtio_pci_set_status(proxy, val);
/* Linux before 2.6.34 sets the device as OK without enabling
the PCI device bus master bit. In this case we need to disable
@@ -455,6 +462,226 @@ static void virtio_pci_config_write(void *opaque, hwaddr addr,
}
}
+static uint64_t virtio_pci_config_common_read(void *opaque, hwaddr addr,
+ unsigned size)
+{
+ VirtIOPCIProxy *proxy = opaque;
+ VirtIODevice *vdev = proxy->vdev;
+
+ uint64_t low = 0xffffffffull;
+
+ switch (addr) {
+ case offsetof(struct virtio_pci_common_cfg, device_feature_sele...
2013 May 28
0
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...rkin" <mst at redhat.com> writes:
> On Tue, May 28, 2013 at 12:15:16PM -0500, Anthony Liguori wrote:
>> > @@ -455,6 +462,226 @@ static void virtio_pci_config_write(void *opaque, hwaddr addr,
>> > }
>> > }
>> >
>> > +static uint64_t virtio_pci_config_common_read(void *opaque, hwaddr addr,
>> > + unsigned size)
>> > +{
>> > + VirtIOPCIProxy *proxy = opaque;
>> > + VirtIODevice *vdev = proxy->vdev;
>> > +
>> > + uint64_t low = 0xffffffffull;
>>...
2013 May 29
0
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...013 09:24, Michael S. Tsirkin <mst at redhat.com> wrote:
> > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> > index f4db224..fd09ea7 100644
> > --- a/hw/virtio/virtio-pci.c
> > +++ b/hw/virtio/virtio-pci.c
> > @@ -467,51 +467,70 @@ static uint64_t virtio_pci_config_common_read(void *opaque, hwaddr addr,
> > {
> > VirtIOPCIProxy *proxy = opaque;
> > VirtIODevice *vdev = proxy->vdev;
> > + struct virtio_pci_common_cfg cfg;
> >
> > uint64_t low = 0xffffffffull;
> >
> > switch (addr) {
> >...
2013 May 28
0
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...t;
> /* Linux before 2.6.34 sets the device as OK without enabling
> the PCI device bus master bit. In this case we need to disable
> @@ -455,6 +462,226 @@ static void virtio_pci_config_write(void *opaque, hwaddr addr,
> }
> }
>
> +static uint64_t virtio_pci_config_common_read(void *opaque, hwaddr addr,
> + unsigned size)
> +{
> + VirtIOPCIProxy *proxy = opaque;
> + VirtIODevice *vdev = proxy->vdev;
> +
> + uint64_t low = 0xffffffffull;
> +
> + switch (addr) {
> + case offsetof(stru...
2013 May 29
6
[PATCH RFC] virtio-pci: new config layout: using memory BAR
Anthony Liguori <aliguori at us.ibm.com> writes:
> "Michael S. Tsirkin" <mst at redhat.com> writes:
>> + case offsetof(struct virtio_pci_common_cfg, device_feature_select):
>> + return proxy->device_feature_select;
>
> Oh dear no... Please use defines like the rest of QEMU.
It is pretty ugly.
Yet the structure definitions are descriptive,
2013 May 29
6
[PATCH RFC] virtio-pci: new config layout: using memory BAR
Anthony Liguori <aliguori at us.ibm.com> writes:
> "Michael S. Tsirkin" <mst at redhat.com> writes:
>> + case offsetof(struct virtio_pci_common_cfg, device_feature_select):
>> + return proxy->device_feature_select;
>
> Oh dear no... Please use defines like the rest of QEMU.
It is pretty ugly.
Yet the structure definitions are descriptive,
2013 May 29
0
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...t;
virtio: new layout: add offset validation
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index f4db224..fd09ea7 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -467,51 +467,70 @@ static uint64_t virtio_pci_config_common_read(void *opaque, hwaddr addr,
{
VirtIOPCIProxy *proxy = opaque;
VirtIODevice *vdev = proxy->vdev;
+ struct virtio_pci_common_cfg cfg;
uint64_t low = 0xffffffffull;
switch (addr) {
case offsetof(struct virtio_pci_common_cfg, device_feature_select):
+ assert(si...