Re: [SeaBIOS] [PATCH 07/18] virtio: add version 1.0 read/write macros

2015-06-29 Thread Kevin O'Connor
On Mon, Jun 29, 2015 at 10:53:29AM +0200, Gerd Hoffmann wrote: Add macros to read/write registers of virtio-1.0 regions. Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/virtio-pci.h | 76 + 1 file changed, 76 insertions(+)

Re: [SeaBIOS] [PATCH 03/18] virtio: add struct vp_device

2015-06-29 Thread Gerd Hoffmann
On Mo, 2015-06-29 at 08:48 -0400, Kevin O'Connor wrote: On Mon, Jun 29, 2015 at 10:53:25AM +0200, Gerd Hoffmann wrote: For virtio 1.0 support we will need more state than just the (legacy mode) ioaddr for each virtio-pci device. Prepare for that by adding a new struct for it. For now it

Re: [SeaBIOS] [PATCH 07/18] virtio: add version 1.0 read/write macros

2015-06-29 Thread Gerd Hoffmann
On Mo, 2015-06-29 at 09:02 -0400, Kevin O'Connor wrote: On Mon, Jun 29, 2015 at 10:53:29AM +0200, Gerd Hoffmann wrote: Add macros to read/write registers of virtio-1.0 regions. Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/virtio-pci.h | 76

Re: [SeaBIOS] [PATCH 03/18] virtio: add struct vp_device

2015-06-29 Thread Kevin O'Connor
On Mon, Jun 29, 2015 at 10:53:25AM +0200, Gerd Hoffmann wrote: For virtio 1.0 support we will need more state than just the (legacy mode) ioaddr for each virtio-pci device. Prepare for that by adding a new struct for it. For now it carries the ioaddr only. Signed-off-by: Gerd Hoffmann

Re: [SeaBIOS] [PATCH 05/18] virtio: add version 1.0 structs and #defines

2015-06-29 Thread Kevin O'Connor
On Mon, Jun 29, 2015 at 03:35:59PM +0200, Gerd Hoffmann wrote: Hi, +typedef struct virtio_pci_common_cfg { +/* About the whole device. */ +u32 device_feature_select; /* read-write */ If I understand these structs correctly, they don't reside in memory, but instead

Re: [SeaBIOS] [PATCH 05/18] virtio: add version 1.0 structs and #defines

2015-06-29 Thread Kevin O'Connor
On Mon, Jun 29, 2015 at 10:53:27AM +0200, Gerd Hoffmann wrote: Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/virtio-pci.h | 59 src/hw/virtio-ring.h | 5 + 2 files changed, 64 insertions(+) diff --git

Re: [SeaBIOS] [PATCH 10/18] virtio: add version 1.0 support to vp_get_isr

2015-06-29 Thread Kevin O'Connor
On Mon, Jun 29, 2015 at 10:53:32AM +0200, Gerd Hoffmann wrote: Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/virtio-pci.c | 12 src/hw/virtio-pci.h | 6 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/hw/virtio-pci.c

Re: [SeaBIOS] [PATCH 00/18] virtio: add version 1.0 support

2015-06-29 Thread Kevin O'Connor
On Mon, Jun 29, 2015 at 10:53:22AM +0200, Gerd Hoffmann wrote: Hi, This patch series adds virtio 1.0 support to the virtio blk and scsi drivers in seabios. With this series applied seabios happily boots in virtio 1.0 mode from both transitional and modern devices. Thanks. The series

Re: [SeaBIOS] [PATCH 10/18] virtio: add version 1.0 support to vp_get_isr

2015-06-29 Thread Gerd Hoffmann
Hi, +u8 vp_get_isr(struct vp_device *vp) +{ +u8 isr; + +if (vp-use_modern) { +vp_modern_read(vp-isr, virtio_pci_isr, isr, isr); +} else { +isr = inb(vp-ioaddr + VIRTIO_PCI_ISR); +} +return isr; +} How about renaming use_modern to

Re: [SeaBIOS] [PATCH] virtio: add struct vp_device

2015-06-29 Thread Gerd Hoffmann
Hi, You could use the config capability if you wanted to, though that multiplies the cost of each access by a factor of ~4. We are moving to 32bit drivers _anyway_, some of our drivers run in 32bit mode already, and with SMM mode landing in kvm now we have a reliable way to transition to

[SeaBIOS] [PATCH 04/18] virtio: pass struct pci_device to vp_init_simple

2015-06-29 Thread Gerd Hoffmann
... instead of the bdf only. Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/virtio-blk.c | 2 +- src/hw/virtio-pci.c | 6 +++--- src/hw/virtio-pci.h | 3 ++- src/hw/virtio-scsi.c | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/hw/virtio-blk.c

[SeaBIOS] [PATCH 15/18] virtio-scsi: fix initialization for version 1.0

2015-06-29 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/virtio-scsi.c | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/hw/virtio-scsi.c b/src/hw/virtio-scsi.c index b208d49..3ee0f49 100644 --- a/src/hw/virtio-scsi.c +++ b/src/hw/virtio-scsi.c @@

[SeaBIOS] [PATCH 05/18] virtio: add version 1.0 structs and #defines

2015-06-29 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/virtio-pci.h | 59 src/hw/virtio-ring.h | 5 + 2 files changed, 64 insertions(+) diff --git a/src/hw/virtio-pci.h b/src/hw/virtio-pci.h index 3cf0327..e6f9c0b 100644 ---

[SeaBIOS] [PATCH 10/18] virtio: add version 1.0 support to vp_get_isr

2015-06-29 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/virtio-pci.c | 12 src/hw/virtio-pci.h | 6 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/hw/virtio-pci.c b/src/hw/virtio-pci.c index b414c71..481b365 100644 --- a/src/hw/virtio-pci.c +++

[SeaBIOS] [PATCH 16/18] virtio-blk: fix initialization for version 1.0

2015-06-29 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/virtio-blk.c | 85 + src/hw/virtio-pci.h | 13 2 files changed, 72 insertions(+), 26 deletions(-) diff --git a/src/hw/virtio-blk.c b/src/hw/virtio-blk.c index 9e56d42..b7c24f8

[SeaBIOS] [PATCH 12/18] virtio: add version 1.0 support to vp_notify

2015-06-29 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/virtio-pci.c | 22 +- src/hw/virtio-pci.h | 7 ++- src/hw/virtio-ring.c | 2 +- src/hw/virtio-ring.h | 1 + 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/hw/virtio-pci.c

[SeaBIOS] [PATCH 17/18] virtio: use version 1.0 if available (flip the big switch)

2015-06-29 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/virtio-pci.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/hw/virtio-pci.c b/src/hw/virtio-pci.c index c80d38d..808e102 100644 --- a/src/hw/virtio-pci.c +++ b/src/hw/virtio-pci.c @@ -287,13 +287,16 @@

[SeaBIOS] [PATCH 02/18] virtio: run drivers in 32bit mode

2015-06-29 Thread Gerd Hoffmann
virtio version 1.0 registers can (and actually do in the qemu implementation) live in mmio space. So we must run the blk and scsi virtio drivers in 32bit mode, otherwise we can't access them. This also allows to drop a bunch of GET_LOWFLAT calls from the virtio code in the following patches.

[SeaBIOS] [PATCH 08/18] virtio: make features 64bit, support version 1.0 features

2015-06-29 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/virtio-blk.c | 2 +- src/hw/virtio-pci.c | 41 + src/hw/virtio-pci.h | 12 +++- 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/src/hw/virtio-blk.c b/src/hw/virtio-blk.c

[SeaBIOS] [PATCH 01/18] pci: allow to loop over capabilities

2015-06-29 Thread Gerd Hoffmann
Add a parameter to pci_find_capability, to specify the start point. This allows to find multiple capabilities of the same type, by calling pci_find_capability again with the offset of the last capability found. Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/fw/pciinit.c | 4 ++--

[SeaBIOS] [PATCH 07/18] virtio: add version 1.0 read/write macros

2015-06-29 Thread Gerd Hoffmann
Add macros to read/write registers of virtio-1.0 regions. Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/virtio-pci.h | 76 + 1 file changed, 76 insertions(+) diff --git a/src/hw/virtio-pci.h b/src/hw/virtio-pci.h index

[SeaBIOS] [PATCH 18/18] virtio: also probe version 1.0 pci ids

2015-06-29 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/pci_ids.h | 8 ++-- src/hw/virtio-blk.c | 5 +++-- src/hw/virtio-scsi.c | 5 +++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/hw/pci_ids.h b/src/hw/pci_ids.h index 1cd4f72..cdf9b3c 100644 ---

Re: [SeaBIOS] [PATCH] virtio: add struct vp_device

2015-06-29 Thread Michael S. Tsirkin
On Fri, Jun 26, 2015 at 10:46:10AM +0200, Gerd Hoffmann wrote: Hi, It sounds like this patch is in preparation for some other patches. It would help to see those other patches as well. Yes. Still coding though ... Patch series adds support for virtio-1.0. Still in progress.

[SeaBIOS] [PATCH 13/18] virtio: remove unused vp_del_vq

2015-06-29 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/virtio-pci.h | 11 --- 1 file changed, 11 deletions(-) diff --git a/src/hw/virtio-pci.h b/src/hw/virtio-pci.h index 495c0aa..468eb6f 100644 --- a/src/hw/virtio-pci.h +++ b/src/hw/virtio-pci.h @@ -208,17 +208,6 @@ void

[SeaBIOS] [PATCH 00/18] virtio: add version 1.0 support

2015-06-29 Thread Gerd Hoffmann
Hi, This patch series adds virtio 1.0 support to the virtio blk and scsi drivers in seabios. With this series applied seabios happily boots in virtio 1.0 mode from both transitional and modern devices. Tested with Fedora 22 guest, booting from virtio-scsi cdrom (live iso), virtio-scsi disk

[SeaBIOS] [PATCH 11/18] virtio: add version 1.0 support to vp_reset

2015-06-29 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann kra...@redhat.com --- src/hw/virtio-pci.c | 16 src/hw/virtio-pci.h | 9 + 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/hw/virtio-pci.c b/src/hw/virtio-pci.c index 481b365..d2d06c5 100644 --- a/src/hw/virtio-pci.c +++